lundi 17 juin 2019

Failed to load API definition.( Error Fetch errorundefined /swagger/v1/swagger.json)

Swagger is working fine for add and delete operation but when i have add one more mathods as UpdateProperty in propertyContoller than i got error "Failed to load API definition".

enter image description hereI have share ss as well.

Where i did the mistake ?

[HttpPut]
        [Route("addproperties")]
        [ProducesResponseType((int)HttpStatusCode.OK)]
        [ProducesResponseType((int)HttpStatusCode.BadRequest)]
        public async Task<IActionResult> AddProperty([FromBody] AddPropertyCommand command)
        {
              //commanted code for add operation
        }

[HttpPost]
        [Route("updateproperties")]
        [ProducesResponseType((int)HttpStatusCode.OK)]
        [ProducesResponseType((int)HttpStatusCode.BadRequest)]
        public async Task<IActionResult> ([FromBody] UpdatePropertyCommand updatePropertyCommand, [FromHeader(Name = "x-requestid")] Guid id)
        {
              //commanted code for update operation
        }

 [HttpDelete]
        [Route("properties/{id}")]
        public async Task<IActionResult> DeleteProperyAsync(DeletePropertyCommand command)
        {
     //commanted code for deleteoperation
        }

Aucun commentaire:

Enregistrer un commentaire