Skip to content

Render dataclass @property members in generated API reference#183

Merged
ccomb merged 2 commits into
mainfrom
fix/doc-gen-dataclass-properties
Jul 6, 2026
Merged

Render dataclass @property members in generated API reference#183
ccomb merged 2 commits into
mainfrom
fix/doc-gen-dataclass-properties

Conversation

@ccomb

@ccomb ccomb commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Why

The Python API-reference generator sent every dataclass through render_dataclass, which emits only the field table. Computed @property members were silently dropped, so nine data types had properties documented nowhere — most visibly ActivityDetail.allocation_percent and is_allocated, plus inputs / outputs / technosphere_inputs and the is_input / is_reference / coverage_pct / has_more / delta / page_size properties on the exchange, mapping, result and search types.

Final state

render_dataclass now reuses _public_members to append a Properties section after the field table, exactly as render_class already does for non-dataclass types. Only properties are added; construction plumbing (from_json) stays hidden. The README is regenerated in the same commit and the drift check (gen_api_md.py --check) passes.

ccomb added 2 commits July 6, 2026 19:00
The generator routed every dataclass to render_dataclass, which emitted
only the field table. Computed @Property members were dropped, so
ActivityDetail.allocation_percent, is_allocated, inputs, outputs and the
same on eight other data types were documented nowhere. Reuse
_public_members to append a Properties section, matching how render_class
already renders non-dataclass types. README regenerated in the same
commit so the drift check stays green.
render_class and render_dataclass both emitted the identical Properties
block byte-for-byte; a change to heading level or the no-docstring
placeholder would have to land twice. Extract _render_properties and call
it from both. Pure refactor — generated README is unchanged.
@ccomb ccomb merged commit 9acfbb9 into main Jul 6, 2026
10 checks passed
@ccomb ccomb deleted the fix/doc-gen-dataclass-properties branch July 6, 2026 17:11
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.

1 participant