Skip to content
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

Update openapi.yml to v3.1.0 fix deprecated fields #1811

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0ex-d
Copy link

@0ex-d 0ex-d commented Jan 18, 2025

Update to latest spec and remove deprecated field (example -> examples)
For more information, please refer to this https://spec.openapis.org/oas/v3.1.0.html#example-object

Closes #1789

@0ex-d
Copy link
Author

0ex-d commented Jan 18, 2025

For the new spec, examples is an array that get's rendered as a dropdown of options, please advice if this is how the UI should appear.
illus
CC: @peterjan @lukechampine

@peterjan
Copy link
Member

@0ex-d I took a quick look at how we use examples and suggest we drop them where they no longer make sense in OpenAPI 3.1.0. We do need to ensure that when we remove an example, the schema still specifies the type and any patterns or constraints that the field must meet.

For instance, if an object has a field like blockheight, I sometimes specified example: 506412 to make the output less dull, as it would otherwise display blockheight: 0. It doesn't make sense to rewrite such examples into an examples object in 3.1.0. In such cases, you can remove the examples entirely.

@peterjan peterjan mentioned this pull request Jan 23, 2025
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

Successfully merging this pull request may close these issues.

Update openapi.yml to v3.1.0
2 participants