danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with Context.Request.BodyAs and Nullable Floats

ads69 opened this issue · comments

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

commented

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

Good. You are welcome