jonbjo opened a new issue, #2135:
URL: https://github.com/apache/iceberg-rust/issues/2135

   ### Apache Iceberg Rust version
   
   0.6.0 (latest version)
   
   ### Describe the bug
   
   When creating a table via RestCatalog, the CreateTableRequest is serialized 
with explicit null values for optional fields like location, partition_spec, 
write_order, and stage_create. Some REST catalog implementations, such as 
Apache Polaris, reject these requests with HTTP 400 Bad Request.
   
   Current serialized JSON:
   `{
     "name": "my_table",
     "location": null,
     "schema": { ... },
     "partition_spec": null,
     "write_order": null,
     "stage_create": null,
     "properties": {}
   }`
   
   Expected (per JSON convention for optional fields):
   `{
     "name": "my_table",
     "schema": { ... },
     "properties": {}
   }`
   
   ### To Reproduce
   
   1. Set up Apache Polaris as a REST catalog
   2. Create a RestCatalog client pointing to Polaris
   3. Attempt to create an unpartitioned table without specifying location, 
partition_spec, or write_order
   4. Observe HTTP 400 Bad Request response
   
   Expected behavior
   Table creation should succeed. Optional fields with None values should be 
omitted from the JSON request body rather than serialized as null.
   
   Additional context
   The fix is to add #[serde(skip_serializing_if = "Option::is_none")] to the 
affected fields in CreateTableRequest and related types (UnboundPartitionSpec, 
UnboundPartitionField).
   
   ### Expected behavior
   
   _No response_
   
   ### Willingness to contribute
   
   None


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to