You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
OpenAPI 3.1 inherits data types from JSON Schema 2020-12, where we can use prefixItems keyword to define tuple value, instead of items keyword.
After changes from #2638 we got an error, when schema contains prefixItems:
Schemas with "type: array", require a sibling "items" field
I just encountered this on a FastAPI project, which generates OpenAPI 3.1 schemas by default and uses prefixItems for any value defined as a tuple. That means that the kind of code a Python developer would normally write like this:
Describe the bug
OpenAPI 3.1 inherits data types from JSON Schema 2020-12, where we can use
prefixItems
keyword to define tuple value, instead ofitems
keyword.After changes from #2638 we got an error, when schema contains
prefixItems
:To Reproduce
test.yaml
:Run validation:
Expected behavior
Field
items
should not be required whenprefixItems
field is defined.Environment (remove any that are not applicable):
Additional context
This issue related to #2638.
The text was updated successfully, but these errors were encountered: