Skip to content

fix: preserve null values in json-avro conversion#1704

Open
menezestrigueiros wants to merge 1 commit intokafbat:mainfrom
menezestrigueiros:andre/json-avro-null-visibility
Open

fix: preserve null values in json-avro conversion#1704
menezestrigueiros wants to merge 1 commit intokafbat:mainfrom
menezestrigueiros:andre/json-avro-null-visibility

Conversation

@menezestrigueiros
Copy link
Copy Markdown

@menezestrigueiros menezestrigueiros commented Feb 26, 2026

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)

  • Updated JSON conversion for Avro record fields in JsonAvroConversion.java:207-216.
  • Before: null-valued fields were conditionally skipped depending on showNullValues.
  • Now: all record fields are always emitted; when a field value is null, it is explicitly written as JSON null (MAPPER.nullNode()).
  • Preserves schema-defined fields in output and avoids dropping null properties during Avro → JSON conversion.

Is there anything you'd like reviewers to focus on?

  • Confirm the intended behavior is to always preserve field presence for Avro record outputs, even when values are null.
  • Validate this aligns with existing Kafka UI expectations for message rendering and Schema Registry-backed payloads.
  • Check for any downstream consumers/tests that relied on null fields being omitted.
  • Sanity-check that non-null conversion behavior is unchanged.

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)
This is my cat, Mel :)

WhatsApp Image 2026-02-26 at 11 30 43

@menezestrigueiros menezestrigueiros requested a review from a team as a code owner February 26, 2026 11:31
@kapybro kapybro Bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Feb 26, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Hi menezestrigueiros! 👋

Welcome, and thank you for opening your first PR in the repo!

Please wait for triaging by our maintainers.

Please take a look at our contributing guide.

@menezestrigueiros menezestrigueiros force-pushed the andre/json-avro-null-visibility branch from 54b28ec to fc2e561 Compare February 26, 2026 11:51
@joshuaNathaniel
Copy link
Copy Markdown
Contributor

@menezestrigueiros You may want to revisit #1639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/triage/completed Automatic triage completed status/triage/manual Manual triage in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants