Skip to content

Fix property descriptions#315

Merged
rwb27 merged 2 commits intomainfrom
fix-property-descriptions
Apr 28, 2026
Merged

Fix property descriptions#315
rwb27 merged 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

@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

@rwb27
Copy link
Copy Markdown
Collaborator Author

rwb27 commented Apr 22, 2026

The unpinned tests will be fixed by #316. I think it's fine to merge this as is, or merge 316 first.

@rwb27 rwb27 requested a review from bprobert97 April 22, 2026 09:44
@bprobert97
Copy link
Copy Markdown
Contributor

Happy with the changes here - lets wait to merge until #316 is in

rwb27 added 2 commits April 28, 2026 11:45
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.
@rwb27 rwb27 force-pushed the fix-property-descriptions branch from 7cc8e1e to b41c9c5 Compare April 28, 2026 10:46
@rwb27 rwb27 merged commit 5b1b011 into main Apr 28, 2026
15 checks passed
@rwb27 rwb27 deleted the fix-property-descriptions branch April 28, 2026 10:48
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

2 participants