-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide an official JSON Schema for the config file #2113
Comments
Documenation for configuration: https://dependabot.com/docs/config-file/ This fixes dependabot/feedback#651
Documentation for configuration: https://dependabot.com/docs/config-file/ This fixes dependabot/feedback#651
I took the liberty to do this. The pull requests has a full schema matching the current documentation on the website.
Here is a quick preview how the file can now be edited within code |
@bmuskalla nice work! Sorry for not getting to this, we've ended up with a JSON schema which isn't directly usable for the entire config file so not sure how to best re-construct and publish it. We validate each update config against a different sub-schema to get better errors. Tried using I've just created a Gist with the one we use as we have some subtle differences between package managers: https://gist.github.com/feelepxyz/d2c8f58359f29a4b4cdc935530060aae Would love any ideas on how we could build a usable single schema that generates good error messages. |
@feelepxyz thanks for sharing. Indeed, having validation for those subtle differences is super important. I think we're in luck here. JSON Schema draft-07 supports conditional subschemas (read if/then/else - who knew this was a thing) and it seems most json/yaml parsers do understand draft -07. A tried it out in a small example, at least validation works properly in VSCode. Example makes it so the valid options Would that work for you? If so, let me know and I can try to rework the schema to use the conditionals as well. |
Documentation for configuration: https://dependabot.com/docs/config-file/ This fixes dependabot/feedback#651
@bmuskalla I'll give that a go when I get a moment, if it works we could easily add an API endpoint for the schema. |
This is a duplicate of #1927 |
It would be great if dependabot could release an official JSON Schema for the config file format.
Ideally this would also be added to schemastore such that editors can pick up the new file automatically.
Publishing the schema allows users to benefit from auto completion in their editors, for example with VS Code.
It seems that the config validator on the dependabot website already uses a JSON schema, so it might be enough to simply publish that one.
The text was updated successfully, but these errors were encountered: