Skip to content

Commit b73a19d

Browse files
author
Joel Collins
committed
Added action inputs to thing description
1 parent 62729ea commit b73a19d

File tree

1 file changed

+10
-0
lines changed
  • labthings/server/spec

1 file changed

+10
-0
lines changed

labthings/server/spec/td.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ def view_to_thing_action(self, rules: list, view: View):
168168
"forms": self.view_to_thing_action_forms(rules, view),
169169
}
170170

171+
# Look for a _propertySchema in the Property classes API SPec
172+
action_schema = get_spec(view.post).get("_params")
173+
174+
if action_schema:
175+
# Ensure valid schema type
176+
action_schema = convert_schema(action_schema, self.apispec)
177+
178+
# Add schema to prop description
179+
action_description["input"] = schema_to_json(action_schema, self.apispec)
180+
171181
return action_description
172182

173183
def view_to_thing_action_forms(self, rules: list, view: View):

0 commit comments

Comments
 (0)