Skip to content

Conversation

@rayokota
Copy link
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 August 22, 2025 00:55
@rayokota rayokota requested review from a team as code owners August 22, 2025 00:55
Copy link

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 the transformation of nullable JSON properties by adding support for schemas with multiple types (e.g., ["string", "null"]). The fix ensures that when a field has multiple types, the correct subtype is selected based on validation before transformation is applied.

  • Adds handling for multi-type schemas in the transform function
  • Implements validateSubtypes function to select the appropriate type from multiple options
  • Adds comprehensive test coverage for nullable field transformations with CEL field transforms

Reviewed Changes

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

File Description
schemaregistry/serde/jsonschema/json_schema_util.go Adds multi-type schema handling and validateSubtypes function
schemaregistry/serde/jsonschema/json_schema_test.go Adds test schema and test case for nullable field transformations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqube-confluent
Copy link

Failed

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

Analysis Details

1 Issue

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 1 Code Smell

Coverage and Duplications

  • Coverage 78.90% Coverage (55.70% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: confluent-kafka-go

View in SonarQube

Copy link
Contributor

@Claimundefine Claimundefine left a comment

Choose a reason for hiding this comment

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

LGTM

@rayokota rayokota merged commit 2d291dc into master Aug 22, 2025
2 of 3 checks passed
@rayokota rayokota deleted the fix-nullable-json-props branch August 22, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants