If you raise an issue against this, we'll get onto it. I like the idea of fixing it at source rather than having many workarounds in all the client libraries.
Jim
I'm not sure about this, but I'm going to comment on the structure of
the JSON package from a developer's perspective.
To me, it would always be better, if the JSON packages were "fully formed".
{ "propertyName" : "propertyValue" }
is inherently better to deal with than:
"propertyValue"
Two reasons that come quickly to my mind:
1. I can parse the response of this query with the same code that parses
responses for multiple properties, e.g. { "foo" : "bar", "yo" : "momma" }
2. Parsing the response isn't coupled to the request. In the latter version
the parsing code needs to know that I requested a particular property value.
-TPP
Sounds to me that a change away from scalars would satisfy everyone and be least friction.next issue is good versioning of the rest API.
Cheers
/peter
Sent from a device with crappy keyboard and autocorrect
I just talked with one of the development leads for jQuery UI (not an
authoritative source, I know) and he says that scalar values are valid
JSON.
I also checked out ECMA-262, which defines how JSON is parsed in
Javascript, and it explicitly lists differences between Javascript's
JSON.parse/.stringify and RFC 4627.
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
at the bottom of page 201.
tl;dr: The RFC says the top level must be an object or array. ECMA
says it can be any valid JSON value (object, array or scalar).
So it seems that it depends on if you think ECMA or the RFC is the
standard, which probably accounts for why different libraries and
languages implement it differently.
My final thought on this is a memory of something a Javascript
developer told me about implementation differences between Javascript
parsers: "When in doubt, do what Crockford says."
Happy New Year, all!
Sounds to me that a change away from scalars would satisfy everyone and be least friction.next issue is good versioning of the rest API.
-Alistair
-Alistair
--
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
Cheers,
/peter neubauer
Google: neubauer.peter
Skype: peter.neubauer
Phone: +46 704 106975
LinkedIn: http://www.linkedin.com/in/neubauer
Twitter: @peterneubauer
Tungle: tungle.me/peterneubauer
brew install neo4j && neo4j start
heroku addons:add neo4j
On Thu, Jan 5, 2012 at 2:05 PM, Jacob Hansson
Does anybody disagree, or can I close the issue?