pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Martini <sandro.mart...@gmail.com>
Subject Re: Preferences class
Date Wed, 08 Apr 2009 07:48:11 GMT
Hi Christopher,
first thanks for your feedback/help ...

> My understanding of JSON (based on this site: http://json.org/ ) is that the
> key can be any quoted string with the following rules:
me too.

> I seem to remember, last time I looked at the code, that Pivot's JSON parser
> allows for unquoted strings and strings quoted using other characters.  I
> think we should be sticking to the 'specification' as defined on
> http://www.json.org/
> This means that the existing JSON based preferences files are incorrect.
>  They currently look like this:
> {
>    key1 : "Value1",
>    key2 : "Value2"
> }
> Really they should look like this:
> {
>    "key1" : "Value1",
>    "key2" : "Value2"
> }
I agree with you, but so anytime a string key is not valid until it's
wrapped inside string delimiters (""), wouldn't it be better to wrap
inside "" ?
And this should be done in the JSONSerializer ...

Today I'll try to put keys delimited in my test code, maybe this works now.

Oh, one last thing:
what do you think on an utility method inside the Sewrializer that
tells if the given key is right, and also if the given object, so the
caller could think at what to do without throwing Exceptions by the
Serializer and recovering ?


View raw message