Skip to content

Clarify difference between OAS "examples" and JSON Schema "examples" #2094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
darrelmiller opened this issue Jan 9, 2020 · 4 comments
Closed
Assignees
Milestone

Comments

@darrelmiller
Copy link
Member

OAS examples is a map. JSON Schema examples is an array.

@philsturgeon
Copy link
Contributor

Any tips on where to put this?

@darrelmiller darrelmiller modified the milestones: v3.1.0-rc1, v3.1.0-rc0 Feb 13, 2020
@darrelmiller darrelmiller self-assigned this Feb 13, 2020
@kevinoid
Copy link

I just ran across this issue and I'm a bit confused. Clarification would be greatly appreciated.

You are probably already aware, but the "In a model" example from the Example Object Examples sub-section of Example Object (in 3.0.2, 3.0.3, and 3.1.0) appears to show an OAS Map[ string, Example Object ] on a Schema Object.

For 3.0.2/3.0.3 this is confusing, since Write Draft 00 doesn't have examples and I don't see the property mentioned as an OAS addition in Schema Object.

For 3.1.0, if examples on Schema Object should be examples from JSON Schema Draft 2019-09, the example would appear to be invalid and should probably be removed from the OAS Example Object section.

@darrelmiller
Copy link
Member Author

That seems wrong to me. There was never supposed to be examples in the schema object. We explicitly chose that so as not to conflict with the examples that was coming in JSON Schema.

Thank you for seeing this. We will review and remove these incorrect examples.

@darrelmiller
Copy link
Member Author

The bad example has been removed. Describing the distinction between examples in a schema and examples in a media type object should be done in the getting started guide, not in the specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants