Skip to content

Commit 445aa8f

Browse files
author
Joel Collins
committed
Updated TD to use new apispec methods
1 parent 3a82dba commit 445aa8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/labthings/td.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def view_to_thing_action_forms(rules: list, view: View):
3333
content_type = getattr(view, "content_type", "application/json")
3434

3535
# See if the action has an unusual 200 response
36-
responses = view.get_responses()
36+
responses = view.get_apispec().get("post", {}).get("responses", {})
3737
response_content_type = "application/json" # Default assumed content_type
3838

3939
for response_code in (200, 201):
@@ -77,7 +77,8 @@ def view_to_thing_property_forms(rules: list, view: View):
7777
content_type = getattr(view, "content_type", "application/json")
7878

7979
# See if the property has an unusual 201 response
80-
responses = view.get_responses()
80+
# TODO: Do this per-method
81+
responses = view.get_apispec().get("get", {}).get("responses", {})
8182
response_content_type = "application/json" # Default assumed content_type
8283

8384
for response_code in (201, 200):

0 commit comments

Comments
 (0)