Forum Discussion

thomass's avatar
5 years ago

python flask server error when running


I've got problem after exporting python flask server, when I want to run it locally.
I've tried with the docker way, and the pip install way specified in README file.


Each time I run server, I've got following error :

root@b92fdc161a26:/opt# python3 -m swagger_server
Failed to add operation for POST /xxx/yyy/1.0.0/login
Traceback (most recent call last):
File "/usr/lib/python3.7/", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/", line 85, in _run_code
exec(code, run_globals)
File "/opt/swagger_server/", line 16, in <module>
File "/opt/swagger_server/", line 11, in main
app.add_api('swagger.yaml', arguments={'title': 'Neteven Retailer API'}, pythonic_params=True)
File "/usr/local/lib/python3.7/dist-packages/connexion/apps/", line 54, in add_api
api = super(FlaskApp, self).add_api(specification, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/connexion/apps/", line 155, in add_api
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 108, in __init__
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 216, in add_paths
self._handle_add_operation_error(path, method, sys.exc_info())
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 227, in _handle_add_operation_error
File "/usr/lib/python3/dist-packages/", line 693, in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 206, in add_paths
self.add_operation(path, method)
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 172, in add_operation
self._add_operation_internal(method, path, operation)
File "/usr/local/lib/python3.7/dist-packages/connexion/apis/", line 85, in _add_operation_internal
function = operation.function
File "/usr/local/lib/python3.7/dist-packages/connexion/operations/", line 371, in function
security_decorator = self.security_decorator
File "/usr/local/lib/python3.7/dist-packages/connexion/operations/", line 90, in security_decorator
security_scheme = self.security_schemes[scheme_name]
KeyError: 'accessCode'

Could you please tell me what to do to make it run ?

No RepliesBe the first to reply