-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add JSON schema for config file #1864
Add JSON schema for config file #1864
Conversation
Hey @binyamin 👋 Apologies for being a bit slow getting back to you on this. Happy to review this. What did you mean by |
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.
Looks good so far! Just a couple of comments. Thanks so much 🙏
}, | ||
"definitions": { | ||
"OsHook": { | ||
"title": "GOOS/*", |
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.
So these osHook keys are actually the format of the keys rather than explicit values, EG: windows/*
or linux/arm7
. I'm not sure how you represent that in JSONSchema!
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.
True. I could have validated it against a list of all possible os and arch values. Instead, I chose to add some dummy keys for explanation (lines 182 - 190). The keys are matched against a RegExp at lines 192 - 202.
Just FYI, the title
key is mainly used for intellisense & documentation. It's doesn't mean you actually use "title"
in the schema.
I edited the top comment. Let me know if it's still unclear. |
Do you mean update the generated |
@leaanthony it would look like this: {
"$schema": "https://wails.io/schema/config.v2.json",
"name": "{{.ProjectName}}",
// ...
} |
@binyamin - I've added the schema references + updated the docs. Let me know if you feel this is good to go and we'll get it merged 👍 |
Let's go! |
Thanks for taking the time to do this. It's a fantastic addition 👍 |
Provides a JSON schema for the
wails.json
configResolves #1851
Notes
Along with publishing a schema, I feel that a few more things would be useful
wails init
, the config file it creates should include a link to the schema/docs/reference/project-config
.