docgen: map info, examples, externalDocs from schema YAML#925
Merged
Conversation
The offline validator now parses schema-level info and per-field examples/externalDocs into concrete types instead of accepting them as untyped any, and schemaFromYAML maps them into the docgen schema so that decree docgen --file renders the metadata it previously dropped. The doc model also gains the two missing spec keys: VersionDescription renders on the version line and the allowed_schemes constraint renders in the constraints section. Named examples now render sorted by name so the generated Markdown is deterministic. Closes #911 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
decree docgen --filesilently dropped schema-levelinfoand per-fieldexamples/externalDocs: validate parsed them as untypedany(deferred in polish: tools low-severity cleanup (pre-beta review) #720) andschemaFromYAMLnever mapped them, despite docgen having working renderers.version_descriptionandallowed_schemeshad no docgen counterpart at all.SchemaInfoDef/SchemaContactDef,ExampleDef,ExternalDocsDef) with strict meta-schema-aligned parsing;schemaFromYAMLmaps all of it into the docgen schema.VersionDescriptionon the version line andAllowed schemesin the constraints block; the examples renderer also becomes deterministic (it previously iterated a map).adminSchemaToDocgen) is intentionally untouched — that parity gap is docgen: online mode drops field metadata shown in --file mode #912.Test plan
make test— all modules pass./scripts/check-coverage.sh— sdk/tools 97.1% (≥96.0), cmd/decree 86.9% (≥86.1)make lint-goclean;go build/go vetclean in all touched modulesgo vetwithintegration,e2e,e2e upgrade,stress,chaos,exampletagsgo tool cover -func); end-to-end CLI render of a full-metadata schema verifiedCloses #911