-
Notifications
You must be signed in to change notification settings - Fork 3
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
Validation of the rules file #17
Comments
It good to have a validator in any case, to make sure there are no bugs in the code. If it's a yaml, so I'm sure that a validator can be automatically generated (without coding) by specifying the required fields, unsupported fields, etc. |
No until just now, one of the candidates from here is cerberus. The schema is defined as a json dictionary . Nonetheless, the logic can be quite variable since, for example, the task name can be set up to a fixed value or inferred from a path pattern, so then the validator has to check that the task is in either of those fields. I'm not sure yet of how cerberus would be able to deal with that. Another option is the schema package . Reading a bit into it, it seems it would be able to support the kind of logic I just mentioned. There a whole bunch of other options listed there (Rx, kwalify, voluptuous, flatland) but those two (cerberus and schema) where the ones that upon a quick reading captured my attention. |
@yjmantilla It's an implementation of the bigger JSON Schema initiative which is in process to trying to become an IETF standard, which is promising. They have some other python implementations here as well It should support yaml (detailed here). JSON Schema is also supported by the Red Hat YAML extension for VS Code, so provides option for the user to validate their bids yaml from the VS code editor. Your other options also look good, especially Cerberus. |
So I was thinking that given that the rules file could be done by a power-user then it would be good to have a validator for it; in a sense that it has the required fields and not unsupported fields and so on.
The text was updated successfully, but these errors were encountered: