Skip to content
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 JSON Schema to allow validating config file #1767

Open
KiaraGrouwstra opened this issue Feb 23, 2025 · 1 comment
Open

provide JSON Schema to allow validating config file #1767

KiaraGrouwstra opened this issue Feb 23, 2025 · 1 comment

Comments

@KiaraGrouwstra
Copy link

Is your feature request related to a problem? Please describe.
We now have a sample config, which helps users get going to tweak their own setup. However, we currently do not yet offer static checks to help validate these.

Describe the solution you'd like
It would be nice to offer a JSON Schema file for config validation, including by LSP language servers such as yaml-language-server.

Describe alternatives you've considered
not make mistakes

Additional context
n/a

@felixfontein
Copy link
Contributor

I think there was an issue or discussion before where validation of .sops.yaml files came up, but I can't find it right now. It would be great to have validation, either as a sops subcommand or as a JSON schema (or both), but it would be best if that could be automatically extracted from the existing data structures.

It looks like there is a library which creates JSON schemas from Go data structures: https://github.com/invopop/jsonschema So this should be doable. (Actually both: creating a standalone JSON schema, and creating a config validation subcommand that uses the schema to do the validation.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants