danieleteti/delphimvcframework

Problem with Context.Request.BodyAs and Nullable Floats

ads69 opened this issue · 2 comments

ads69 commented

Hi,
I face a strange problem
In my controller when I do lCustomerList := Context.Request.BodyAs<TCustomerList_PutPostReQuest>;

I get this reply
{ "classname": "EMVCDeserializationException", "items": [], "statuscode": 500, "reasonstring": "error", "message": "Cannot deserialize integer value for ", "data": null }
After investigating, I see that in some fields they are declared as NullableDouble
If my Body have these field as null no problem
if these field values are "real" floats, I mean something like 102.56, no problem
if the value is 102.00 no problem, but if the value is 100 then I get this kind of error message.

Any idea ?

Best regards

ads69 commented

Thanks Daniele, it works fine now.
have a nice day.

Good. You are welcome