samples/server/petstore/aspnetcore-mixed/src/IO.Swagger/Controllers/ParrotApi.cs
/// <summary>
/// Add a new parrow to the store
/// </summary>
/// <param name="body"></param>
/// <response code="405">Invalid input</response>
/// <response code="200">successful operation</response>
Add a new parrow to the store
Add a new parrow to the store
[HttpPost]
        [Route("/v3/parrot")]
        [Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
        [ValidateModelState]
        [SwaggerOperation("AddParrot")]
        [SwaggerResponse(statusCode: 200, type: typeof(InlineResponse2001), description: "successful operation")]
        public virtual IActionResult AddParrot([FromBody]Body9 body)
        { 
            string exampleJson = null;
            exampleJson = "\"\"";
                        var example = exampleJson != null
                        ? JsonConvert.DeserializeObject<InlineResponse2001>(exampleJson)
                        : default(InlineResponse2001);            
            return new ObjectResult(example);
        }
[ HttpPost ] [ Route ( " " ) ] [ Authorize ( AuthenticationSchemes = BearerAuthenticationHandler . SchemeName ) ] [ ValidateModelState ] [ SwaggerOperation ( " " ) ] [ SwaggerResponse ( statusCode : 200 , type : typeof ( InlineResponse2001 ) , description : " " ) ] public virtual IActionResult AddParrot ( [ FromBody ] Body9 body ) { string exampleJson = null ; exampleJson = " \" \" " ; var example = exampleJson != null ? JsonConvert . DeserializeObject < InlineResponse2001 > ( exampleJson ) : default ( InlineResponse2001 ) ; return new ObjectResult ( example ) ; }
Add a new parrow to the store
Add a new parrow to the store
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(InlineResponse2001)); //TODO: Change the data returned
Body9
[FromBody]
body
None
response
None
response
None