huan233usc opened a new pull request, #785:
URL: https://github.com/apache/iceberg-cpp/pull/785

   ## What
   
   Change the schema/type/metadata `ToJson` serializers from returning bare 
`nlohmann::json` to `Result<nlohmann::json>`:
   
   - `json_serde`: `ToJson(SchemaField | Type | Schema | TableMetadata | 
TableUpdate)`
   - REST: `ToJson(CreateTableRequest | CommitTableRequest | LoadTableResult | 
CommitTableResponse)`
   
   Errors propagate via `ICEBERG_ASSIGN_OR_RAISE`; callers bottom out at the 
existing `Result`-returning boundaries (`ToJsonString`, `rest_catalog`, 
`TableMetadataUtil::Write`).
   
   ## Why
   
   Preparation for v3 column default values (#730 / #746). Single-value 
(`Literal`) serialization is fallible, and column defaults invoke it from 
schema serialization, so these serializers need to propagate the error instead 
of throwing. Splitting it out keeps the feature PR focused on the feature.
   
   ## Notes
   
   - **No behavior change** — every conversion still succeeds today; only the 
return type changes.
   - The shared `ToJsonList` template stays bare (it also serializes infallible 
types such as partition specs and snapshots); `TableMetadata` serializes its 
schema list with an explicit loop.
   - The REST `ICEBERG_DECLARE_JSON_SERDE` macro is unchanged; the four 
schema/metadata-bearing models are declared explicitly so only their `ToJson` 
return type differs.
   
   ## Testing
   
   No behavior change; existing tests are adapted to the new return type. Full 
build and `ctest` pass locally.
   


-- 
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