Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: allow user to decide whether the output schema should list the key in original order #19

Open
khoadaniel opened this issue Jun 22, 2023 · 0 comments

Comments

@khoadaniel
Copy link

Hi jsontypedef team,

First of all, thank you for building this tool.

In my use case I have a really long schema to be inferred, and verifying the inferred schema with the original json input takes some time because their key orders are not the same. I can sort the input's keys with some workaround python scripts but it would be awesome if you can integrate the following:

Current behavior:

  • All the keys in the output are sorted in alphabet order.
  • If users want to verify the schema output and the original input json, it would take longer time to navigate between the two because their key order has changed.

Example: "name" has been pushed to second place.

echo '{ "name": "Joe", "age": 42 }' | jtd-infer | jq

{
  "properties": {
    "age": {
      "type": "uint8"
    },
    "name": {
      "type": "string"
    }
  }
}

Expected behavior:

  • Allow users to decide whether the output keys are sorted or not with a command line parameter.

Thank you.

P/S: Great tool! It saves lots of time for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant