miketrionfo/Swagger.Net — pull request #21 by tozevv (2013-04-16 14:24:30+00:00)
Title: Security and Routing "improvements"

Hi!

Nice work with Swagger.Net. We are using in a project and I'am quite happy with it.
We have, however, some problems that I needed to address:

1. Control over security

We need to control if the caller could see the description of methods he is not entitled to call. This could be controlled by anything (specifically we are using diferent api_keys). I suggest adding this feature by using a custom ISwaggerAuthorization attribute on the operations. This way callers can implement whatever custom authentication solution they are using at the API level.

2. Lowercase routes

Lowercase routing native support is missing in Web.api. We overcome this issue on our side allowing swagger to generate nicer lowercase routes

3. Route query parameters

Current swagger.net considers all route parameters are path parameters. Unfortunately query parameters can get into into paths like /{id}?filter={filter}. This gets really messy in swagger UI putting "?" in the middle of request. What we did was to remove everything after "?" in the path.