You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support JSON Schema conditional validation (if/then/else) for required fields #23
Today cozyvalues-gen can mark a field as required only unconditionally (via @field {type} name without brackets) or optional (@field {type} [name]). There is no way to express "field X is required only when field Y has value Z" in the generated values.schema.json, even though JSON Schema Draft 7 supports this via if/then/else or allOf + dependencies.
Use case. In chart packages/extra/etcd (cozystack/cozystack), the fields backup.destinationPath, backup.endpointURL, backup.s3AccessKey, and backup.s3SecretKey are required when backup.enabled: true and should be left empty otherwise. Render-time validation with the Helm required function is already in place, but the dashboard would give users earlier, field-level feedback if the generated schema could express the condition.
Proposed annotation (sketch, open to bikeshedding):
Activity