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

[v24.2.x] sr/json: support drafts 201909 and 202012 with jsoncons #22316

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #21473

pgellert added 5 commits July 25, 2024 09:20
This is needed because the next commit introduces jsoncons for
validating json schemas against their draft's metaschema and jsoncons
does not have support for draft 5.

Other schema registries do not support draft 5 either, so it is unlikely
that we would have customers that need to use draft 5 explicitly (and
can't just use the largely equivalent draft 4).

(cherry picked from commit 3cd6c59)
* Add an error test case for a schema that is invalid for the specific
  draft's metaschema only.
* Add an assertion that invalid schemas do raise an error.

(cherry picked from commit 8ad6b26)
To be used in the next commit.

(cherry picked from commit ada73ff)
rapidjson does not support validating schemas above draft 5, so
previously we have been rewriting newer schemas in draft 4's metaschema
in order to validate them. This is error prone and gets increasingly
complicated for later drafts.

Instead, this commit pulls in the jsoncons library which has support for
validing schemas in drafts 4, 6, 7, 2019-09, 2020-12, which covers our
expected use cases.

(cherry picked from commit adbe29d)
This adds support for validating schemas of the 2019-09 and 2020-12
drafts. The assertion keywords introduced in these drafts are not yet
validated for compatibility across successive schema versions. The
implementation of these keywords is going to be implemented later.

https://json-schema.org/draft/2019-09/release-notes
https://json-schema.org/draft/2020-12/release-notes
(cherry picked from commit ff9305b)
@vbotbuildovich vbotbuildovich requested review from BenPope and a team as code owners July 25, 2024 09:20
@vbotbuildovich vbotbuildovich added this to the v24.2.x-next milestone Jul 25, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 25, 2024
@vbotbuildovich vbotbuildovich requested review from rpdevmp and pgellert and removed request for a team July 25, 2024 09:20
@pgellert
Copy link
Contributor

/dt

@michael-redpanda michael-redpanda merged commit 735bcf0 into redpanda-data:v24.2.x Jul 25, 2024
15 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants