Making a parameter required

9 views
Skip to first unread message

Sam Mallabone

unread,
Jul 20, 2017, 3:07:56 PM7/20/17
to Swagger
I want to add an attribute to make my swagger know that the two parameters for my POST method are required. They are retrieved from the URI from the query string. This is my method declaration for the POST method.

        [HttpPost]
        [ProducesResponseType(typeof(Users), 201)]
        [ProducesResponseType(422)]
        public IActionResult Post([FromQuery] string name, [FromQuery] string email)
        {


Thanks
Reply all
Reply to author
Forward
0 new messages