title: How to implement single DeleteMapping for 2 parameters?
body: <p>I have a user table in my database with 2 fields <strong>id</strong> and <strong>name</strong>. I want to create an API to delete a user on the bases of id or name. Like this: </p>
  
  <pre><code>@DeleteMapping(path = "/{name}")
      public ResponseEntity&lt;Object&gt; clearUser(@PathVariable("name") String name){
          myService.deleteUser(name);
          return new ResponseEntity&lt;&gt;(HttpStatus.OK);
      }
  
  @DeleteMapping(path = "/{id}")
      public ResponseEntity&lt;Object&gt; clearUser(@PathVariable("id") int id){
          myService.deleteUser(id);
          return new ResponseEntity&lt;&gt;(HttpStatus.OK);
      }
  </code></pre>
  
  <p>But I want to do it under one <code>@DeleteMapping</code> and I have to do it using path param only not query param. A person can enter id or name to delete that user.</p>