Skip to content

Fix JSON schema resolver bug#2188

Merged
Robert Yokota (rayokota) merged 7 commits intomasterfrom
inc-8778-2
Feb 11, 2026
Merged

Fix JSON schema resolver bug#2188
Robert Yokota (rayokota) merged 7 commits intomasterfrom
inc-8778-2

Conversation

@rayokota
Copy link
Copy Markdown
Member

What

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

Copilot AI review requested due to automatic review settings February 11, 2026 21:14
@confluent-cla-assistant
Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes JSON Schema union (oneOf/anyOf/allOf) validation when a union branch is a $ref whose resolved schema contains further nested $refs, by preserving resolver context during validation.

Changes:

  • Update _validate_subschemas to validate resolved $ref subschemas using a resolver that retains the correct reference context.
  • Add sync + async regression tests covering nested $ref resolution through oneOf/anyOf/allOf, including deeper nesting.
  • Require jsonschema >= 4.18.0 for JSON and example dependency sets.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/confluent_kafka/schema_registry/common/json_schema.py Adjusts subschema validation to pass resolver context when validating resolved $ref branches.
tests/schema_registry/_sync/test_json_serdes.py Adds regression tests for nested $ref resolution in union constructs (sync path).
tests/schema_registry/_async/test_json_serdes.py Adds regression tests for nested $ref resolution in union constructs (async path).
requirements/requirements-json.txt Bumps minimum jsonschema version to support the fix.
requirements/requirements-examples.txt Aligns examples dependency set with the new jsonschema minimum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/confluent_kafka/schema_registry/common/json_schema.py
@fangnx
Copy link
Copy Markdown
Member

I will close the PR (#2187) but can we add the PR description here to provide some context

@sonarqube-confluent
Copy link
Copy Markdown

@rayokota Robert Yokota (rayokota) merged commit 35d5608 into master Feb 11, 2026
8 of 9 checks passed
@rayokota Robert Yokota (rayokota) deleted the inc-8778-2 branch February 11, 2026 22:22
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.

3 participants