-
Notifications
You must be signed in to change notification settings - Fork 186
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
marvin-roesch
wants to merge
12
commits into
minecraft-dev:dev
Choose a base branch
from
marvin-roesch:feature/json-schemas
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WIP] Introduce JSON validation through schemas #315
marvin-roesch
wants to merge
12
commits into
minecraft-dev:dev
from
marvin-roesch:feature/json-schemas
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marvin-roesch
force-pushed
the
feature/json-schemas
branch
from
April 7, 2018 17:37
54b7ac7
to
0815508
Compare
Recipes JSON are now also usable for Fabric, should update. |
I'm familiar with JSON schemas, I'll try and help. Also opened an issue here: #1049 |
10 tasks
Closed
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.