REST type Long Integer sent as string

REST type Long Integer sent as string

  

hi there, 

i have a json where one of its entity attribute -"display-name"- is of type long integer, but when it is sent from consume REST as a request, the value is treated as string, how to make it sent as is - of type long integer?

sent:

{"name":"Tuna Dot Com","first-name":"First Thing First","display-name":"1"}

wanted:

{"name":"Tuna Dot Com","first-name":"First Thing First","display-name":1}

thank you in advance and best regards

Hi Boring,

Can you show the Structure that is used for the Output Parameter of the REST?

Solution

Boring wrote:

hi there, 

i have a json where one of its entity attribute -"display-name"- is of type long integer, but when it is sent from consume REST as a request, the value is treated as string, how to make it sent as is - of type long integer?

sent:

{"name":"Tuna Dot Com","first-name":"First Thing First","display-name":"1"}

wanted:

{"name":"Tuna Dot Com","first-name":"First Thing First","display-name":1}

thank you in advance and best regards

You cannot without changing the data type.

The reason for that is that the JSON Data Interoperability Format spec recommends that for interoperability numbers should not exceed the limits specified by IEEE754, limiting the them at 53 bits instead of the usual 64.


Depending on your number limits you need to choose to leave it as Long Integer (and get it serialized as string) or change it to Integer or Decimal.


Regards,

João Rosado

Solution

Thanks João, didn't know that.