Task #28729
Add JSON marshaling support for Optional type to handle null values in API responses
Start date:
23/07/2025
Due date:
% Done:
100%
Estimated time:
Description
Implements proper JSON marshaling so Optional
fields serialize correctly i.e. explicit null values -> JSON null, present values -> actual values and absent fields -> omitted with struct tags.
Updated by Sachin Divekar 12 days ago
- % Done changed from 0 to 100
- Status changed from New to In Progress
Currently, Optional
fields in API responses serialize as complex objects exposing internal structure (Value, Present, Null fields). This ticket implements proper JSON marshaling so Optional
fields serialize correctly:
- Explicit null values -> JSON null
- Present values -> actual values
- Absent fields -> zero values (or omitted with Go 1.24+ omitzero tag)