Skip to content
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
Open
@MassimoC

Description

@MassimoC

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")]
   

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions