OData / odataorg.github.io

Staging site and collaboration repository for http://www.odata.org
MIT License
63 stars 101 forks source link

Documentation on JSON primitive types for OData v2 incorrect #204

Open marikaner opened 4 years ago

marikaner commented 4 years ago

Either the documentation on primitive types or the implementation of the Northwind services is incorrect.

https://www.odata.org/documentation/odata-version-2-0/json-format/ states that for Edm.Single values are represented as the "Literal form of Edm.Single as used in URIs formatted as a JSON string". This means, that a value 1.5 would be represented as "1.5f". This differs from the documentation for the atom format. The Northwind services do not follow this rule either, e. g. Discount is a Edm.Single property: https://services.odata.org/V2/Northwind/Northwind.svc/Invoices?$format=json&$select=Discount&$filter=Discount%20ne%200

What is the truth?

jkougoulos commented 4 years ago

I believe the same issue applies for Edm.DateTimeOffset, where the correct would be to specify this as "/Date(["+" | "-"] )/" and not "Literal form of Edm.DateTimeOffset as used in URIs formatted as a JSON string"