Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

This may be slightly off-topic, but is there an example of a schema instance that shows all features of the 2020-12 draft, including applicators and optionals such as formats? Ideally, this would include examples of all possible permutations of validation (e.g., for strings: no validation, only minLength, only maxLength, both, etc.).

I think such an example would help schema implementers concretize from the available documentation.

Thanks!

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

you can checkout the test suite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/tree/main/tests/draft2020-12

most schema implementors use this test suite to test their implementation, including this library.

there is also dedicated site which shows how different implementations pass this test suite: https://bowtie.report

You must be logged in to vote
1 reply
@sdruskat
Comment options

Thanks for the quick reply!

My concrete use case is that I want to create a maximally complete schema file for end-to-end testing a tool that creates documentation from schema files. Therefore, I was looking for a complete instance example to make sure I cover all cases.

Unless someone has a good idea for how to compile a valid schema instance from the test suite examples, I think I'll cobble one together manually.

That said, the test suite is really helpful for unit testing (which the e2e test is meant to complement).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.