domaindrivendev / Swashbuckle.WebApi

Seamlessly adds a swagger to WebApi projects!
BSD 3-Clause "New" or "Revised" License
3.07k stars 678 forks source link

Api Key not available in security definition of a Document Filter #478

Open phillip-haydon opened 9 years ago

phillip-haydon commented 9 years ago

I think* this may be partially related to #398, but I'm unsure.

I setup the Api Key stuff to use all the default values to avoid the naming issues raised in that issue.

Requests made contains the api key in the query string, but it's not accessible anywhere in the swagger doc or other parameters on the IDocumentFilter.

I need access to the security information in order to filter the documents based on the API Key.

The API Key gets allocated different routes and we want to build the doco based on only the routes the user has access to.

Hope that makes sense. Is it a missing feature, or a bug, or am I doing something wrong :)

domaindrivendev commented 9 years ago

Filtering docs by Api key is not currently supported

phillip-haydon commented 9 years ago

@domaindrivendev I get that, which is why I wrote my own Document Filter, which works, great. The problem is I have to drop down to System.Web to get the query string value to do the filtering because you're not passing the query string through for me to access it.

I'm 100% happy to do the filtering myself, I've done it, works GREAT.

Swashbuckle doesn't grab the key, and pass it to any filter. :(