D JSON (WAT?!)

Pavel via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 24 14:25:18 PDT 2014


On Thursday, 24 July 2014 at 18:49:27 UTC, Ary Borenszweig wrote:
> On 7/24/14, 1:58 PM, Justin Whear wrote:
>> On Thu, 24 Jul 2014 13:49:27 -0300, Ary Borenszweig wrote:
>>
>>> Nope, a JSON can only be an array or an object (hash).
>>
>> Ary, can you point out the place in the spec where this is 
>> specified?
>> Not to be pedantic, but the spec only seems to define a "JSON 
>> value", not
>> a "JSON document".
>>
>
> You are right, my bad. According to Wikipedia (which has links 
> to RFCs):
>
> Early versions of JSON (such as specified by RFC 4627) required 
> that a valid JSON "document" must consist of only an object or 
> an array type—though they could contain other types within 
> them. This restriction was relaxed starting with RFC 7158, so 
> that a JSON document may consist entirely of any possible JSON 
> typed value.

Sorry, Justin Whear, you were right, I was wrong. Yep, now it's 
pretty clear why there is JSONValue.


More information about the Digitalmars-d-learn mailing list