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

Disallow dup json comments #40390

Merged
merged 2 commits into from
May 10, 2020

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Stop allowing duplicate comment keys in json"

Purpose of change

Our json parser allowed "//" and "comment" as special cases which could appear as duplicate keys in json objects. This caused issues when people try to script alterations to the json using other json libraries, etc.

Describe the solution

Stop allowing that.

Update the cases that exist to not do that any more.

I only updated the core data and mods that aren't on the test blacklist. It's hard to fix the others. I'm hoping they have few errors and, if they exist, I'm sure we'll get issue reports about them soon.

Describe alternatives you've considered

Hacking around the problem in ancillary scripting somehow.

Testing

Unit tests (including the mods, where possible).

Additional context

To assist me with scripting a solution to #40321.

Previously we whitelisted "//" and "comment" as keys which were allowed
to be duplicated in json objects.  Stop doing that.

Allowing these duplicate keys only causes problems when attempting to
process the game data files using other json tools or libraries.
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

Successfully merging this pull request may close these issues.

2 participants