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

Use JSON schemas and make JSON more coherent between contexts #42986

Closed
int-ua opened this issue Aug 17, 2020 · 3 comments
Closed

Use JSON schemas and make JSON more coherent between contexts #42986

int-ua opened this issue Aug 17, 2020 · 3 comments
Labels
[JSON] Changes (can be) made in JSON <Suggestion / Discussion> Talk it out before implementing

Comments

@int-ua
Copy link
Contributor

int-ua commented Aug 17, 2020

Is your feature request related to a problem? Please describe.

Trying to work with all JSON objects in the game together is unwieldy and uncomfortable. Fields can change type and meaning in different contexts and there is a general feeling of incoherence. It may not be an intended workflow, but for now tools/json_tools/util.py is implemented like this, trying to work with everything in data/json/ as a whole, and trying to improve it is frustrating.

Describe the solution you'd like

  1. Using JSON Schemas to define a standard to strive for and gradually update existing JSON so that it matches the schemas.

  2. Making sure that type and id together can identify any JSON object globally.

  3. Renaming id to ids where it contains a list of values.

  4. Using id instead of abstract field. (I'm not sure, is there a benefit to having this separate field?)

  5. Renaming type to something like loader_type or deserializer_type to make it more comprehensible.

Additional context

#42958
#42959
https://discordapp.com/channels/598523535169945603/598535827169083403/744539312674308138
#42984

I still have to read this #34735

@anothersimulacrum anothersimulacrum added <Suggestion / Discussion> Talk it out before implementing [JSON] Changes (can be) made in JSON labels Aug 17, 2020
@int-ua
Copy link
Contributor Author

int-ua commented Aug 17, 2020

anothersimulacrum posted these links to previous discussions 👍
https://discordapp.com/channels/598523535169945603/598529538015887372/702602669516128327
https://discordapp.com/channels/598523535169945603/598529174302490644/627569204203094016

@damien were there any updates? No pressure, just asking :)

Who is Zephandrypus on GitHub?

@int-ua
Copy link
Contributor Author

int-ua commented Aug 17, 2020

Ok, I'm closing this as the consensus between main developers is against these changes (see the linked Discord discussions).

But please add your voice arguments if you've found this issue after encountering similar problems.

Also looks like the consensus several months ago was against simplifying working with JSON not from C++ if it would entail any changes to workflows. I disagree and I'll stop trying to improve Python tools for now as it seems futile after reading these discussions.

@int-ua int-ua closed this as completed Aug 17, 2020
@anothersimulacrum
Copy link
Member

What I have gathered from these in the past is that if we have automatically generated schema, it's fine, if anyone is interested in working on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[JSON] Changes (can be) made in JSON <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

2 participants