Respect charsets in JSON content types#1294
Respect charsets in JSON content types#1294christiannicola wants to merge 1 commit intooapi-codegen:masterfrom
Conversation
This commit fixes an issue with the codegeneration - when specifying a charset in a JSON content type, the resulting request / response bodies are missing the JSON serializer. The charset is usually redundant, since JSON should usually be encoded using UTF-8 (see https://www.rfc-editor.org/rfc/rfc8259#section-8.1), however there are some code generators out there that do not honor this (for example: OpenAPITools/openapi-generator#12797)
|
Just to confirm, why are we needing to add this? Because some code generators default to adding the charset so we want to make sure this aligns? Or because you're integrating this project with a generator that adds the charset and therefore can't interact with this? This may make sense (for some of this) to be an opt-in feature in a compatability option, but let's see |
|
@jamietanna The code generation does not correctly handle a content type like That alone would be an improvement. Defining a |
|
Gotcha, thanks for confirming! |
|
Hey @christiannicola apologies for the delay on this one, this will now be handled correctly due to #1385 🚀 |
This commit fixes an issue with the codegeneration - when specifying a charset in a JSON content type, the resulting request / response bodies are missing the JSON serializer.
The charset is usually redundant, since JSON should usually be encoded using UTF-8 (see https://www.rfc-editor.org/rfc/rfc8259#section-8.1), however there are some code generators out there that do not honor this (for example: OpenAPITools/openapi-generator#12797)