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

FEAT: add open api schema extension #486

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rreckonerr
Copy link

This PR refactors the JSON schema compiler logic by extracting it into a base class, enabling the new OpenAPI schema extension to reuse and extend its functionality.

In the process of migrating our Rails request tests to rswag, I converted our Dry Schemas directly into OpenAPI schema. Since Dry Schema already had JSON Schema extension support, this approach was straightforward to implement.

Note: Although the contribution guidelines suggest linking to a reported issue, I wasn't able to create an issue for this functionality without using a bug report template.

# },
# favorite_color: {
# type: "string",
# minLength: 1,
Copy link
Author

Choose a reason for hiding this comment

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

Hmm, this seems to be not necessary for "filled" enums, will add more tests for cases like this and adjust the implementation

Copy link
Author

Choose a reason for hiding this comment

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

We should also add an additional null enum along with the nullable: true flag for optional enums.

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