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

Error: securityDefinitions #29

Open
sanjusci opened this issue Aug 24, 2018 · 0 comments
Open

Error: securityDefinitions #29

sanjusci opened this issue Aug 24, 2018 · 0 comments

Comments

@sanjusci
Copy link

api = Api(
    app,
    errors=http_errors(),
    api_version='1.0.0',
    api_spec_url='/api/swagger',
    title='T',
    description='Api specifications T',
    contact={
        "name": "Sanju Sci",
        "email": "sanju.sci9@gmail.com",
        "url": "http://sanjusci.com"
      },
    host=SWAGGER_CONFIG.get('HOST', ""),
    schemes=[
        "http",
        "https",
    ],
    securityDefinitions={
        "Bearer": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    },
    consumes=[
        "application/json",
        'multipart/form-data'
    ],
    produces=[
        "application/json"
    ]
)
Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1683, in <module>
    main()
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1677, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1087, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/sanju.sci/Documents/flask/app.py", line 54, in <module>
    "application/json"
  File "/Users/sanju.sci//Documents/lask/.env/lib/python3.6/site-packages/flask_restful_swagger_2/__init__.py", line 83, in __init__
    super(Api, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'securityDefinitions'

Error: when I define "securityDefinitions" in the configuration for Authorization.

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

1 participant