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

Adds support for prefixItems on Array #1103

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Oct 7, 2024

This PR adds support for prefixItems as defined in JSON schema specification https://json-schema.org/understanding-json-schema/reference/array#tupleValidation. The prefixItems are used to correctly represent Rust tuples as tuple values in OpenAPI. This will remove the old allOf behavior known from OpenAPI 3.0 which fails to correctly represent a tuple. Prefix items are conforming OpenAPI 3.1 and is coming from JSON Schema.

Add new type ArrayItems what represent [Array::items] supported values.

Breaking

This commit removes allOf tuple behavior, replacing with with all new
prefixItems while setting items to false.

Closes #901

@juhaku juhaku force-pushed the feature-prefix-items-array branch 3 times, most recently from cbcb030 to fbf5e62 Compare October 7, 2024 18:35
This PR adds support for `prefixItems` as defined in JSON schema
specification https://json-schema.org/understanding-json-schema/reference/array#tupleValidation.
The `prefixItems` are used to correctly represent tuple values Rust
tuples. This will remove the old `allOf` behavior known from OpenAPI 3.0
which fails to correctly represent a tuple. Prefix items are conforming
OpenAPI 3.1 and is coming from JSON Schema.

Add new type `ArrayItems` what represent [`Array::items`] supported
values.

 ### Breaking

 This commit removes `allOf` tuple behavior, replacing with with all new
 `prefixItems` while setting `items` to false.

Closes #901
@juhaku juhaku force-pushed the feature-prefix-items-array branch from fbf5e62 to 81ebb07 Compare October 7, 2024 18:50
@juhaku juhaku merged commit 8bbc5d9 into master Oct 7, 2024
22 checks passed
@juhaku juhaku deleted the feature-prefix-items-array branch October 7, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

ToSchema derives array with items with allOf combination of the types of all the tuple elements
1 participant