Repository navigation
feat(schemas): add JSON schema for additional documentation summary.json - #1766
Open
officialbidisha wants to merge 2 commits into
Open
officialbidisha wants to merge 2 commits into
officialbidisha wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Fixes #1414.
Problem: the "Additional documentation" feature (--includes flag) is driven by a hand-written summary.json file, but its shape (array of { title, file, children? } entries, up to 5 levels deep, per the traversal in Application.prepareExternalIncludes) is undocumented. As noted in #1414 and the related #577, editors like VS Code can't offer autocomplete or catch typos without a schema to associate with the file.
Change: adds schemas/summary.schema.json, a draft-07 JSON Schema describing that shape (title and file required strings, optional recursive children array). Since package.json has no "files" allowlist, this gets published as-is, so users can point their editor at it, e.g. via a json.schemas entry in .vscode/settings.json referencing ./node_modules/@compodoc/compodoc/schemas/summary.schema.json.
Testing: added test/src/schemas/summary.schema.spec.ts, which asserts the schema requires title/file, validates the real fixture at test/fixtures/todomvc-ng2/additional-doc/summary.json against it, and confirms an entry missing a required field is flagged. No application code changed.