From db8a71b79f583a767d55be37ec1aa39ceecc4838 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Mon, 30 Mar 2026 11:27:01 +0100 Subject: [PATCH] Include the "description" of the Thing in the thing_description --- src/labthings_fastapi/thing.py | 1 + tests/test_server.py | 4 ++++ 2 files changed, 5 insertions(+) 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