This repository was archived by the owner on Nov 13, 2021. It is now read-only.
This repository was archived by the owner on Nov 13, 2021. It is now read-only.
Produces attribute #103
Open
Description
You could include the type that is returned by this operation as well (typeof(CarDto[])).
Actually, my take would be to specify a Produces attribute that covers the response of a success-scenario, and specify a SwaggerResponse attribute for all other scenario's that could occur (the non-successfull statuscode that can be returned by the operation).
_Originally posted by @fgheysels
/// <summary>
/// Get all cars
/// </summary>
/// /// <param name="bodyType">Filter a specific body Type (optional)</param>
/// <remarks>Get all cars</remarks>
/// <returns>List of cars</returns>
[HttpGet(Name = Constants.RouteNames.v1.GetCars)]
[SwaggerResponse((int)HttpStatusCode.OK, "List of Cars")]
[SwaggerResponse((int)HttpStatusCode.InternalServerError, "API is not available")]