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
Refine 'RefTo' and 'ContentTypeFormat' #21
Conversation
Signed-off-by: weiyang <weiyang.ones@gmail.com>
Thank you for your excellent work again. |
Pull Request Test Coverage Report for Build 701801266
💛 - Coveralls |
Thanks for the PR!
A free-form text representation of media types is problematic in downstream code generators that utilise the python type to match unique traits of the media types (like https://github.com/avanov/openapi-client-generator/blob/a058af4ec28a1e53809273a662fb8cba0157695e/openapi_client_generator/transformers/__init__.py#L659), like them being markers of a plain JSON response or a binary stream. As there's a whole range of prefixes and suffixes that still belong to the same common traits like JSON responses and streamed data, the media type representation should carry this additional information in the type to facilitate downstream libraries that rely on exact matching of the mentioned traits, and therefore I cannot keep it as a free-form string for long. RFC6838 suggests it too - the parser should be aware that the media type string is not exactly a free-form string - it is formatted according to strict rules, and hence all ill-formated representations of a media type should be rejected. I'm happy to merge your PR now to unblock your use cases, but the free-form string representation of it will be switched for a more precise parser at some point. |
That's great, thank you again for your excellent work. |
No problem! I will publish a new version of the package a bit later this week. |
* Refine 'RefTo' and 'ContentTypeFormat' (#21) * Release 0.1.0 Co-authored-by: weiyang <weiyang.ones@gmail.com>
Signed-off-by: weiyang weiyang.ones@gmail.com
Hi friends, first of all, thank you for your excellent work.
I encountered two problems while using
openapi-type
:Unrecognised reference location "requestBodies"
Unsupported Media Type format "multipart/form-data"
To solve these problems I have made the following changes:
ContentTypeFormat
tostr
.Related documents: Media Types.
["examples", "requestBodies", "securitySchemes", "callbacks"]
to 'RefTo'.All fixed fields can be found at Fixed Fields.