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

Tuple validation changes in JSON Schema specification #85

Open
cyberixae opened this issue Aug 17, 2023 · 0 comments
Open

Tuple validation changes in JSON Schema specification #85

cyberixae opened this issue Aug 17, 2023 · 0 comments

Comments

@cyberixae
Copy link
Contributor

cyberixae commented Aug 17, 2023

The way tuples are defined have been going through some changes https://json-schema.org/understanding-json-schema/reference/array.html#tuple-validation

Previously the tuple [string, number] would be defined as

{
  "type": "array",
  "items": [
    { "type": "string"},
    { "type": "number"}
  ]
}

With some of the newer drafts the same tuple [string, number] would be defined as

{
  "type": "array",
  "prefixItems": [
    { "type": "string"},
    { "type": "number"}
  ]
}

The io-ts-from-json-schema converter currently only supports the old tuple schema definition.

There are also some other changes related to how other keywords are interpreted in relation to the tuple definition.

@cyberixae cyberixae changed the title Tuple validation changes in JSON Schema specificationq Tuple validation changes in JSON Schema specification Aug 17, 2023
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

No branches or pull requests

1 participant