OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Updated: (ODATA-342) Can we relax the requirement of int64 numbers being represented as strings in the JSON Format for integer numbers that don't lose precision in ECMAScript when represented as numbers?


     [ http://tools.oasis-open.org/issues/browse/ODATA-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hubert Heijkers updated ODATA-342:
----------------------------------

             Proposal: 
Change the default serialization of number (Int64 and Decimal particularly) as numbers in JSON.
Add support for the 'IEEE754Compatible' format parameter to the application/json format and require that the producer MUST serialize Int64 and Decimal numbers as strings if this format parameter has been specified.


  was:Allow Int64 numbers to be represented as numbers in JSON as long as they don't lose precision and only require them to be represented as strings if precision would dictate so.

        Fix Version/s: V4.0_WD01
    Affects Version/s: V4.0_WD01

Updated proposal to use numeric representation by default for all numbers and add a 'IEEE754Compatible' format parameter for the application/json format allowing the client to signal the server that it needs to use string representation for Int64 and Decimal numbers.

Reasoning: The JSON format itself does not limit the size of the numbers represented by JSON. It is the JavaScript language that is restricted to numbers according to the IEEE-754. It is only the JavaScript clients that presumably have this limitation while all consumers written using other languages do not. It is therefore up to these clients to indicate to the server that it should format Int64 and Decimal numbers to be compatible to IEEE754. The server, if so requested, MUST then serialize all Int64 and Decimal numbers as strings. However a JavaScript consumer is allowed to not specify this parameter and receive all numbers as numbers and take the gamble that none of these are larger then the maximum value supported as specified in IEEE-754.

> Can we relax the requirement of int64 numbers being represented as strings in the JSON Format for integer numbers that don't lose precision in ECMAScript when represented as numbers?
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ODATA-342
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-342
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData JSON Format
>    Affects Versions: V4.0_WD01
>         Environment: [Proposed]
>            Reporter: Hubert Heijkers
>            Priority: Minor
>             Fix For: V4.0_WD01
>
>
> The current JSON Format specification requires all Int64 numbers to be represented as strings because of the limitation of numbers in JavaScript were these numbers get stored as 64-bit binary format IEEE values and therefore lose precision past 15 digits. However numbers up to that point could still be represented as numbers.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]