-
Notifications
You must be signed in to change notification settings - Fork 6
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
Initial JSON schema #58
base: master
Are you sure you want to change the base?
Conversation
Interesting idea. I did not think about editing JSON files outside of the editor (/editor folder). The editor has all validations in place. and is also capable of updating related commands (the commands that have the same name and parameters in multiple games) in one batch. When you edit JSON file directly you risk to get the information diverged. However I don't think having a schema would harm anyone. I guess it may help in those rare cases when you absolutely need to make a raw edit. |
"description": "Total parameter count", | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 20 |
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.
The maximum is unset, however normally it would be 16 params in 3/VC and 32 in San Andreas
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.
Oops, it's my mistake. It should be increased. I wanted to add reasonable limit to make schema stronger.
Main problem is keeping schema up to date. If it's not intended to be used it's easy to forget about it. So if we want it to add, we need someone to keep it up to date. ¯\(ツ)/¯ |
What about some schemas?
schema/game.json
for[game]/[game].json
files,schema/enums.json
for[game]/enums.json
files.If you want to use it you should reference schemas in your
.json
files.I'm not sure about directory and file naming. I'm not sure is it ok to reference schemas directly from github. It's more like proof-of-concept.
How-To
In short, with schema you can do some interesting things:
By default, schema should be specified in
$schema
property. So you can copy and paste code below and try it by yourself.In Visual Studio you can type schema directly into special field: