JSON rendering issue

Hi, I've spent some hours implementing the rendering of resources attributes as defined in JSON spec and, finally, I think it can _not_ be done that way because its ambiguous. Let me give an example: let the following json document: { "attributes": { "com": { "example": { "default": { "type": "string" } } } } } Parsing this document, one can not say if this defines: - an attribute "com.example" with default value '{ "type": "string" }' - an attribute "com.example.default" with type "string" Given the interest of the community in JSON rendering and their implementations, I think we should quickly solve this issue and agree on a right syntax. Cheers, -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@gmail.com skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en

Hi Jean, I don't think this is ambiguous in any way. The definition of string in JSON is: A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. [http://www.json.org/] Hence: { "default": { "type": "string" } } is "default.type" with value 'string' and { "default": "{ \"type\": \"string\" }" } is "default" with value '{ "type": "string" }' Or am I missing something? Cheers, Boris On Sat, Jan 18, 2014 at 2:40 PM, Jean Parpaillon <jean.parpaillon@free.fr> wrote:
Hi, I've spent some hours implementing the rendering of resources attributes as defined in JSON spec and, finally, I think it can _not_ be done that way because its ambiguous. Let me give an example: let the following json document: { "attributes": { "com": { "example": { "default": { "type": "string" } } } } }
Parsing this document, one can not say if this defines: - an attribute "com.example" with default value '{ "type": "string" }' - an attribute "com.example.default" with type "string"
Given the interest of the community in JSON rendering and their implementations, I think we should quickly solve this issue and agree on a right syntax.
Cheers, -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@gmail.com skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en
_______________________________________________ occi-wg mailing list occi-wg@ogf.org https://www.ogf.org/mailman/listinfo/occi-wg

Hi Boris, In absolute, it prevents representing an attribute value as an object. It is not the case as of today but I think we need to be sure it is the case. For me, the most important is to agree on this JSON rendering quickly as the number of implementations is increasing based on a draft ;) Regards, Jean Le samedi 18 janvier 2014 à 17:10 +0100, Boris Parak a écrit :
Hi Jean,
I don't think this is ambiguous in any way. The definition of string in JSON is:
A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. [http://www.json.org/]
Hence:
{ "default": { "type": "string" } }
is "default.type" with value 'string'
and
{ "default": "{ \"type\": \"string\" }" }
is "default" with value '{ "type": "string" }'
Or am I missing something?
Cheers, Boris
On Sat, Jan 18, 2014 at 2:40 PM, Jean Parpaillon <jean.parpaillon@free.fr> wrote:
Hi, I've spent some hours implementing the rendering of resources attributes as defined in JSON spec and, finally, I think it can _not_ be done that way because its ambiguous. Let me give an example: let the following json document: { "attributes": { "com": { "example": { "default": { "type": "string" } } } } }
Parsing this document, one can not say if this defines: - an attribute "com.example" with default value '{ "type": "string" }' - an attribute "com.example.default" with type "string"
Given the interest of the community in JSON rendering and their implementations, I think we should quickly solve this issue and agree on a right syntax.
Cheers, -- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@gmail.com skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en
_______________________________________________ occi-wg mailing list occi-wg@ogf.org https://www.ogf.org/mailman/listinfo/occi-wg
-- Jean Parpaillon Open Source Consultant Phone: +33 6 30 10 92 86 im: jean.parpaillon@gmail.com skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en
participants (2)
-
Boris Parak
-
Jean Parpaillon