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

Connexion 2.0 release candidate: got an unexpected keyword argument 'resolver' #729

Closed
kenneho opened this issue Oct 22, 2018 · 5 comments
Closed
Milestone

Comments

@kenneho
Copy link

kenneho commented Oct 22, 2018

Description

I upgraded my Connexion project to use the Connexion 2.0 release candidate, and apparently the new version doesn't implement the resolver argument in the FlaskApp constructor.

This code work for Connexion < 2.0, but not for the Connexion 2.0 release candidate:

connexion_app = connexion.FlaskApp(__name__, specification_dir='swagger/', resolver=RestyResolver('apis'))

Expected behaviour

No syntax errors.

Actual behaviour

Traceback (most recent call last):
   File "./server/__init__.py", line 12, in create_app
      connexion_app = connexion.FlaskApp(__name__, specification_dir='swagger/', resolver=RestyResolver('apis'))
   File "/usr/local/lib/python3.7/site-packages/connexion/apps/flask_app.py", line 21, in __init__
       super(FlaskApp, self).__init__(import_name, FlaskApi, server=server, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'resolver'

Steps to reproduce

  1. pip install --pre connexion[swagger-ui]
  2. Run the code in the "description" section

Additional info:

Output of the commands:

  • python --version: 3.7.0
@hjacobs hjacobs added this to the 2.0 milestone Oct 22, 2018
@jmcs jmcs mentioned this issue Oct 26, 2018
@dtkav
Copy link
Collaborator

dtkav commented Oct 26, 2018

This functionality existed 'accidentally', as it was sneaking through old_style_options** pre connexion 2.0, which passed all kwargs through to the api_cls.

I think it makes sense to be able to define a default resolver for the whole App though, so I'm happy to add that functionality explicitly.

@dtkav
Copy link
Collaborator

dtkav commented Oct 27, 2018

Hey @kenneho - Please check out #735 when you get a chance.

@jmcs
Copy link
Contributor

jmcs commented Oct 29, 2018

@kenneho this should be fixed in 2.0.0rc5.

@kenneho
Copy link
Author

kenneho commented Nov 2, 2018

Sound great. I'm busy on another project at the moment, but will get back to you as soon I as get a chance to test the new rc.

@dtkav
Copy link
Collaborator

dtkav commented Nov 5, 2018

This is fixed in the 2.0 release.
Please reopen if you continue to have problems.

@dtkav dtkav closed this as completed Nov 5, 2018
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

4 participants