Skip to content

Commit

Permalink
Removed old doc_response decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jun 22, 2020
1 parent caa983b commit 959ef15
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/labthings/server/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,3 @@ def __call__(self, viewcls: View):


semtype = Semtype


class doc_response:
def __init__(self, code, description=None, mimetype=None, **kwargs):
self.code = code
self.description = description
self.kwargs = kwargs
self.mimetype = mimetype

self.response_dict = {
"responses": {
self.code: {
"description": self.description or HTTPStatus(self.code).phrase,
**self.kwargs,
}
}
}

if self.mimetype:
self.response_dict = merge(
self.response_dict,
{
"responses": {self.code: {"content": {self.mimetype: {}}}},
"_content_type": self.mimetype,
},
)

def __call__(self, f):
# Pass params to call function attribute for external access
update_spec(f, self.response_dict)
return f

0 comments on commit 959ef15

Please sign in to comment.