samples/server/petstore/aspnetcore-mixed/src/IO.Swagger/Controllers/StoreApi.cs
/// <summary>
/// Place an order for a pet
/// </summary>
/// <param name="body">order placed for purchasing the pet</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid Order</response>
Place an order for a pet
Place an order for a pet
[HttpPost]
        [Route("/v3/store/order")]
        [ValidateModelState]
        [SwaggerOperation("PlaceOrder")]
        [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")]
        public virtual IActionResult PlaceOrder([FromBody]Order body)
        { 
            string exampleJson = null;
            exampleJson = "{\n  \"petId\" : 6,\n  \"quantity\" : 1,\n  \"id\" : 0,\n  \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n  \"complete\" : false,\n  \"status\" : \"placed\"\n}";
                        var example = exampleJson != null
                        ? JsonConvert.DeserializeObject<Order>(exampleJson)
                        : default(Order);            
            return new ObjectResult(example);
        }
[ HttpPost ] [ Route ( " " ) ] [ ValidateModelState ] [ SwaggerOperation ( " " ) ] [ SwaggerResponse ( statusCode : 200 , type : typeof ( Order ) , description : " " ) ] public virtual IActionResult PlaceOrder ( [ FromBody ] Order body ) { string exampleJson = null ; exampleJson = " \n \" \" \n \" \" \n \" \" \n \" \" \" \" \n \" \" \n \" \" \" \" \n " ; var example = exampleJson != null ? JsonConvert . DeserializeObject < Order > ( exampleJson ) : default ( Order ) ; return new ObjectResult ( example ) ; }
Place an order for a pet
Place an order for a pet
//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(Order)); //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); //TODO: Change the data returned
Order
[FromBody]
body
order placed for purchasing the pet
order placed for purchasing the pet
response
None
response
None