Repository navigation
feat: generate module template.yaml editor schema from the CRD - #158
Merged
Merged
Conversation
Companion to gameplane-module#33, which gives module YAML files an explicit editor schema (VS Code was mis-matching template.yaml against the AWS SAM schema). template.yaml is a GameTemplate custom resource, so its schema is the CRD's openAPIV3Schema. hack/gen-module-schema.py extracts it, wraps it as a draft-07 JSON Schema (pinning apiVersion/kind to const), and writes modules/.schema/gametemplate.schema.json in the submodule. `make module-schema` runs it — re-run after CRD spec changes, then commit the result in gameplane-module and bump the submodule pointer. docs/module-authoring.md documents the modeline + regen step. Signed-off-by: valgulnecron <39313199+ValgulNecron@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.
Companion to ValgulNecron/gameplane-module#33, which stops VS Code mis-matching module
template.yamlagainst the AWS CloudFormation SAM schema by giving both module YAML files an explicit$schema.A module
template.yamlis aGameTemplatecustom resource, so its schema is the CRD'sopenAPIV3Schema. This adds:hack/gen-module-schema.py— extracts the CRD'sopenAPIV3Schema, wraps it as a draft-07 JSON Schema (pinningapiVersion/kindtoconst), and writesmodules/.schema/gametemplate.schema.jsoninto the submodule.make module-schema— runs it. Re-run after CRD spec changes, then commit the regenerated schema in gameplane-module and bump the submodule pointer.docs/module-authoring.md— documents the modeline + regen step.The generated
module.yaml/template.yamlschemas + per-file modelines live in gameplane-module#33; the submodule pointer bump follows once that merges. This PR is the generator half only (no submodule change here).Verification
make module-schemaruns clean and is idempotent (byte-identical output on re-run).template.yaml(constapiVersion/kindmatch; noadditionalProperties: false, so it never false-flags a field).🤖 Generated with Claude Code