Skip to content

Commit f8d20bb

Browse files
authored
Fix no attribute 'validate_response' (#251)
1 parent 1c5542d commit f8d20bb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

flask_openapi3/view.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ def register(
204204
for rule, (cls, methods) in self.views.items():
205205
for method in methods:
206206
func = getattr(cls, method.lower())
207-
if func.validate_response is not None:
208-
_validate_response = func.validate_response
209-
else:
210-
_validate_response = self.validate_response
207+
_validate_response = getattr(func, "validate_response", None) or self.validate_response
211208
header, cookie, path, query, form, body, raw = parse_parameters(func, doc_ui=False)
212209
view_func = app.create_view_func(
213210
func,

0 commit comments

Comments
 (0)