Skip to content

Conversation

@rayokota
Copy link
Member

What

Fix transformation of union of JSON refs

Checklist

  • [Y] 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

@rayokota rayokota requested a review from a team as a code owner September 30, 2025 19:04
Copilot AI review requested due to automatic review settings September 30, 2025 19:04
@rayokota rayokota requested a review from a team as a code owner September 30, 2025 19:04
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 union of JSON refs by adding null checks in the field transformation logic and improving type detection for schemas without explicit type definitions.

  • Adds null check before transforming field values to prevent errors on null/undefined values
  • Updates getType function to properly identify record types when schema has no explicit type but contains properties
  • Includes comprehensive test case demonstrating CEL field transformation with union of JSON refs

Reviewed Changes

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

File Description
schemaregistry/serde/json.ts Adds null check in transformField and improves type detection in getType
schemaregistry/test/serde/json.spec.ts Adds test case for CEL field transformation with union of JSON refs

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

@sonarqube-confluent
Copy link

Passed

Analysis Details

0 Issues

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

Coverage and Duplications

  • Coverage 100.00% Coverage (70.90% Estimated after merge)
  • Duplications No duplication information (2.00% Estimated after merge)

Project ID: confluent-kafka-javascript

View in SonarQube

@rayokota rayokota merged commit 3ae9609 into master Sep 30, 2025
3 checks passed
@rayokota rayokota deleted the fix-union-refs branch September 30, 2025 22:34
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