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

Bravado fails to parse Security Definitions in OSS projects #446

Open
asmfreak opened this issue Dec 15, 2019 · 1 comment
Open

Bravado fails to parse Security Definitions in OSS projects #446

asmfreak opened this issue Dec 15, 2019 · 1 comment

Comments

@asmfreak
Copy link

I'm using two open source projects. Namely - Grocy and Gitea, which have their respective specifications hosted on demo instances.
I tried to user their API via open-cli, which in turn uses Bravado. I'm using Arch Linux:

Python 3.7.4 (default, Oct  4 2019, 06:57:26) 
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bravado
>>> bravado.version
'10.3.2'

I've got this output running the following command for Grocy:
open-cli --verbose https://en.demo.grocy.info/api/openapi/specification.
It is complaining about security parameters.

I've nearly the same output for Gitea (complaining about SecurityParameters also). I can't seem to get deom's spec for Gitea, so I'm attaching swagger file for it.

I want to understand - is this an issue with Bravado or respective projects I'm using (and their respective methods of api generation)?

@macisamuele
Copy link
Collaborator

macisamuele commented Dec 23, 2019

@asmfreak Thanks for reporting the issue.
Something that I would highlight is that the specifications in https://en.demo.grocy.info/api/openapi/specification are Open Api specifications, while bravado does support Swagger 2.0 .

Checking the output linked for Gitea I notice that the endpoint /users/{username}/tokens/{token} does have a token path parameter, but all the endpoints have the Token security definition.
This means that the endpoint has 2 token parameters (one in the path and one in the query).

This is not an issue on the Swagger specification but rather an issue/limitation within the bravado library as it does not support multiple parameters with the same name on different location.
Honestly I have no good idea to work this around ;(

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

2 participants