Skip to content

docgen: map info, examples, externalDocs from schema YAML#925

Merged
zeevdr merged 1 commit into
mainfrom
911-docgen-yaml-metadata
Jun 11, 2026
Merged

docgen: map info, examples, externalDocs from schema YAML#925
zeevdr merged 1 commit into
mainfrom
911-docgen-yaml-metadata

Conversation

@zeevdr

@zeevdr zeevdr commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

  • decree docgen --file silently dropped schema-level info and per-field examples/externalDocs: validate parsed them as untyped any (deferred in polish: tools low-severity cleanup (pre-beta review) #720) and schemaFromYAML never mapped them, despite docgen having working renderers. version_description and allowed_schemes had no docgen counterpart at all.
  • validate gains concrete types (SchemaInfoDef/SchemaContactDef, ExampleDef, ExternalDocsDef) with strict meta-schema-aligned parsing; schemaFromYAML maps all of it into the docgen schema.
  • docgen renders VersionDescription on the version line and Allowed schemes in the constraints block; the examples renderer also becomes deterministic (it previously iterated a map).
  • Online mode (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-go clean; go build/go vet clean in all touched modules
  • Tagged compile checks: go vet with integration, e2e, e2e upgrade, stress, chaos, example tags
  • New functions 100% covered (go tool cover -func); end-to-end CLI render of a full-metadata schema verified

Closes #911

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>
@zeevdr zeevdr added this to the Docs Toolkit milestone Jun 11, 2026
@zeevdr zeevdr added size: M Moderate — a day or two, clear scope priority: P2 Nice-to-have labels Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit 9c160e7 into main Jun 11, 2026
21 checks passed
@zeevdr zeevdr deleted the 911-docgen-yaml-metadata branch June 11, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: M Moderate — a day or two, clear scope

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docgen: map info, examples, externalDocs from schema YAML

1 participant