cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to create entries with decimal attributes

AshishAnand
Employee
Employee
0 Kudos

for the below payload Im getting the following error:

{
“ProductID”: “AD-1000”,
“TypeCode”: “AD”,
“Category”: “Computer system accessories”,
“Availability_Status”: “Out of stock”,
“Name”: “Portable DVD player”,
“NameLanguage”: “EN”,
“Description”: “Flyer for our product palette”,
“DescriptionLanguage”: “EN”,
“SupplierID”: “0100000000”,
“SupplierName”: “SAP”,
“TaxTarifCode”: “1”,
“MeasureUnit”: “EA”,
“CurrencyCode”: “EUR”,
“WeightMeasure”: “4.9M”
}

{
“error”: {
“code”: null,
“message”: “Error while deserializing payload. An error occurred during deserialization of the entity. A JSON number is not supported as Edm.Decimal value.”
}
}

WeightMeasure is of type WeightMeasure : Decimal(13, 3);

Could you please help me here?

Thanks in advance

Ashish

Accepted Solutions (0)

Answers (1)

Answers (1)

oliver_heinrich
Explorer

Hi Ashish,

Property Values of type Odata EDM.Decimal and EDM.Int64 must be of type JSON Strings and not Number. Reason is that the value range of EDM.Decimal and JSON Number is larger than JavaScript Number. This avoids data loss during the parsing step.

Regards Oliver

former_member663054
Discoverer
0 Kudos

Do you have an example of how could I specify it's a JSON String? My payload currently is:

{
    "secuence": 1,
    "flagDel": false,
    "datePro": "2020-02-26",
    "datePay": "2020-02-26",
    "payAmt": "2.00",
[...]
}

And the response is:

{
    "error": {
        "code": null,
        "message": "Error while deserializing payload. An error occurred during deserialization of the entity. A JSON number is not supported as Edm.Decimal value."
    }
}


Thanks

klaus_kopecz
Participant
0 Kudos