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
Follow-up to #816 (full JSON Schema validation via NetworkNT). Once the core validator is spec-complete, expose it and build on it.
Part A — REST API for schema + values validation (jhelm-rest)
The engine already loads a chart's values.schema.json into Chart.valuesSchema and validates on render/lint. Surface that directly so a client (or the UI in Part B) can fetch the schema and validate arbitrary values without a full template render.
Proposed endpoints on ChartController (repo chart ref + uploaded .tgz variants, mirroring the existing /template + /template/upload pairing):
GET/POST /api/charts/schema — return the chart's values.schema.json (raw JSON), plus its default values.yaml. 404/empty when the chart declares no schema.
Swagger/OpenAPI annotations, proper status codes (security.adoc posture: READ_ONLY + api-key by default for REST).
New DTOs under jhelm-rest/.../dto (ValuesValidationRequest, ValuesValidationResult, SchemaValidationError).
Part B — Values UI editor (schema-driven)
A browser editor that renders a form from the chart's values.schema.json, edits values live, and validates against Part A.
Schema-driven form generation (types, enums→dropdowns, required, min/max, descriptions as help text, defaults as prefills).
Live validation via POST /api/charts/validate; inline error markers keyed by JSON pointer.
Raw-YAML toggle alongside the form (two-way).
Optional: "diff vs chart defaults" and a "render template with these values" action (reuses /template).
Open design questions (decide before building B):
Where does the UI live? A new module (e.g. jhelm-ui static SPA served by jhelm-rest) vs a separate repo. Lean: static assets served by jhelm-rest so it ships with the API, no extra deploy.
Follow-up to #816 (full JSON Schema validation via NetworkNT). Once the core validator is spec-complete, expose it and build on it.
Part A — REST API for schema + values validation (jhelm-rest)
The engine already loads a chart's
values.schema.jsonintoChart.valuesSchemaand validates on render/lint. Surface that directly so a client (or the UI in Part B) can fetch the schema and validate arbitrary values without a full template render.Proposed endpoints on
ChartController(repo chart ref + uploaded.tgzvariants, mirroring the existing/template+/template/uploadpairing):GET/POST /api/charts/schema— return the chart'svalues.schema.json(raw JSON), plus its defaultvalues.yaml. 404/empty when the chart declares no schema.POST /api/charts/validate— body: chart ref + candidate values; returns a structured result:valid: bool+ a list of{ pointer, keyword, message, schemaLocation }(the NetworkNTOutputUnitdetail shape from Full JSON Schema validation for values.schema.json (replace hand-rolled validator with NetworkNT) #816, mapped to a DTO — do NOT leak the library type).Notes:
SchemaValidator; add a variant that returns the structured error list instead of throwing, so the controller can return 200 withvalid:falserather than an exception. Keep the throwingvalidate(...)for Engine/lint.security.adocposture: READ_ONLY + api-key by default for REST).jhelm-rest/.../dto(ValuesValidationRequest,ValuesValidationResult,SchemaValidationError).Part B — Values UI editor (schema-driven)
A browser editor that renders a form from the chart's
values.schema.json, edits values live, and validates against Part A.defaults as prefills).POST /api/charts/validate; inline error markers keyed by JSON pointer./template).Open design questions (decide before building B):
jhelm-uistatic SPA served by jhelm-rest) vs a separate repo. Lean: static assets served by jhelm-rest so it ships with the API, no extra deploy.$schema).Slices
SchemaValidatornon-throwing structured-result variant + DTOs.ChartControllerschema + validate endpoints (repo ref + upload), Swagger, tests.Depends on #816.