-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I recently upgraded from falcon 2.0.0 to 3.0.0 and started getting a bunch of errors thrown from the apispec library.
For comparison, without touching my code, this environment works without issue:
falcon 2.0.0
falcon-apispec 0.4.0
apispec 4.4.0
...and this environment produces the errors shown below:
falcon 3.0.0
falcon-apispec 0.4.0
apispec 4.4.0
src/my_service/app.py:246: in create_app
spec.path(resource=falcon_resource)
.tox/py38/lib/python3.8/site-packages/apispec/core.py:304: in path
self.clean_operations(operations)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <apispec.core.APISpec object at 0x7f444c404ca0>
operations = OrderedDict([('get', {'summary': 'Get whether the service is alive or not.', 'parameters': [], 'responses': {200: {}}}...', {}), ('report', {}), ('uncheckin', {}), ('unlock', {}), ('update', {}), ('version-control', {}), ('websocket', {})])
def clean_operations(self, operations):
"""Ensure that all parameters with "in" equal to "path" are also required
as required by the OpenAPI specification, as well as normalizing any
references to global parameters. Also checks for invalid HTTP methods.
See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject.
:param dict operations: Dict mapping status codes to operations
"""
operation_names = set(operations)
valid_methods = set(VALID_METHODS[self.openapi_version.major])
invalid = {
key for key in operation_names - valid_methods if not key.startswith("x-")
}
if invalid:
> raise APISpecError(
"One or more HTTP methods are invalid: {}".format(", ".join(invalid))
)
E apispec.exceptions.APISpecError: One or more HTTP methods are invalid: lock, websocket, mkcol, proppatch, move, uncheckin, unlock, checkin, propfind, version-control, checkout, connect, copy, report, update
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels