Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a rule to check for valid / recommended media types #64

Open
mikekistler opened this issue Jan 31, 2022 · 0 comments
Open

Add a rule to check for valid / recommended media types #64

mikekistler opened this issue Jan 31, 2022 · 0 comments

Comments

@mikekistler
Copy link
Member

Most Azure services simply accept and return "application/json" bodies, and this is the recommended design (except for PATCH, which should be "application/merge-patch+json".

A few other media types are common and generally acceptable:

  • "application/octet-stream", "text/plain", "text/csv"
  • "multipart/form-data" when used alone (see below)

But there are cases where services define invalid content types or use valid types in a way that is not recommended:

  • "" can only be used for the type or subtype -- not as a wildcard character. So "application/+json" is invalid (according to the BNF in RFC 6838) -- this comes from appconfiguration.json.
  • "multipart/form-data" with any other content type. This is a problem because OAS2 does not allow both "form" and "body" parameters on a single operation.
  • "text/json" -- commonly seen with "application/json". These are essentially the same thing, so no need to have both of them, especially in "produces"

We may want to decide on whether parameters should be allowed -- there are more than a few instances of ""application/json; charset=utf-8" in the current specs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant