"jhipsterVersion": "6.10.1"
/**
* {@code DELETE /users/:login} : delete the "login" User.
*
* @param login the login of the user to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<Void> deleteUser(@PathVariable String login) {
log.debug("REST request to delete User: {}", login);
userService.deleteUser(login);
return ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName, "userManagement.deleted", login)).build();
}

@Michael2008S
The bug comes from Constants.java
public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$";
Curly braces generate a bug in
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
and
@DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
because curly braces are specials characters in mapping definition. Even if I escape curly braces, it doesn't work.
A solution will be to remove curly braces in LOGIN_REGEX and in the front.
What do you think @pascalgrimaud & @mshima ?
I did not know that you could use regex in path variable declaration in URI templates but docs confirms it https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping-uri-templates
However, I would think that it's simpler to not mix up things and it seems that Springfox has an issue with it as you discovered it :)
So, I would suggest that you report it to Springfox project.
For JHipster, I would only recommend to use validation annotations on the method parameter as below, this has the benefit of using LOGIN_REGEX in expected context without interfering with Springfox
~java
@DeleteMapping("/users/{login}")
public ResponseEntity
~
If @gmarziou solution works, it seems to be the right approach.
I think old generated validation is broken ...in:^(?>... (line start).
Ok then, it looks like @gmarziou's solution is the good one. We should apply this change in our templates
PR done https://github.com/jhipster/generator-jhipster/pull/12276 with @gmarziou's solution
Most helpful comment
I did not know that you could use regex in path variable declaration in URI templates but docs confirms it https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping-uri-templates
However, I would think that it's simpler to not mix up things and it seems that Springfox has an issue with it as you discovered it :)
So, I would suggest that you report it to Springfox project.
For JHipster, I would only recommend to use validation annotations on the method parameter as below, this has the benefit of using
LOGIN_REGEXin expected context without interfering with Springfox~java deleteUser(@PathVariable("login") @Pattern(Constants.LOGIN_REGEX) String login) { @DeleteMapping("/users/{login}")
public ResponseEntity
~