Codit / practical-api-guidelines

Practical guidelines for building & designing APIs with .NET.
MIT License
16 stars 5 forks source link

Add guidance on operation summary & description #51

Closed tomkerkhove closed 5 years ago

tomkerkhove commented 5 years ago

Add guidance on operation summary & description so that they are clear and human readable.

The guidance should indicate:

Our current guidance provides a good example:

/// <summary>
///     Get Health
/// </summary>
/// <remarks>Gets the current health status of the API</remarks>
[HttpGet]
[Route("health")]
[SwaggerOperation("Health_Get")]
[SwaggerResponse(HttpStatusCode.OK, "API is up & running")]
[SwaggerResponse(HttpStatusCode.InternalServerError, "API is not available")]
public IHttpActionResult Get()
{
    return Ok();
}
MassimoC commented 5 years ago

We moved away from [SwaggerOperation("Health_Get")] attribute with the swashbuckle 4.

tomkerkhove commented 5 years ago

This is not related to operationId but more the summary and description.

Can do this after holiday.

tomkerkhove commented 5 years ago

Thanks for picking this up @MassimoC !