build: schema definitions are named after the types they describe - #1321
Open
gennaroprota wants to merge 2 commits into
Open
gennaroprota wants to merge 2 commits into
gennaroprota wants to merge 2 commits into
Conversation
The generated RELAX NG and JSON schemas named nearly every definition after a symbol ID, as in `S_21EdS1EVSJuD9X76CVhzhLTLg1fi`, so neither told a reader what a definition describes, and a change in how Clang computes IDs rewrote both files. Name each definition after the type it describes. When two types share a name, each is qualified with as many enclosing scopes as it takes to tell them apart, joined with `.`; the ID remains the name of last resort. Fixes cppalliance#1297.
The JSON schema reflected from MrDocs's own types declares draft-07, but kept its definitions under `$defs`, a keyword that draft-07 does not define and that only the 2019-09 draft introduced. Its references resolved only because a JSON pointer can reach any member of a document. Use `definitions`, the draft-07 keyword, rather than move the schema to a later draft, as the configuration schema declares draft-07 as well.
Contributor
🧾 Changes by Scope
🔝 Top Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1321 +/- ##
========================================
Coverage 83.12% 83.12%
========================================
Files 35 35
Lines 3662 3662
Branches 844 844
========================================
Hits 3044 3044
Misses 410 410
Partials 208 208
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://1321.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-09-24 10:10:09 UTC |
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.
The generated RELAX NG and JSON schemas named nearly every definition after a symbol ID, as in
S_21EdS1EVSJuD9X76CVhzhLTLg1fi, so neither told a reader what a definition describes, and a change in how Clang computes IDs rewrote both files. Each definition is now named after the type it describes.While at it, the JSON schema is fixed to use the
definitionkeyword instead of$defs, which was introduced by a later draft.Changes
FunctionSymbolorRecordTranche. When two types share a name, each is qualified with as many enclosing scopes as it takes to tell them apart, joined with., as indoc.Text; a name taken by one of the fixed definitions (Mrdocs,Tagfile,AnySymbol, ...) is qualified the same way. The ID remains the name of last resort, for types whose whole qualified names coincide. Separately, the JSON schema declares draft-07 but kept its definitions under$defs, a keyword that draft-07 does not define and that only the 2019-09 draft introduced; they are now underdefinitions, the draft-07 keyword. The schema stays on draft-07 rather than moving to a later draft, as the configuration schema declares draft-07 as well.Testing
The existing tests cover the change.
xml-lintvalidates every golden XML fixture against the regenerated RELAX NG schema.schema-checkregenerates the schemas and compares them with the committed ones, and CI compiles the JSON schema with ajv. The qualification rule is not exercised by MrDocs's own types, since none of them collide; it was checked on made-up types sharing a name, sharing a whole qualified name, and clashing with a fixed definition.Documentation
The generators reference page, next to its links to the two schemas, now states how definitions are named.
Fixes #1297.