Repository navigation
Add more json schema features - #10
Merged
Merged
Conversation
Carry format, min/max length, min/max items, uniqueItems, const, title, additionalProperties and optional on ValueNode so the parser can attach the extended draft-07 keyword directives and the schema layer can emit them.
Add @Format, @minlength, @maxlength, @minItems, @Maxitems, @Uniqueitems, @const, @title, @additionalProperties and @optional to the annotation parser, wire them onto each node, and cross-check them at parse time: warn on duplicates and bad arguments, on constraints attached to Kubernetes types, on @additionalProperties misuse, and when a bundled default cannot satisfy @const (equality mirrors the schema layer so the warning fires exactly when the emitter drops the constraint).
… between integer types' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a batch of extended draft-07 JSON Schema keyword directives to helm-scribe.
Each is written as an
@-directive in a values.yaml comment, parsed onto thevalue node, and emitted into the generated schema.
New directives:
@format <name>format@minLength/@maxLength <int>minLength/maxLength@minItems/@maxItems <int>minItems/maxItems@uniqueItemsuniqueItems@const <scalar>const@title <text>title@additionalProperties true|falseadditionalProperties@optionalrequiredBehavior notes
(
const,uniqueItems,min/maxLength,min/maxItems, ...) that thechart's own bundled default would violate is dropped at emit time and warned
about at parse time, so the generated schema never rejects the values it
ships with.
@const+@enumon the same key is a hard generation error (contradictory).ignores sibling keywords).
non-strings, item-count keywords on non-arrays,
@additionalPropertiesonnon-objects — each with a warning.