this is probably the most used multipart type. multipart/related can also be used but is less common; it supposed to be a root document which references annexes
Note that different schemas per media type aren't well supported by code generators (openapi generator). It just generates for the first specified media type and doesn't seem to take encoding spec into consideration.
Multiple schemas in input (JAX-RS):
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Request"
application/octet-stream:
schema:
type: string
format: binary
[WARNING] Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[WARNING] Multiple MediaTypes found, using only the first one
Elaborate guidelines on media types:
*/*
Note that different schemas per media type aren't well supported by code generators (openapi generator). It just generates for the first specified media type and doesn't seem to take
encoding
spec into consideration.Multiple schemas in input (JAX-RS):
for response:
multipart/form-data response in spring generates the POJO with a schema and application/json Content-Type. To workaround: