Skip to content

Check [Produces(type)] #64

@JohanLarsson

Description

@JohanLarsson

Before:

namespace AspBox
{
    using Microsoft.AspNetCore.Mvc;

    [Route("api/values")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        [Produces(typeof(string))]
        [HttpPost]
        public IActionResult Create([FromBody]Foo foo)
        {
            return CreatedAtAction("Get", new { id = foo.Id }, foo);
        }
    }
}

After:

namespace AspBox
{
    using Microsoft.AspNetCore.Mvc;

    [Route("api/values")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        [Produces(typeof(Foo))]
        [HttpPost]
        public IActionResult Create([FromBody]Foo foo)
        {
            return CreatedAtAction("Get", new { id = foo.Id }, foo);
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions