Skip to content

Commit 41ae4cc

Browse files
committed
_prepare_*_doc callbacks: make app, spec and method kw-only
1 parent 87fb1f4 commit 41ae4cc

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

flask_smorest/arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def wrapper(*f_args, **f_kwargs):
9191

9292
return decorator
9393

94-
def _prepare_arguments_doc(self, doc, doc_info, spec, **kwargs):
94+
def _prepare_arguments_doc(self, doc, doc_info, *, spec, **kwargs):
9595
# This callback should run first as it overrides existing parameters
9696
# in doc. Following callbacks should append to parameters list.
9797
operation = doc_info.get('arguments')

flask_smorest/etag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _set_etag_in_response(self, response, etag_schema):
247247
self._check_not_modified(new_etag)
248248
response.set_etag(new_etag)
249249

250-
def _prepare_etag_doc(self, doc, doc_info, app, method, **kwargs):
250+
def _prepare_etag_doc(self, doc, doc_info, *, app, method, **kwargs):
251251
if (
252252
doc_info.get('etag', False) and
253253
not app.config.get('ETAG_DISABLED', False)

flask_smorest/pagination.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def _document_pagination_metadata(self, spec, resp_doc):
285285
}
286286
}
287287

288-
def _prepare_pagination_doc(self, doc, doc_info, spec, **kwargs):
288+
def _prepare_pagination_doc(self, doc, doc_info, *, spec, **kwargs):
289289
operation = doc_info.get('pagination')
290290
if operation:
291291
doc.setdefault('parameters', []).append(operation['parameters'])

flask_smorest/response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _prepare_response_content(data):
157157
return data
158158

159159
@staticmethod
160-
def _prepare_response_doc(doc, doc_info, spec, **kwargs):
160+
def _prepare_response_doc(doc, doc_info, *, spec, **kwargs):
161161
operation = doc_info.get('response')
162162
if operation:
163163
for response in operation['responses'].values():

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def _prepare_response_doc(doc, doc_info, spec, **kwargs):
527527
)
528528
return super(
529529
WrapperBlueprint, WrapperBlueprint
530-
)._prepare_response_doc(doc, doc_info, spec, **kwargs)
530+
)._prepare_response_doc(doc, doc_info, spec=spec, **kwargs)
531531

532532
app.config['OPENAPI_VERSION'] = openapi_version
533533
api = Api(app)

0 commit comments

Comments
 (0)