Profiles ship with a # yaml-language-server: $schema=../schemas/mock-mcp-config.schema.json directive at the top of the file. Configured editors use it to validate the x-mock-* extensions and autocomplete known properties as you type.
Install the YAML extension by Red Hat. The $schema directive is honored automatically — no settings changes needed.
After install, opening any file under configs/ will show:
- Inline completions for
x-mock-port,x-mock-auth,x-mock-mcp, etc. - Hover docs on each property.
- Squiggles on unknown keys, missing required fields, and bad shapes.
The # yaml-language-server: directive isn't auto-honored, but you can wire the schema up explicitly:
- Settings → Languages & Frameworks → Schemas and DTDs → JSON Schema Mappings.
- Click + to add a new mapping:
- Schema file or URL:
schemas/mock-mcp-config.schema.json(relative to project root) - Schema version: Draft 7
- File path pattern:
configs/*.yaml
- Schema file or URL:
- Apply.
You'll get the same completions and warnings VS Code does.
Any editor with yaml-language-server support (Neovim with coc-yaml or nvim-lspconfig, Helix, Sublime, Zed, …) honors the $schema directive automatically. Install the language server, open the YAML, validation just works.
Once configured, typos like sx-mock-dynamic and unknown properties show up as warnings before you commit:
sx-mock-dynamic:
^^^^^^^^^^^^^^^^
Property is not allowed.
x-mock-auth:
type: bearer
toekn_env: BEARER_TOKEN # ← warning: not in schemaSome constraints are application-level, not schema-level — these still need make validate-configs to catch:
- "Exactly one of
x-mock-staticorx-mock-dynamicper operation" — the schema doesn't enforce mutual exclusion (allows both, allows neither). The loader does. - JSON Pointer references inside
derived(e.g.{ref: /summary_stats/total}) — the schema doesn't know whether the path resolves; you find out at runtime or by running validate-configs. seed_from: query.X— the schema doesn't verify thatXis a declared query parameter.
So: editor schema gets you syntax + shape; make validate-configs (and the test suite) gets you semantics.