Skip to content

Commit 5fc69b3

Browse files
author
Joel Collins
committed
Fixed TD description defaulting to docstring
1 parent ef26292 commit 5fc69b3

File tree

1 file changed

+4
-2
lines changed
  • labthings/server/spec

1 file changed

+4
-2
lines changed

labthings/server/spec/td.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def view_to_thing_property(self, rules: list, view: View):
6666
prop_description = {
6767
"title": view.__name__,
6868
"description": (
69-
get_docstring(view)
69+
get_spec(view).get("description")
70+
or get_docstring(view)
7071
or (get_docstring(view.get) if hasattr(view, "get") else "")
7172
),
7273
"readOnly": not (
@@ -111,7 +112,8 @@ def view_to_thing_action(self, rules: list, view: View):
111112
# Basic description
112113
action_description = {
113114
"title": view.__name__,
114-
"description": get_docstring(view)
115+
"description": get_spec(view).get("description")
116+
or get_docstring(view)
115117
or (get_docstring(view.post) if hasattr(view, "post") else ""),
116118
# TODO: Make URLs absolute
117119
"links": [{"href": f"{url}"} for url in action_urls],

0 commit comments

Comments
 (0)