docs(schema): publish JSON Schema for goten.config.yaml - #30
Merged
Conversation
Closes #26. Publishes goten.config.schema.json at the repo root so editors with YAML LSP support (VS Code + Red Hat YAML extension, JetBrains, Neovim, etc.) can provide autocomplete, hover docs, and inline validation when editing goten.config.yaml. Activation is a single-line magic comment at the top of the user's config file (yaml-language-server convention). Schema is pure editor metadata — runtime behavior unchanged. The shorthand plugin form (`- username`) is part of the schema's allowed values but examples/basic keeps full paths because it shares migrations with the repo root via `../../`. The shorthand demo lives in the upcoming Quick Start rewrite (#27). Steps: - 2.1 Write goten.config.schema.json covering env_file, database (url + driver enum), migrations (core_dir, plugins, table), and generate_dir. - 2.2 Add magic comment header to examples/basic/goten.config.yaml. - 2.3 README pointer in the CLI section. - 2.4 CHANGELOG entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Closes #26.
Summary
Publishes
goten.config.schema.jsonso editors with YAML LSP support give autocomplete, hover docs, and inline validation when editinggoten.config.yaml.Activate with a magic comment at the top of your config:
Works in VS Code (Red Hat YAML extension), JetBrains GoLand/IntelliJ, Neovim with
yaml-language-server, etc.Why
Until now editing
goten.config.yamlwas raw text. With the schema in place:databse:→ red squiggle).driver: postgers→ "must be one ofpostgres".Steps (matching #26)
goten.config.schema.jsonat repo root — coversenv_file,database(urlrequired,driverenum),migrations(core_dir,plugins,table),generate_dir.$idis the raw GitHub URL.examples/basic/goten.config.yaml. Kept full paths in this file because it shares migrations with the repo root via../../; the shorthand demo lives in the upcoming Quick Start rewrite (docs(wiki): rewrite Quick Start for new projects #27).[Unreleased]entry.Design notes
additionalProperties: falseso unknown fields are flagged. This matches the strict Go struct definitions.pluginsitems: schema describes both shorthand (username) and full path (./plugins/username/migrations) as valid — auto-detected by the CLI at runtime (Issue feat(cli): top-levelgoten init+ plugin registry #25'sresolvePluginEntry).Test plan
make build— all six modules compile (schema does not affect compilation).go test ./cmd/goten/...— all green; schema is not consumed by any test.examples/basic/goten.config.yamlin VS Code with Red Hat YAML extension. Confirm:database:shows description.dat→ autocomplete suggestsdatabase.driver: postgrestodriver: postgers→ red squiggle.Unblocks
#27 — Quick Start rewrite can now reference the schema URL in its sample config.
🤖 Generated with Claude Code