From d656ce24ec826d9467348e4c17bad91ffd355a29 Mon Sep 17 00:00:00 2001 From: jtc42 Date: Mon, 6 Jan 2020 17:47:53 +0000 Subject: [PATCH] Use update_spec --- .../common/flask_labthings/decorators.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/common/flask_labthings/decorators.py b/openflexure_microscope/common/flask_labthings/decorators.py index 12e94edb..a7748f04 100644 --- a/openflexure_microscope/common/flask_labthings/decorators.py +++ b/openflexure_microscope/common/flask_labthings/decorators.py @@ -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