You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have an error in the module that handles an endpoint, Connexion bombs while importing the API, so you never see what the real error is. You have to drop into python and import the endpoint-handling module to see the real error. This makes debugging somewhat painful.
Expected bahaviour
If I drop into python, I see the real error in my module (in this case, a missing import):
Python 3.5.0 (default, Sep 23 2015, 04:41:38)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from query_service.controllers import controller
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tommy/Development/query_service/py/query_service/controllers/controller.py", line 1, in <module>
import psycopg2
ImportError: No module named 'psycopg2'
Actual behaviour
Failed to add operation for GET /tenant/{vmname}
Traceback (most recent call last):
File "py/query_service/rest_service.py", line 7, in <module>
app.add_api('swagger.yaml', arguments={'title': 'Query Service'})
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/app.py", line 146, in add_api
debug=self.debug)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/api.py", line 132, in __init__
self.add_paths()
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/api.py", line 203, in add_paths
six.reraise(*sys.exc_info())
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/six.py", line 686, in reraise
raise value
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/api.py", line 192, in add_paths
self.add_operation(method, path, endpoint, path_parameters)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/api.py", line 165, in add_operation
resolver=self.resolver)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/operation.py", line 172, in __init__
resolution = resolver.resolve(self)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/resolver.py", line 51, in resolve
return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/resolver.py", line 72, in resolve_function_from_operation_id
return self.function_resolver(operation_id)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/utils.py", line 109, in get_function_from_name
function = deep_getattr(module, attr_path)
File "/Users/tommy/.virtualenvs/aai/lib/python3.5/site-packages/connexion/utils.py", line 91, in deep_getattr
return functools.reduce(getattr, attr.split('.'), obj)
AttributeError: module 'controllers' has no attribute 'controller'
Steps to reproduce
Have an import error in the module that handles an endpoint. In this case my swagger.yaml had the line: operationId: "controllers.controller.tenant_vmname_get", but " controllers.controller had an import error.
Additional info:
Output of the commands:
python --version
Python 3.5.0
pip show connexion | grep "^Version\:"
Version: 1.0.91
The text was updated successfully, but these errors were encountered:
Description
If you have an error in the module that handles an endpoint, Connexion bombs while importing the API, so you never see what the real error is. You have to drop into python and import the endpoint-handling module to see the real error. This makes debugging somewhat painful.
Expected bahaviour
If I drop into python, I see the real error in my module (in this case, a missing import):
Actual behaviour
Steps to reproduce
Have an import error in the module that handles an endpoint. In this case my
swagger.yaml
had the line:operationId: "controllers.controller.tenant_vmname_get"
, but "controllers.controller
had an import error.Additional info:
Output of the commands:
python --version
Python 3.5.0
pip show connexion | grep "^Version\:"
Version: 1.0.91
The text was updated successfully, but these errors were encountered: