Skip to content

Fix property descriptions#315

Open
rwb27 wants to merge 2 commits intomainfrom
fix-property-descriptions
Open

Fix property descriptions#315
rwb27 wants to merge 2 commits intomainfrom
fix-property-descriptions

Conversation

@rwb27
Copy link
Copy Markdown
Collaborator

@rwb27 rwb27 commented Apr 16, 2026

The descriptions and titles for functional properties were missing from the Thing Description and the OpenAPI docs. This was due to the getter's docstring being ignored.

I have added a unit test to check for this, and added code to FunctionalProperty.__init__ to copy over the getter's docstring as is done in ActionDescriptor.

Closes #314

rwb27 added 2 commits April 16, 2026 22:31
This must have been broken when I moved documentation code into
`BaseDescriptor` which handles attribute docstrings but isn't aware
of getter/setter functions.

The required change was to copy over `__doc__` if it's defined on the function, as was already done for actions.

I had to ignore trailing whitespace to get the test passing, I think that's fine.
@barecheck
Copy link
Copy Markdown

barecheck bot commented Apr 16, 2026

Barecheck - Code coverage report

Total: 96.64%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/properties.py463, 481, 561, 863, 867, 902-905, 977, 1000, 1399

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.

FunctionalProperty has no description in OpenAPI/TD

1 participant