bcherny/json-schema-to-typescript

Support `prefixItems` for tuple validation

isti115 opened this issue · 2 comments

From the JSON Schema 2020-12 Release Notes:

The items and additionalItems keywords have been replaced with prefixItems and items where prefixItems has the same functionality as the array-of-schemas for of the old items and the new items keyword has the same functionality as the old additionalItems keyword.

For an example with more explanation:
https://json-schema.org/understanding-json-schema/reference/array.html#tuple-validation

As per #1 (which has a broken link by the way), here is the respective file from the official test suite:
https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/prefixItems.json

In case there is interest in resolving this issue, I would be willing to look into the code (I've already checked the relevant parts of parsing and generation) and try to provide a pull request for it.