Swagger openapi restAPI delete operation

Viewed 386

I am currently working on a swagger openapi.yml and I am having trouble with the DELETE operation. So I have 2 applications where one of the applications is using the openapi.yml file in the generated-sources to call the DELETE endpoint. This is how the DELETE operation looks in the openapi.yml file. Corresponding to this DELETE operation, this is how the endpoint looks in my controller. But for some reason, the API call never goes into this endpoint. I have a GET operation similar to the DELETE operation and that works just fine so I was wondering if I am messing something up in the parameters or have a syntax error. Any help would be appreciated. Thank you!

'api/deleteById/{id}':
  delete:
    tags:
      - Delete Tag
    summary: 'Delete data by id'
    parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
        description: Numeric id to delete json object
    responses:
      '200':
        description: OK
      '400':
        description: BAD REQUEST
      '404':
        description: NOT FOUND
@DeleteMapping("api/deleteById/{id})
public void deleteById(@PathVariable Integer id){
  jsonService.deleteById(id);
}
0 Answers
Related