diff --git a/src/labthings_fastapi/thing.py b/src/labthings_fastapi/thing.py index 71b3b3f0..0731940c 100644 --- a/src/labthings_fastapi/thing.py +++ b/src/labthings_fastapi/thing.py @@ -377,6 +377,7 @@ def thing_description( td = ThingDescription( title=getattr(self, "title", self.__class__.__name__), + description=self.__doc__, properties=properties, actions=actions, security="no_security", diff --git a/tests/test_server.py b/tests/test_server.py index d7a0773b..2337f057 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -54,6 +54,10 @@ def test_server_thing_descriptions(): for thing_name in thing_names: thing_description = thing_descriptions[thing_name] + + expected_description = "An example Thing with a few affordances." + assert thing_description["description"] == expected_description + for action_name in actions: action = thing_description["actions"][action_name] expected_href = thing_name + "/" + action_name