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 support for json schema oneOf enumStrategy #2504

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

Conversation

nated0g
Copy link

@nated0g nated0g commented Feb 3, 2025

Background

  • What do these changes do?

This adds support for a new json schema setting, enumStrategy, that allows for variants enum (current behaviour, and default) and oneOf (gets converted to a oneOf with const string values, allowing for documentation of individual enum variants.)

I'm new to this codebase, let me know if there are other considerations I may have missed here

  • Why are they important?

Allows for documentation on enum variants in an open-api schema for example. The current behaviour (which will remain the default), doesn't allow documentation at the variant level

Testing

  • How did you test these changes?

Added unit test cases to JsonSchemaConverterTest.

ran ./gradlew build

Links

  • Links to additional context, if necessary

For: #2481


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This adds support for a new json schema setting, `enumStrategy`, that allows for variants
`enum` (current behaviour, and default) and `oneOf` (gets converted to a oneOf with const
string values, allowing for documentation of individual enum variants.)
@nated0g nated0g requested a review from a team as a code owner February 3, 2025 19:58
@nated0g nated0g requested a review from haydenbaker February 3, 2025 19:58
Copy link

@Dorenavant Dorenavant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, LGTM

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.

2 participants