Closed ghost closed 10 years ago
Yes, this example is not valid since object keys should be strings.
Looks like this is the only invalid example on site - quick scan for all objects, arrays and strings hadn't reveal anything else.
[h][27][131.098412283059e2371293452]
^^^ Also is very weird structure. Looks like stripped or something.
Its not valid. From json.org
"pair string : value"
Addition
However, next one looks valid, but not well optimized:
[a][255] [S][3][bob] [I][1024] [T] [F] [S][4][ham!] [E]
S
requires 4-byte length while s
only 1 byte that fits better there.
Fixed; all these old sections were removed in favor of the updated/rewritten docs under the Type Reference section.
The main spec page just covers high level concerns/motivations/etc. now.
Marco Costa wrote in to point out that some of the examples I put in the UBJSON spec doc are not valid JSON. These examples all have to be valid JSON as 1:1 compatibility is the big selling point of UBJSON, there is no reason to have incompatible examples.
Original Message: On the specification, you have and example of an streaming object:
[o][255] [B][4] [D][21.786] [N] [Z] [h][27][131.098412283059e2371293452] [E]
But from the specification of an object, the first item of the pair HAS to be a string. My question is, is this example valid at all?