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

Add @oneOf decorator to JSON Schema emitter #3544

Closed
3 tasks done
adamscybot opened this issue Jun 6, 2024 · 0 comments · Fixed by #3557
Closed
3 tasks done

Add @oneOf decorator to JSON Schema emitter #3544

adamscybot opened this issue Jun 6, 2024 · 0 comments · Fixed by #3557

Comments

@adamscybot
Copy link

Clear and concise description of the problem

I am using the JSON Schema emitter, as opposed to the OpenAPI emitter.

In the JSON Schema emitter, unions by default output as anyOf, which I believe to be sensible, and it is also consistent with the behaviour of the OpenAPI emitter.

However, unlike the OpenAPI emitter, there appears to be no parallel to the @oneOf decorator to force the use of oneOf over anyOf.

I would quite like this capability for some use cases in my schemas. Side point, but any workaround that I could do in the short term would be awesome too!

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants