-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
The 3.0 Specification contains examples where the request and response content includes wildcard media types, e.g. here:
https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#request-body-examples
https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#path-item-object-example
description: user to add to the system
content:
'application/json':
schema:
$ref: '#/components/schemas/User'
...
'*/*':
examples:
user:
summary: User example in other format
externalValue: 'http://foo.bar/examples/user-example.whatever'Are these examples valid and wildcard types actually supported?
The description of content says just this (emphasis mine):
content
Map[string, Media Type Object]
REQUIRED. The content of the request body. The key is the media type and the value describes it.
For comparison, the Encoding Object explicitly states that wildcard types are allowed:
contentType
... 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.
If wildcard types are supported in content, how does this work? Do more specific types have preference over wildcard ones, e.g. image/png > image/* > */*?