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

Yaml Schema for Validation #253

Closed
emouawad opened this issue Feb 8, 2024 · 2 comments
Closed

Yaml Schema for Validation #253

emouawad opened this issue Feb 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@emouawad
Copy link

emouawad commented Feb 8, 2024

Note sure if it exists - but a yaml schema for validation would be useful for writing dashboards / alerts easily for new users.
That way in editors such as vscode one would get intellisense and errors when the yaml doesn't match the schema.

for reference vscode can pick up the schmea using smthg like:

# yaml-language-server: $schema=https://raw.githubusercontent.com/K-Phoen/grabana/schemas/schema.json
@K-Phoen
Copy link
Owner

K-Phoen commented Feb 8, 2024

Hey there!

I generated a JSON Schema for dashboards (see #254). Haven't spent too much time verifying that the schema is 100% accurate though, but it's probably still better than nothing (I actually expect it not to be completely accurate, especially when it comes to required/non-required fields and oneOf declarations)

You should be able to use it in vscode with:

# yaml-language-server: $schema=https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/dashboard.json

@K-Phoen K-Phoen closed this as completed Feb 8, 2024
@emouawad
Copy link
Author

emouawad commented Feb 9, 2024

Thanks I really appreciate the work that has been put into this - would it be possible also to generate a schema for DARK as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants