Closed rtyping closed 10 months ago
Hi @rtyping, there is a possibility to disable strict content-type checks with parse()
function calls by passing strict_enum=False
as an argument. It will allow you to use any Content-Type you want, even if it is not officially registered as a media type. However, I will extend the current enum with a few more values for images.
Thank you very much for the correction. The strict_enum flag is also useful. Have a good day!
What is a problem? OpenApi specification describes the ContentType as:
The Content-Type for encoding a specific property. Default value depends on the property type: for string with format being binary – application/octet-stream; for other primitive types – text/plain; for object - application/json; for array – the default is defined based on the inner type. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types.
precisely *a wildcard media type (e.g. image/)**
Openapi3-parser support only one image type: image/png
Describe the solution you'd like Openapi3-parser is able to parse Content type with various types of images, for example image/jpeg and others
Describe alternatives you've considered
Additional context https://spec.openapis.org/oas/v3.0.3#fixed-fields-12