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 json schema dialect property #675

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

Azquelt
Copy link
Member

@Azquelt Azquelt commented Dec 3, 2024

Add jsonSchemaDialect to the model and annotations.

In the model test, I've put the JSON Schema 2020-12 dialect and as it's in the model, I expect it to be passed through as-is.

In the annotation test, I've put the OAS default schema dialect since I don't think we can reasonably rely on an implementation to have well defined behaviour for any other values. An implementation could reasonably do any of the following:

  • generate schemas in the specified dialect
  • generate schemas in the OAS default dialect and set $schema in all of them, overriding the default set at the top level
  • report an error and generate nothing

Fixes #660

Copy link
Member

@MikeEdgar MikeEdgar left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks @Azquelt

@Azquelt
Copy link
Member Author

Azquelt commented Dec 10, 2024

I'd like to implement this in SmallRye before merging to validate that the new tests are passable.

@Azquelt
Copy link
Member Author

Azquelt commented Jan 20, 2025

Removed the annotation field. Any non-default schema dialect would need explicit support from the implementation and even if we did have an implementation which supported a non-default schema dialect, I'm not sure this is the most intuitive way of specifying that it should be used.

@Azquelt Azquelt force-pushed the add-json-schema-dialect branch from 18b6ad4 to f245695 Compare January 20, 2025 10:24
@Azquelt
Copy link
Member Author

Azquelt commented Jan 21, 2025

SmallRye passes the TCK with smallrye/smallrye-open-api#2163

@Azquelt Azquelt merged commit 06f3db7 into eclipse:main Jan 23, 2025
4 checks passed
@Azquelt Azquelt deleted the add-json-schema-dialect branch January 23, 2025 11:03
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.

OpenAPI model object is missing jsonSchemaDialect property
2 participants