Search code examples
azureswaggermimeprotobuf-netazure-functions

What MIME type should my Protobuf Swagger API use?


I have a custom protobuf output/input for an Azure Function.

  • What is an appropriate MIME format for this?

If it's true that there is no generic protobuf reader, and that the client would need a custom parser for my application specific protobuf output, then that makes me think

mime: application/myAppName+Protobuf

... is appropriate (without the plus sign).

What other rationale should I consider?


Solution

  • I would think about MIME types in the same way as file extensions, and on the topic of protobuf, the advice is that the extension should reflect your usage, not the fact that it is protobuf.

    If we use the same approach, then perhaps just application/myAppName. But ultimately, as long as your consumers understand your intent, it doesn't really matter.