Skip to content

Commit 067eb3a

Browse files
committed
VALIDATE_RESPONSE --> FLASK_OPENAPI_VALIDATE_RESPONSE
1 parent ead5ae4 commit 067eb3a

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

examples/rest_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class NotFoundResponse(BaseModel):
3939
{"basic": basic}
4040
]
4141

42-
app.config["VALIDATE_RESPONSE"] = True
42+
app.config["FLASK_OPENAPI_VALIDATE_RESPONSE"] = True
4343

4444

4545
class BookPath(BaseModel):

flask_openapi3/do_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def _do_wrapper(
137137
# handle request
138138
response = func(**request_kwargs)
139139

140-
VALIDATE_RESPONSE = current_app.config.get("VALIDATE_RESPONSE", False)
141-
if VALIDATE_RESPONSE and responses:
140+
is_validate_response = current_app.config.get("FLASK_OPENAPI_VALIDATE_RESPONSE", False)
141+
if is_validate_response and responses:
142142
validate_response(response, responses)
143143

144144
return response

flask_openapi3/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def validate_response(resp: Any, responses: Dict[str, Type[BaseModel]]) -> None:
331331
"""Validate response"""
332332
if not current_app.config.get('FLASK_OPENAPI_DISABLE_WARNINGS', False):
333333
print("Warning: "
334-
"You are using `VALIDATE_RESPONSE=True`, "
334+
"You are using `FLASK_OPENAPI_VALIDATE_RESPONSE=True`, "
335335
"please do not use it in the production environment, "
336336
"because it will reduce the performance. "
337337
"Note, you can disable this warning with `Flask.config['FLASK_OPENAPI_DISABLE_WARNINGS'] = True`")

tests/test_fixed_externaldocs_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def app():
1111
_app = OpenAPI(__name__)
1212
_app.config["TESTING"] = True
13-
_app.config["VALIDATE_RESPONSE"] = True
13+
_app.config["FLASK_OPENAPI_VALIDATE_RESPONSE"] = True
1414
return _app
1515

1616

tests/test_restapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NotFoundResponse(BaseModel):
3131
security = [{"jwt": []}]
3232
book_tag = Tag(name='book', description='Book')
3333

34-
app.config["VALIDATE_RESPONSE"] = True
34+
app.config["FLASK_OPENAPI_VALIDATE_RESPONSE"] = True
3535

3636

3737
class BookQuery(BaseModel):

tests/test_restapi_with_doc_prefix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class NotFoundResponse(BaseModel):
3535
security = [{"jwt": []}]
3636
book_tag = Tag(name='book', description='Book')
3737

38-
app.config["VALIDATE_RESPONSE"] = True
38+
app.config["FLASK_OPENAPI_VALIDATE_RESPONSE"] = True
3939

4040

4141
class BookQuery(BaseModel):

tests/test_summary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
app = OpenAPI(__name__, info=info)
1313
app.config["TESTING"] = True
1414

15-
app.config["VALIDATE_RESPONSE"] = True
15+
app.config["FLASK_OPENAPI_VALIDATE_RESPONSE"] = True
1616

1717

1818
@pytest.fixture

0 commit comments

Comments
 (0)