json-schema-tools icon indicating copy to clipboard operation
json-schema-tools copied to clipboard

Order of properties

Open handrews opened this issue 6 years ago • 0 comments

JavaScript does not reliably preserve object field ordering, and it is not trivial to hook JSON.parse() to produce a data structure that does. There are several possible solutions.

The JSON Schema UI vocabulary, if it gets off the ground, is likely to have keywords for managing display order. But there may be other options to explore. This issue tracks ideas for solving this problem.

The new implementation here tries to minimize changes to the parsed objects, so the problem may not be as bad, particularly when allOf is not heavily used to combine property sets.

The forthcoming UI should respect the required array for ordering those fields, but there is no corresponding way to order non-required fields. Also, if allOf and required are used together, the results may not be as expected.

Also paging @tajo @zackproser @Relequestual @Codelica This replaces cloudflare/doca#28

handrews avatar Apr 30 '18 23:04 handrews