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

Emit nullable_item last for OneOfBuilder #1299

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

Conversation

frederikrothenberger
Copy link

This PR changes the order in which the #nullable_item is emitted when processing the OneOfBuilder. This leads to much better example values in the Swagger UI, as by default the example just picks the first one of the options.

This change is inspired by this comment: #1260 (comment)

What we could at least do is to change the order of the types in oneOf to make the null variant below, which will help the Swagger UI to use the correct spec as an example because it chooses the first one from the list.

Please take a look!

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.

1 participant