Use update_spec

This commit is contained in:
jtc42 2020-01-06 17:47:53 +00:00
parent 4a6e672630
commit d656ce24ec

View file

@ -95,7 +95,12 @@ class doc_response(object):
def __call__(self, f):
# Pass params to call function attribute for external access
f.__apispec__ = f.__dict__.get("__apispec__", {})
d = {"responses": {self.code: {"description": self.description, **self.kwargs}}}
rupdate(f.__apispec__, d)
update_spec(
f,
{
"responses": {
self.code: {"description": self.description, **self.kwargs}
}
},
)
return f