-
Notifications
You must be signed in to change notification settings - Fork 52
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
Validate scenarios against json schema #1475
Conversation
f789f81
to
b43ff86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems I left several things unfinished in #620, thanks for picking this up @kostmo! 👍
Did you manage to integrate the schema to your editor? I use VSCodium YAML extension with this workspace config:
{
"yaml.schemas": {
"https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/scenario.json": [
"data/scenarios/**/*.yaml"
],
"https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/entities.json": [
"data/entities.yaml"
],
"https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/recipes.json": [
"data/recipes.yaml"
],
}
}
We should probably note that somewhere (CONTRIBUTING.md
or editors
?). I am kind of embarrassed that I only wrote that to the previous PR and can't see it in any repo docs. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is all the stuff about subworlds
? I don't see that described anywhere in the schemas, but we have testing scenarios which use them.
I don't understand how this succeeds when the schemas have nothing about |
Co-authored-by: Brent Yorgey <[email protected]>
Co-authored-by: Brent Yorgey <[email protected]>
815d4ba
to
f5082d3
Compare
Yes, there are apparently two ways to handle this. |
Closes #1428
Since the authoritative validation of scenario files is actually performed by virtue of
swarm
parsing them, this CI job primarily exists to ensure the JSON Schema descriptions are accurate. This is important for two purposes:scenarios/README.md
#1436)Testing
Verified that the schema checker action does indeed work by intentionally pushing an invalid scenario file in f789f81.