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.
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.
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.jsonfor[game]/[game].jsonfiles,schema/enums.jsonfor[game]/enums.jsonfiles.If you want to use it you should reference schemas in your
.jsonfiles.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
$schemaproperty. So you can copy and paste code below and try it by yourself.{ "$schema": "https://raw.githubusercontent.com/nick7/library/master/schema/game.json", ... }In Visual Studio you can type schema directly into special field:
