Skip to content

feat: generate module template.yaml editor schema from the CRD - #158

Merged
ValgulNecron merged 1 commit into
mainfrom
feat/module-schema-generator
Jul 17, 2026
Merged

ValgulNecron merged 1 commit into
mainfrom
feat/module-schema-generator

Conversation

@ValgulNecron

Copy link
Copy Markdown
Collaborator

Companion to ValgulNecron/gameplane-module#33, which stops VS Code mis-matching module template.yaml against the AWS CloudFormation SAM schema by giving both module YAML files an explicit $schema.

A module template.yaml is a GameTemplate custom resource, so its schema is the CRD's openAPIV3Schema. This adds:

  • hack/gen-module-schema.py — extracts the CRD's openAPIV3Schema, wraps it as a draft-07 JSON Schema (pinning apiVersion/kind to const), and writes modules/.schema/gametemplate.schema.json into 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.yaml schemas + 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-schema runs clean and is idempotent (byte-identical output on re-run).
  • The generated schema validates all 16 modules' template.yaml (const apiVersion/kind match; no additionalProperties: false, so it never false-flags a field).

🤖 Generated with Claude Code

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>
@ValgulNecron
ValgulNecron merged commit 6abbbf8 into main Jul 17, 2026
23 checks passed
@ValgulNecron
ValgulNecron deleted the feat/module-schema-generator branch July 17, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant