data-curator
data-curator copied to clipboard
Order of JSON file is not intuitive/simple
Current Behaviour (for problems)
When I export a data package, the content of the datapackage.json is in an order that is not intuitive/simple. I would expect the order of the content to start with the package information, then table, Instead it seems to start with the table information, then package. What's more, the information inside each of the package/table content is not necessarily in the right order. For example, one data package I exported has the package license information before the package name. I'm not sure if this is because it prints the content of the JSON in the order of user input or if it is set this way.
While this is fine as a machine-readable schema, it makes it very difficult/complex for a human to read the schema. I think this is important particularly as this is the key metadata information published from data curator - potentially this schema is the only resource available to help understand the data.
Expected Behaviour
I would expect the content of the JSON file to be ordered intuitively. For example, this example is ordered as I would expect: https://raw.githubusercontent.com/frictionlessdata/example-data-packages/master/cpi-data-via-url/datapackage.json
This was partly done in #230. Order isn’t important for a machine and ideally humans aren’t looking at JSON. There is a suggested order in the spec somewhere- I’ll add it here
Property order in files in https://github.com/frictionlessdata/specs/tree/master/schemas/dictionary
Hi @Stephen-Gates @louisjasek Yes as @Stephen-Gates suggested, a json data-structure has no order, but it may be possible to do this in a 'stringified'/'prettied' way on output into a file.