Skip to content

[Feature]: Support differences in examples between Parameter/Media Type and Schema #1994

@DerManoMann

Description

@DerManoMann

Problem Statement

It LOOKS like there is a difference between the way examples are structured on for instance Parameters as they are are on Schema.

The place I’m relying on is 4.8.19.2 “Working with Examples”:

https://spec.openapis.org/oas/v3.1.1.html#working-with-examples

That section distinguishes between:

Parameter/Media Type `example`s, which use Example Objects
Schema Object examples, which it describes as “the current plural examples, which takes an array of examples”

And the schema example in 4.8.24.6.5 shows the emitted shape as a plain array of literal values, not Example Objects:

https://spec.openapis.org/oas/v3.1.1.html#model-with-example

So my reading is:

Parameter.examples / MediaType.examples => map of Example Objects
Schema.examples => array of literal examples

Proposed Solution

Treat examples on Property / Media Type differently.

Alternatives Considered

No response

Priority

priority/critical

Area

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions