Re:Son – A minimal subset of JSON for machine-to-machine com...
by pacaro on Tuesday March 14, 2017 @02:51PM
(#13870332)
ASN.1 uses the name DER Distinguished Encoding Rules for this purpose.
There are some other edgecases that you aren't considering (or that I missed)
Min and Max integer values - JavaScript has some pretty tight limits here
Keys should be in lexicographic order — you might want to be more specific. Is there a permitted subset of Unicode? Which normalization rule must be used?
Re:Son – A minimal subset of JSON for machine-to-machine com...
by seagreen on Tuesday March 14, 2017 @06:53PM
(#13872249)
There's an issue for min and max number values here: https://github.com/seagreen/Son/issues/3
Son seems like a natural place to put restrictions on them, but I'm not sure if there's way to do it that (A) still makes for a clean spec and (B) still allows everything floats can encode to to be used.
Re:Son – A minimal subset of JSON for machine-to-machine com...
by pacaro on Tuesday March 14, 2017 @07:02PM
(#13872333)
Yeah, as with the trailing zero, you're being burned by JavaScript's decision to just have a Number type. As far as js is concerned 1 and 1.0 are the same number.
Re:Son – A minimal subset of JSON for machine-to-machine com...
by pacaro on Tuesday March 14, 2017 @07:04PM
(#13872353)
On an unrelated note. If human readability isn't a primary concern, I'd recommend requiring that < > & all be escaped, this prevents some crappy attacks
Also, no top level lists!
Re:Son – A minimal subset of JSON for machine-to-machine com...
by seagreen on Tuesday March 14, 2017 @07:32PM
(#13872526)
Why no top level lists?
Re:Son – A minimal subset of JSON for machine-to-machine com...
by pacaro on Tuesday March 14, 2017 @10:39PM
(#13873357)
Ha! I guess I'm showing my age. There used to be an associated vulnerability, which is why some frameworks won't let you do it. It appears that the vulnerability was fixed in what are now fairly old versions of browsers.
More info at http://stackoverflow.com/questions/16289894/is-json-hijackin...
Re:Son – A minimal subset of JSON for machine-to-machine com...
by drewnoakes on Tuesday March 14, 2017 @02:56PM
(#13870381)
JSCON: JavaScript Canonical Object Notation
EDIT: Not meaning anything is a plus! But I see your point about being un-googleable.