Closed hawkrives closed 1 month ago
I found the issue in GitLab's schema, in $.defintions.parallel
:
"parallel": {
"description": "Splits up a single job into multiple that run in parallel. Provides `CI_NODE_INDEX` and `CI_NODE_TOTAL` environment variables to the jobs.",
"oneOf": [
{
"type": "integer",
"description": "Creates N instances of the job that run in parallel.",
"default": 0,
"minimum": 1,
"maximum": 200
},
They've set the minimum to 1, but the default to 0.
I'll go ahead and close this issue – I think there are a number of in-progress tickets that have scoped out better error messages and better error handling, so I don't think that this ticket is required.
Thank you for Typify!
They've set the minimum to 1, but the default to 0.
This is always a quandary: should we do our best to infer something reasonable? Or is the best thing to do to fail.. albeit with more grace than we currently do!
My inclination in this case (and in most cases) is to fail. Ideally we would provide guidance about the specific problem (i.e. "default value is not valid") and a suggestion for how to address it (e.g. a json patch to fix the default).
Hi! I'm trying to use
cargo-typify
to generate types for the GitLab CI config file, which they helpfully publish.But, when I try to generate the Rust structs, I get a crash.
I tried to bisect where the problem definition was, but I got stuck in the middle of testing
jobTemplate
, which is one of their hairiest schemas in the file. I may try to clone this repo and integrate https://docs.rs/serde_path_to_error/latest/serde_path_to_error/ to see if that gives any more pointers (I'm not sure if it will), but that's dependent on my availability this afternoon.