Skip to content

Add JSON Schema validation test; fix typo #2003

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

Merged
merged 3 commits into from
Jul 1, 2025
Merged

Conversation

rayokota
Copy link
Member

@rayokota rayokota commented Jul 1, 2025

What

Add JSON Schema validation test; fix typo

Checklist

  • [N] Contains customer facing changes? Including API/behavior changes
  • [Y] 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 Copilot AI review requested due to automatic review settings July 1, 2025 17:22
@rayokota rayokota requested review from a team as code owners July 1, 2025 17:22
@confluent-cla-assistant
Copy link

🎉 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

@Copilot 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 adds schema payload validation to JSON serialization tests and fixes a typo in the validate flag check within the JSONSerializer initializer.

  • Enabled explicit validate: True in serializer configs for both sync and async tests
  • Added test_json_basic_failing_validation in sync and async to confirm invalid payloads raise SerializationError
  • Corrected the boolean check to validate self._validate instead of self._normalize_schemas in both sync and async JSONSerializer implementations

Reviewed Changes

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

File Description
tests/schema_registry/_sync/test_json_serdes.py Added validate flag and new failing validation test
tests/schema_registry/_async/test_json_serdes.py Added validate flag, new failing validation test, and minor client instantiation change needed
src/confluent_kafka/schema_registry/_sync/json_schema.py Fixed typo: now checks self._validate is boolean
src/confluent_kafka/schema_registry/_async/json_schema.py Fixed typo: now checks self._validate is boolean

Copy link
Member

@kcorman0 kcorman0 left a comment

Choose a reason for hiding this comment

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

thanks

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent
Copy link

Failed

  • 66.70% Coverage on New Code (is less than 80.00%)

Analysis Details

6 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 6 Code Smells

Coverage and Duplications

  • Coverage 66.70% Coverage (66.00% Estimated after merge)
  • Duplications No duplication information (5.20% Estimated after merge)

Project ID: confluent-kafka-python

View in SonarQube

@rayokota rayokota merged commit 46f4fab into master Jul 1, 2025
2 of 3 checks passed
@rayokota rayokota deleted the add-validation-test branch July 1, 2025 18:13
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.

2 participants