Skip to content

Commit 00366e3

Browse files
committed
feat: migrate to magicschema
Replace the helm-schema dependency with magicschema for value inference. The new reader resolves $ref and $defs pointers, including nested definitions, JSON pointer escapes, and cyclic references, so generated KCL schemas expand inlined definitions. Regenerate the example and testdata schemas to match the new output, and add testdata covering refs, defs, and cycles.
1 parent a9eb8ed commit 00366e3

47 files changed

Lines changed: 18015 additions & 23050 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,16 @@ The following schema generators are currently available:
305305
| :-------------- | :------------------------------------------------------------------------------------ | ---------------: |
306306
| NONE (default) | Do not use a schema generator (Values will be `[...str]: any`). | |
307307
| AUTO | Try to automatically select the best schema generator for the chart. | |
308-
| VALUE-INFERENCE | Infer the schema from one or more values.yaml files (uses [helm-schema][helm-schema]) | `valueInference` |
308+
| VALUE-INFERENCE | Infer the schema from one or more values.yaml files (uses [magicschema][magicschema]) | `valueInference` |
309309
| URL | Use a JSON Schema file located at a specified URL. | `schemaPath` |
310310
| CHART-PATH | Use a JSON Schema file located at a specified path within the chart files. | `schemaPath` |
311311
| LOCAL-PATH | Use a JSON Schema file located at a specified path within the project. | `schemaPath` |
312312

313313
`AUTO` is generally the best option. It currently looks for `values.schema.json` files in the chart directory (i.e. `CHART-PATH` with `schemaPath: "values.schema.json"`), and falls back `VALUE-INFERENCE` (with default arguments) if none are found.
314314

315-
If `VALUE-INFERENCE` is used, the `valueInference` argument will be passed to [helm-schema][helm-schema]. This allows you to use custom arguments with [helm-schema][helm-schema]. See the [helm module docs](./modules/helm/README.md) for more details.
315+
If `VALUE-INFERENCE` is used, the `valueInference` argument will be passed to [magicschema][magicschema]. This allows you to select which schema annotation formats are parsed (helm-schema, helm-values-schema, bitnami, helm-docs), and whether the generated schema is strict. See the [helm module docs](./modules/helm/README.md) for more details.
316316

317-
[helm-schema]: https://github.com/dadav/helm-schema
317+
[magicschema]: https://pkg.go.dev/go.jacobcolvin.com/x/magicschema
318318

319319
### CRD Schema Generators
320320

@@ -445,5 +445,5 @@ Also, thanks all of the contributors to other KCL packages and plugins. Notably,
445445

446446
Also, special thanks to:
447447

448-
- [@dadav](https://github.com/dadav) for maintaining [helm-schema](https://github.com/dadav/helm-schema) and [go-jsonpointer](https://github.com/dadav/go-jsonpointer), which are both heavily used in klipper's schema generators.
448+
- [@dadav](https://github.com/dadav) for maintaining [helm-schema](https://github.com/dadav/helm-schema), the primary schema generator implemented via [magicschema](https://pkg.go.dev/go.jacobcolvin.com/x/magicschema).
449449
- [@carinacolvin_art](https://www.instagram.com/carinacolvin_art/) for creating the kclipper logo.

0 commit comments

Comments
 (0)