Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this work with falcon 3.0.0? #31

Open
dkbarn opened this issue Apr 6, 2021 · 3 comments
Open

Does this work with falcon 3.0.0? #31

dkbarn opened this issue Apr 6, 2021 · 3 comments

Comments

@dkbarn
Copy link

dkbarn commented Apr 6, 2021

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
@fr3dch3n
Copy link

I run into the same error. Did you find a way to fix this?

@dkbarn
Copy link
Author

dkbarn commented Apr 26, 2021

No, I don't think this package is compatible with falcon 3, so for now we are just declaring our dependency as "falcon<3" since we aren't using any new features from v3 yet. But hopefully this package will be made compatible soon, so we can upgrade.

@CrazySky2121
Copy link

+1 not working with falcon 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants