Skip to content

DX-2231: Add JSON schema for validating docs.yml#1381

Draft
dslovinsky wants to merge 1 commit into
mainfrom
ds/DX-2231-docs-yml-schema
Draft

DX-2231: Add JSON schema for validating docs.yml#1381
dslovinsky wants to merge 1 commit into
mainfrom
ds/DX-2231-docs-yml-schema

Conversation

@dslovinsky

Copy link
Copy Markdown
Collaborator

Summary

Replaces the Fern schema reference in content/docs.yml with our own local schema, since we've diverged from Fern's docs.yml options. Editor IntelliSense (yaml-language-server) now enforces exactly the options our content indexer supports — including Alchemy-specific extensions Fern's schema doesn't know about.

Part of DX-2231: https://linear.app/alchemyapi/issue/DX-2231/create-schema-file-for-validating-docsyml

Changes

  • content/docs-yml.schema.json (new): hand-authored JSON Schema (draft-07) covering the root instances/tabs/navigation keys and the five navigation item types (page, section, link, api, changelog), plus Alchemy extensions (skip-slug, noindex, flattened, paginated). additionalProperties: false throughout, with hover descriptions on every property.
  • content/docs.yml: $schema comment now points at the local schema instead of schema.buildwithfern.dev.
  • scripts/validate-docs-yml.ts + validate:docs-yml npm script + ajv devDep: CLI validation of docs.yml against the schema (mirrors validate-rpc.ts).
  • .github/workflows/pr-checks.yml: new docs.yml Schema job so an invalid docs.yml fails PR checks.
  • src/content-indexer/types/docsYaml.ts: aligned types with actual usage — added collapsed (sections), changelog (tabs), instances, and made layout optional (the changelog tab has no layout; consumers already guard for it).

Testing

  • pnpm run validate:docs-yml passes against the current docs.yml
  • Negative tests (unknown key, wrong type, api-only key on a page item) each fail with errors pointing at the offending item
  • Typecheck, ESLint, Prettier, and all 222 vitest tests pass

🤖 Generated with Claude Code

Replace the Fern schema reference in docs.yml with a local schema
(content/docs-yml.schema.json) covering exactly the options the content
indexer supports, including Alchemy extensions (skip-slug, noindex,
flattened, paginated). Add a validate:docs-yml script (ajv) wired into
PR checks, and align docsYaml.ts types with actual usage (collapsed,
tab changelog, instances, optional layout).

Part of DX-2231

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Jun 11, 2026, 10:40 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant