Hello,
I recently upgraded code from D2010 to Alexandria. This included the MARS curiosity codebase.
I have noticed that now, with endpoints that return a record as TMediaType.Application_JSON, string record data fields that are empty are completely ommitted from the resultant JSON text.
Is there a way to revert back to the original behavior of returning all record fields, even blank/empty string fields?
Here are the record definition, function declaration and sample results/output from before and after the upgrade:
record definition:
TInventoryCheckResponse = record
itemkey: Integer;
itemid: String;
qtyavailable: Integer;
function ToJSONStr: String;
end;
function declaration:
function InventoryCheck([PathParam] ItemID: String): TInventoryCheckResponse;
[POST, Path('/shipping/methods'), Produces(TMediaType.APPLICATION_JSON)]
result before the upgrade:
{
"itemkey": 0,
"itemid": "",
"qtyavailable": 0
}
Result after the upgrade:
{
"itemkey": 0,
"qtyavailable": 0
}