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: JSON CSDL: Representing property facets


I’ve received feedback that the current translation of primitive type facets into JSON Schema makes the JSON CSDL hard to understand for clients that are not interested in validating payloads but just want to get the OData metadata.
 
For example a simple
 
<Property Type="Edm.Decimal" Name="Price" Precision="15" Scale="3" />
 
Becomes (as Nullable="true" is the default):
 
"anyOf":[{"type":"number", "multipleOf":0.001, "minimum":-999999999999.999, "maximum":999999999999.999}, {"type":"null"}]
 
 
One way to make this more digestible would be to redundantly add the OData facets to the JSON Schema representation:
 
"anyOf":[{"type":"number", "multipleOf":0.001, "minimum":-999999999999.999, "maximum":999999999999.999}, {"type":"null"}], "precision":15, "scale":3
 
And redundantly add "nullable":false so clients don’t have to check for the anyOf" or "type":["number","null"] constructs.
 
What do you think?
 
Thanks in advance!
--Ralf
 
        In preparing for battle
        I have always found that plans are useless,
        but planning is indispensable.
       
- Dwight D. Eisenhower
 
 
 


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