Skip to content

Commit d467463

Browse files
author
Joel Collins
committed
Fixed automatic marshalling
1 parent f5e7e35 commit d467463

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/labthings/server/view/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def dispatch_request(self, *args, **kwargs):
9090
if meth is None and request.method == "HEAD":
9191
meth = getattr(self, "get", None)
9292

93+
# Marhal response if a response schema is defines
94+
if self.get_schema():
95+
meth = marshal_with(self.get_schema())(meth)
96+
9397
# Flask should ensure this is assersion never fails
9498
assert meth is not None, f"Unimplemented method {request.method!r}"
9599

@@ -193,10 +197,6 @@ def dispatch_request(self, *args, **kwargs):
193197
if request.method in ("POST", "PUT", "PATCH") and self.get_args():
194198
meth = use_args(self.get_args())(meth)
195199

196-
# Marhal response if a response schema is defines
197-
if self.get_schema():
198-
meth = marshal_with(self.get_schema())(meth)
199-
200200
# Generate basic response
201201
resp = self.represent_response(meth(*args, **kwargs))
202202

0 commit comments

Comments
 (0)