AMWA-TV / is-template

Template repo for NMOS specifications
https://specs.amwa.tv/is-template
Apache License 2.0
0 stars 4 forks source link

JSON Formatter reorders properties #12

Closed garethsb closed 4 years ago

garethsb commented 5 years ago

According to https://github.com/callumlocke/json-formatter/blob/master/README.md#why-are-object-keys-sometimes-in-the-wrong-order, this is a browser feature.

But I think it really would help readability of the JSON Schemas if the "title", "description" (and then probably "type") fields were displayed before the other JSON Schema keywords like "anyOf", etc. (On the other hand, "$schema" is just noise!)

Perhaps we could arrange that without resorting to a different JSON parsing technique to keep the as-written order or specifying the order of every last property out-of-band?

Similar issue with examples - which have also been authored with a property ordering to aid readability - but maintaining the as-written order is probably the only way to solve that.

peterbrightwell commented 4 years ago

@garethsb-sony some progress was made on this so that title and description are at the top. Is that enough yet?

garethsb commented 4 years ago

Yes, for example the IS-04 resource type schemas are definitely easier to read with title/description ahead of anyOf, etc. Thanks.