Use update_spec
This commit is contained in:
parent
4a6e672630
commit
d656ce24ec
1 changed files with 8 additions and 3 deletions
|
|
@ -95,7 +95,12 @@ class doc_response(object):
|
||||||
|
|
||||||
def __call__(self, f):
|
def __call__(self, f):
|
||||||
# Pass params to call function attribute for external access
|
# Pass params to call function attribute for external access
|
||||||
f.__apispec__ = f.__dict__.get("__apispec__", {})
|
update_spec(
|
||||||
d = {"responses": {self.code: {"description": self.description, **self.kwargs}}}
|
f,
|
||||||
rupdate(f.__apispec__, d)
|
{
|
||||||
|
"responses": {
|
||||||
|
self.code: {"description": self.description, **self.kwargs}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
return f
|
return f
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue