-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Hi,
when I pass my Falcon resource to apispec I got this error:
loginResource = LoginResource(user_service)
deviceResource = DeviceResource()
api.add_route('/api/login', loginResource)
api.add_route('/api/devices', deviceResource)
# Create an APISpec
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from falcon_apispec import FalconPlugin
spec = APISpec(
title='Swagger Backend API',
version='1.0.0',
openapi_version='2.0',
plugins=[
FalconPlugin(api),
MarshmallowPlugin(),
],
)
# pass created resource into `path` for APISpec
spec.path(resource=deviceResource)
$ python -u test.py
Traceback (most recent call last):
File "test.py", line 214, in <module>
spec.path(resource=deviceResource)
File "C:\Work\Analytics\git\test\falcon-test\.venv\lib\site-packages\apispec\core.py", line 347, in path
path=path, operations=operations, parameters=parameters, **kwargs
File "C:\Work\Analytics\git\test\falcon-test\.venv\lib\site-packages\falcon_apispec\falcon_plugin.py", line 30, in path_helper
resource_uri_mapping = self._generate_resource_uri_mapping(self._app)
File "C:\Work\Analytics\git\test\falcon-test\.venv\lib\site-packages\falcon_apispec\falcon_plugin.py", line 23, in _generate_resource_uri_mapping
mapping[resource] = uri
TypeError: unhashable type: 'LoginResource'
which is not on the resource I have added...
Any idea ?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested