Skip to content

Commit 31e27f6

Browse files
author
Joel Collins
committed
Show full Action schema in TD
1 parent 99655eb commit 31e27f6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/labthings/td.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .json.schemas import rule_to_params, rule_to_path, schema_to_json
66
from .utilities import ResourceURL, get_docstring, snake_to_camel
77
from .views import View
8+
from .schema import build_action_schema
89

910

1011
def view_to_thing_forms(rules: list, view: View, external: bool = True):
@@ -256,11 +257,8 @@ def view_to_thing_action(self, rules: list, view: View):
256257
if semtype:
257258
action_description["@type"] = semtype
258259

259-
# Look for a _schema in the Action classes API Spec
260-
action_output_schema = getattr(view, "schema", None)
261-
if action_output_schema:
262-
# Add schema to prop description
263-
action_description["output"] = schema_to_json(action_output_schema)
260+
# Add schema to prop description
261+
action_description["output"] = schema_to_json(build_action_schema(view.schema, view.args)())
264262

265263
return action_description
266264

0 commit comments

Comments
 (0)