steve-jansen / Swagger.Net

Library to document the ASP.NET Web API using the Swagger specification
0 stars 3 forks source link

Add support for documenting HTTP response codes #7

Open steve-jansen opened 11 years ago

steve-jansen commented 11 years ago

Swagger.Net does not have a clear way to document the various HTTP status codes that may be returned by an API.

The Swagger spec for errors codes is @ https://github.com/wordnik/swagger-core/wiki/Errors

Perhaps we could use a custom C# documentation tag for this? Something like:

    /// <response code="400">Bad request; parameter XYZ was invalid</response>
    /// <response code="401">Authentication credentials required for this API</response>
    /// <response code="403">Account not authorized to access this entity</response>
    /// <response code="404">The Pet entity was not found</response>
ibrahimsaid commented 11 years ago

https://github.com/ibrahimsaid/Swagger.Net/commit/5b54e8d99006672f7f500b8a76ad0d7699923b8e