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

Add vega lite spec validation for charts #4336

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

AdityaHegde
Copy link
Collaborator

This adds vega lite spec validation based on the spec : https://vega.github.io/schema/vega-lite/v5.json
We are using github.com/santhosh-tekuri/jsonschema/v5 to run the validation.

@AdityaHegde AdityaHegde force-pushed the adityahegde/custom-chart-vega-validation branch 2 times, most recently from 5e6eaf9 to 73a8e44 Compare March 13, 2024 10:51
@AdityaHegde AdityaHegde force-pushed the adityahegde/custom-chart-vega-validation branch from 73a8e44 to 96c93cf Compare March 13, 2024 10:52
@@ -13,6 +18,8 @@ type ChartYaml struct {
VegaLite string `yaml:"vega_lite"`
}

var vegaLiteSchema = jsonschema.MustCompile("https://vega.github.io/schema/vega-lite/v5.json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's vendor this spec into our repo (so charts work on slow/no internet connection).

Would suggest putting it in runtime/compilers/rillv1/data/vega-lite-v5.json and using the embed package here to build it into the binary.

@AdityaHegde AdityaHegde force-pushed the adityahegde/custom-chart-vega-validation branch from 63d6912 to 204f115 Compare March 14, 2024 11:59
@begelundmuller begelundmuller merged commit 5bf35ac into main Mar 14, 2024
4 checks passed
@begelundmuller begelundmuller deleted the adityahegde/custom-chart-vega-validation branch March 14, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants