Skip to content

Comments

fix(rest-catalog): omit null optional fields in CreateTableRequest JSON#2136

Open
jonbjo wants to merge 1 commit intoapache:mainfrom
jonbjo:fix/skip-serialize-null-fields
Open

fix(rest-catalog): omit null optional fields in CreateTableRequest JSON#2136
jonbjo wants to merge 1 commit intoapache:mainfrom
jonbjo:fix/skip-serialize-null-fields

Conversation

@jonbjo
Copy link

@jonbjo jonbjo commented Feb 12, 2026

Which issue does this PR close?

What changes are included in this PR?

Adds #[serde(skip_serializing_if = "Option::is_none")] to optional fields in REST catalog request types to prevent serializing explicit null values.

Are these changes tested?

Existing serialization tests continue to pass. This change affects JSON wire format only (omitting null vs. including it), which maintains compatibility with catalogs that accept either format while fixing compatibility with stricter implementations like Apache Polaris.

Copy link
Collaborator

@CTTY CTTY left a comment

Choose a reason for hiding this comment

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

This is a good catch, thanks for the fix! Do you mind adding an unit test to test serde as well?

We don't need to fix them in this PR, but it seems like we also have other Option left null by default during serialization

mattefunnel added a commit to mattefunnel/iceberg-rust that referenced this pull request Feb 20, 2026
Add round-trip serialization tests that verify optional fields are
omitted (not serialized as null) when absent, as requested in apache#2136.

- CreateTableRequest: full and minimal round-trip serde test
- UnboundPartitionSpec: assert serialized output matches expected JSON
@mattefunnel
Copy link

I added some tests here.

That branch is based off of jonbjo:fix/skip-serialize-null-fields, so technically I guess that other PR "Closes the issue" as well. Not sure what is the best way to do a "Fork of a fork".

Any suggestions are welcome!

mattefunnel added a commit to mattefunnel/iceberg-rust that referenced this pull request Feb 20, 2026
Add round-trip serialization tests that verify optional fields are
omitted (not serialized as null) when absent, as requested in apache#2136.

- CreateTableRequest: full and minimal round-trip serde test
- UnboundPartitionSpec: assert serialized output matches expected JSON
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.

REST catalog CreateTableRequest sends explicit null values, causing 400 errors with Polaris

3 participants