Skip to content

Swagger Schema 2.0 ApiKey #215

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

Closed
lidonis opened this issue Nov 22, 2014 · 8 comments
Closed

Swagger Schema 2.0 ApiKey #215

lidonis opened this issue Nov 22, 2014 · 8 comments

Comments

@lidonis
Copy link

lidonis commented Nov 22, 2014

I just read schema.json for swagger v2.0 after trying swagger editor.

I have a problem with apiKeySecurity because there is only "header" and "query" but no "path" param.

I need to put my apiKey as path param. How can i do that ?

@webron
Copy link
Member

webron commented Nov 22, 2014

Swagger 2.0 doesn't support an api key security as a path parameter. I don't think we ever encountered such a use case.

The only thing you can do is use a regular path parameter to define it, and it won't be part of the security schemes.

@lidonis
Copy link
Author

lidonis commented Nov 22, 2014

OK, thank you for your response. I'll use a regular path parameter.

I hope it will be added in the next version.

@lidonis lidonis closed this as completed Nov 22, 2014
@webron
Copy link
Member

webron commented Nov 24, 2014

@lidonis - have you seen this kinda of REST design anywhere else?

The reason I ask is because this way of structuring your URL seems un-REST-ful. The path itself is normally used as a resource locator (hence, URL), and the API Key shouldn't really be part of the resource locator.

I'm not saying it's wrong - there isn't really right or wrong here - I'm just surprised at the design. So, I wonder if it is based on some common practice of which I'm not aware.

@lidonis
Copy link
Author

lidonis commented Nov 24, 2014

Yeah, the API is quite "un-REST-ful". Thas not the only problem in the design but i have too deal with it.

I have seen this design at https://trakt.tv/api-docs.

@webron
Copy link
Member

webron commented Nov 24, 2014

Thanks for the reference!

@webron
Copy link
Member

webron commented Mar 27, 2016

Parent: #585.

@LasneF
Copy link
Member

LasneF commented Jan 10, 2024

@webron, @MikeRalphson

looks very corner case, not seeing any API Management tooling doing like that

should the issue be closed to narrow down the feature list ? as not retains for OAS 3.0 neither 3.1 ?

@handrews
Copy link
Member

2.0 is long past the point of patch releases, and the use case seems too small to track given the lack of engagement in the past 8 years. If there is a clear use case with enough support, this is probably best considered under Moonwalk and re-opened there.

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