Skip to content

feat(codegen): emit description in JSON Schema properties - #355

Merged
domenkozar merged 1 commit into
cachix:mainfrom
frdminc:upstream-pr/schema-description
Aug 16, 2026
Merged

feat(codegen): emit description in JSON Schema properties#355
domenkozar merged 1 commit into
cachix:mainfrom
frdminc:upstream-pr/schema-description

Conversation

@djbclark

Copy link
Copy Markdown
Contributor

Summary

property_type in codegen.rs::schema only emitted a property's type,
even though the IR already carries each field's description — populated
from the manifest by build_union and build_profile_fields. That
description never reached the generated JSON Schema.

quicktype turns a JSON Schema description into a
native docstring in every target language, so this was a silent gap between
what a manifest declares and what an SDK type generated from it documents.

Change

property_type now inserts a description key when the field has one, and
omits it entirely otherwise (rather than emitting an empty or null value).

Validation

  • cargo test --package secretspec --all-features codegen:: — 11 passed
  • cargo fmt --all -- --check
  • cargo clippy -p secretspec --no-default-features --features cli -- -D warnings — no new warnings in codegen.rs (3 pre-existing failures
    elsewhere, present on main before this change too)

property_type only emitted a property's type, so a secret's declared
description never reached the generated schema even though the IR
already carries it (build_union/build_profile_fields populate
IrField.description from the manifest). quicktype turns a JSON Schema
"description" into a native docstring in every target language, so
this was a silent gap between what the manifest declares and what a
generated SDK type documents.

property_type now inserts a "description" key when the field has one,
and omits it otherwise rather than emitting an empty or null value.
@domenkozar
domenkozar merged commit faa9645 into cachix:main Aug 16, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants