-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Description
Context
OpenAPI spec 3.1 announced support for multiple examples inside a schema (not to be confused with multiple examples for request/response which has been supported for a while now).
I was trying to check out how this feature looks like, but it seems is not yet supported by SwaggerUI latest version (5.2.4
as of now).
Specs
The following, single example syntax is supported at 3.0.2
:
components:
schemas:
Cat:
type: object
required: [name, livesLeft]
properties:
name:
type: string
livesLeft:
type: integer
example:
name: Grumpy
livesLeft: 2
It renders
However, if I try to switch to 3.1.0
and use multiple examples
components:
schemas:
Cat:
type: object
required: [name, livesLeft]
properties:
name:
type: string
livesLeft:
type: integer
examples:
- name: Grumpy
livesLeft: 2
- name: Felix
livesLeft: 3
the following is rendered
Which is incorrect, as it looks as if Examples
was a property of a Cat
object.
Are there any plans to add support for this feature? Thanks
kubukoz, hkosova and nhannh23
Metadata
Metadata
Assignees
Labels
No labels