Skip to content

Conversation

@dmarcotte
Copy link
Contributor

Expand our integrated JSON-Schema-Test-Suite suite to include the Draft 2020-12 tests.

Note that this also adds a number of Schema Test Suite exclusions for the Draft 2020-12 tests that our current Draft7-centric implementation does not properly handle. Follow-up work must be done to address those excluded tests and get us up to full Draft 2020-12 compatibility, but this should position us well to get that work done. Consulting how we implemented Draft7 in #122 and #186 will probably be valuable when tackling this work.

NOTE: We'd also like to support 2019-09. That will involve pulling in the 2019-09 JSON-Schema-Test-Suite tests in a pull request similar to this one, then evolving our JSON Schema support to handle this draft correctly. Should we do that before 2020-12 so we're progressively adding schema features in the same order as the schema drafts evolved? Or can we jump straight to 2020-12 since it's the latest and between that and Draft7, we have excellent coverage of the schemas out in the wild?

Refactor JsonTestSuiteGenerator to generate the 2020-12 JSON Schema
Suite tests from [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite)
along side our Draft7 tests.  Naturally a number of these are failing
right now, but this prepares us to implements 2020-12 support.
Flow our messages through assertValidSchema in particular so our
schemaTestId data makes it into the output on failure
Make the natural mapping of source [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite)
files into kotlin test files to break these huge test files up into
more manageable sized test classes.
SchemaTestSuiteExclusionsList now captures the [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite)
tests that are not currently passing with our current JSON Schema
implementation. The current implementation is Draft7-centric and must
be updated to properly handle these cases when appropriate.
We recently changed our JSON test suite generated to generated multiple
files per suite, rather than a pair of pre-determined files, so we
now use @OutputDirectory rather than @OutputFiles to tell Gradle what's
going on.
At some point, we figured out how to effectively test the
JsonTestSuiteGenerator and removed the "testPlaceholder".  Update
this doc to reflect that
@dmarcotte dmarcotte marked this pull request as ready for review September 15, 2025 11:53
@dmarcotte dmarcotte merged commit 1977c61 into kson-org:main Sep 15, 2025
1 check passed
@dmarcotte dmarcotte deleted the schema-2020 branch September 15, 2025 11:54
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

Successfully merging this pull request may close these issues.

1 participant