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

indent: Unexpectedly removes content #182

Closed
duncandewhurst opened this issue Feb 7, 2022 · 1 comment
Closed

indent: Unexpectedly removes content #182

duncandewhurst opened this issue Feb 7, 2022 · 1 comment
Labels

Comments

@duncandewhurst
Copy link
Contributor

duncandewhurst commented Feb 7, 2022

I happened upon some unexpected behaviour when I tried to indent a file that contained non-unique keys under /definitions/Award.

To reproduce:

curl -LOJ https://gist.github.com/duncandewhurst/848ac5dc8bd101ead02badd188898281/raw/f4b6f5e0760ddd8a8efb0ee18d3aa5561d61fc02/release-schema.json
ocdskit indent release-schema.json

Result: one of the properties keys under /definitions/Award is removed.

@jpmckinney
Copy link
Member

jpmckinney commented Feb 7, 2022

Hmm, any software that reads and writes JSON is very likely to remove duplicate keys, because the internal representation is typically a dictionary, which cannot have duplicate keys. We'd need to write our own data structure. However, such inputs are rare, and generally JSON with duplicate keys is discouraged (e.g. RFC 7493). So, I'll mark this as wontfix.

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

No branches or pull requests

2 participants