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

[WIP] Introduce JSON validation through schemas #315

Draft
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

marvin-roesch
Copy link
Contributor

@marvin-roesch marvin-roesch commented Oct 14, 2017

As a disclaimer, this is very much to be interpreted as a WIP feature right now, but I still wanted to get out the current results and iteratively improve upon them in order to get early feedback from people manually using the schemas.

This PR makes the first steps towards providing helpful support for the various proprietary JSON "formats" put forward by Mojang and other parties (such as Forge). Currently, the following formats are being worked on or finished (the paths correlate directly to what is matched by the schemas):

  • sounds.json (first thing finished because it's a really simple format)
  • blockstates/[file].json (both Vanilla and Forge flavours)
  • models/(item/block)/[file].json
  • recipes/**/[file].json (only Vanilla and Forge types for now)
  • advancements/**/[file].json
  • loot_tables/**/[file].json

Some early feedback would be appreciated and if somebody is familiar with the JSON Schema format, suggestions on how to improve mine would be great. Unfortunately, IntelliJ's built-in validator appears to be fairly fenced off code-wise, the only entrypoint I could find was the schema providers to add custom schemas, with no way to provide custom error messages of any kind.

This limitation may be addressed on a second PR I plan to make (which may or may not be worked on in parallel with this, depending on how easy it is), which aims to provide intelligent support for JSON editing, such as file referencing and (limited) registration validation.

@Ayfri
Copy link

Ayfri commented Jul 19, 2021

Recipes JSON are now also usable for Fabric, should update.

@TheOnlyTails
Copy link

TheOnlyTails commented Jul 31, 2021

I'm familiar with JSON schemas, I'll try and help.

Also opened an issue here: #1049

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

Successfully merging this pull request may close these issues.

6 participants