Content-Type application/json;charset=UTF-8
is not serialized/deserialized as JSON
#767
Labels
application/json;charset=UTF-8
is not serialized/deserialized as JSON
#767
Jane version(s) affected: 7.5.4
Description
If a JSON content type is including a charset suffix like
application/json;charset=UTF-8
, it is not serialized or deserialzed (depending on if it is present in request or response body schema) to/from JSON.How to reproduce
The generated Endpoint will neither encode the request body to JSON (leading to a Type Error when passing the body data to StreamFactory::createStream) nor decode a JSON response to object.
Possible Solution
It seems like a similar bug was fixed in #115. I managed to hack a workaround by modifying
RequestBodyGenerator
, to only check the content type string before the;
character against the registered generators.If this sounds like a legit approach I'd be willing to submit a PR containing this fix.
The text was updated successfully, but these errors were encountered: