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: Re: [odata] JSON CSDL: Representing property facets


Hi Ralf, et.al.,

It's been bothering me for a bit, and I don't think I can express very well
what exactly it is, but I more and more am getting the feeling, especially
when I see things like you are proposing, that we are creating something
pretty ugly just because we are trying to adhere to something that is not
likely the best natural fit for what we are trying to convey, which, after
all, is the schema of our service.

Now don't get me wrong, I do see value in having a JSON schema, but for
those cases were we'd want to validate our payloads, for which we need less
then what we are trying to put in currently. As you say, there are clients
that are not interested in validating payloads, and I wonder, aren't we
making it to hard on them because we are trying to make the JSON CSDL a
JSON Schema too?

So here is a crazy idea, why wouldn't we have a nice clean JSON CSDL and,
separately, allow services to provide a JSON Schema as well put purely for
validation, meaning that it wouldn't have to convey any of the OData
specifics?

Any thoughts anybody? Tell me if you think I'm nuts too, wouldn't be the
first time, I can take it;-).

Happy holidays,

-H
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                     Hubert Heijkers                                                    
                     STSM, Chief Architect TM1 Server                                   
                     Business Analytics                                                 
                                                                                        
                     Phone: +31-20-513-9456                                             
                     Mobile: +31-621-394123                                             
                     E-mail: hubert.heijkers@nl.ibm.com                                 
                                                                                        
                                                                                        
                                                                        (Embedded image 
                                                                        moved to file:  
                                                                        pic10387.gif)   
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                     (Embedded image moved to file: pic53554.gif)Facebook Button        
                        (Embedded image moved to file: pic10481.gif)LinkedIn Button     
                            OData Button                                                
                               OASIS Button                                             
                                                                                        
                                                                                        
                                                                                        
    (Embedded image moved to file: pic46286.jpg)                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                               (Embedded image moved to 
                                                               file: pic56306.jpg)      
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        
                                                                                        





From:	"Handl, Ralf" <ralf.handl@sap.com>
To:	"odata@lists.oasis-open.org" <odata@lists.oasis-open.org>
Date:	11/28/2014 11:29 AM
Subject:	[odata] JSON CSDL: Representing property facets
Sent by:	<odata@lists.oasis-open.org>



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


Attachment: pic10387.gif
Description: GIF image

Attachment: pic53554.gif
Description: GIF image

Attachment: pic10481.gif
Description: GIF image

Attachment: pic46286.jpg
Description: JPEG image

Attachment: pic56306.jpg
Description: JPEG image



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