bcherny/json-schema-to-typescript

Support `prefixItems` for tuple validation

Open

#543 建立於 2023年7月26日

在 GitHub 查看
 (5 留言) (4 反應) (0 負責人)TypeScript (449 fork)github user discovery
enhancementgood first issuehelp wanted

倉庫指標

Star
 (3,302 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南