-
Notifications
You must be signed in to change notification settings - Fork 419
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 validation #463
Comments
Can you elaborate a bit on where the users would use / deploy this validator? |
The thrust of my argument comes from the code generation perspective, whereby the specification will be used as the source of truth for generating C# types and helpers. In these instances, the downstream impact of an incorrect or incomplete specification often means breaking binary compatibility in the generated artifact. I believe this is also true for other statically typed languages, not just C#. Anything we can do to validate that the specification is complete and correct minimises some of this downstream impact. Perhaps this validation can be tied to the CI system, such that an update to the YAML specification results in a CI validation check to assert that the YAML is;
|
++. I remember just recently seeing a PR from @jsoriano in Beats which does some YAML validation. Perhaps we can reuse parts from there? |
In elastic/beats#13188 I am adding a check to Beats build to validate that the fields definitions have correct types and formats. Beats case is a bit special because we compose the big fields definition YAML file by concatenating many small YAML-like files, and we were not checking this validity yet, so we could end-up with obscure errors in tests, or with some unexpected behaviours. For the check I am using the What I think that |
I agree with this need. An embryo of some of these ideas is already in place, but is far from perfect. Here's a few of the things we have already:
The checks in place right now are not enough for my liking, I agree we need more. Side point. When you talk about bounds checking, I assume you're talking about the Related to this, there is work that needs to happen on adjusting |
Is a schema validator still under consideration? If so, would a CUE schema (cuelang.org) be a viable alternative? |
@ChrisHines, yes, this is something valuable to incorporate at some point. I've done some JSON schema work as part of other ECS-related projects that could serve as a starting point: https://github.com/ebeahan/ecs-vscode/blob/main/schema/schema.json |
Can we look at implementing some kind of schema validation on the YAML files? Something along the lines of: https://github.com/paazmaya/yaml-validator?
Alternatively, perhaps a move towards a schema type that has native validation? JSON Schema?
The text was updated successfully, but these errors were encountered: