DX-2231: Add JSON schema for validating docs.yml#1381
Draft
dslovinsky wants to merge 1 commit into
Draft
Conversation
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>
🔗 Preview Mode
|
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.
Summary
Replaces the Fern schema reference in
content/docs.ymlwith 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 rootinstances/tabs/navigationkeys and the five navigation item types (page, section, link, api, changelog), plus Alchemy extensions (skip-slug,noindex,flattened,paginated).additionalProperties: falsethroughout, with hover descriptions on every property.content/docs.yml:$schemacomment now points at the local schema instead ofschema.buildwithfern.dev.scripts/validate-docs-yml.ts+validate:docs-ymlnpm script +ajvdevDep: CLI validation of docs.yml against the schema (mirrorsvalidate-rpc.ts)..github/workflows/pr-checks.yml: newdocs.yml Schemajob so an invalid docs.yml fails PR checks.src/content-indexer/types/docsYaml.ts: aligned types with actual usage — addedcollapsed(sections),changelog(tabs),instances, and madelayoutoptional (the changelog tab has no layout; consumers already guard for it).Testing
pnpm run validate:docs-ymlpasses against the current docs.yml🤖 Generated with Claude Code