79389873

Date: 2025-01-27 06:19:53
Score: 3
Natty:
Report link

Not sure that this is the right way to do but I think it's ok as a workaround. You can implement a setter method where you can add the @PathVariable annotation. If you apply this approach it would make sens to have a dedicated request object.

public class UserDto {
  private Long id;
  private String name;
  
  public void setId(@PathVariable Long Id) {
    this.id = id;
  }

}

If there is a better solution I did not find please link it.

Reasons:
  • RegEx Blacklisted phrase (1): I did not find please
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • User mentioned (1): @PathVariable
  • Low reputation (1):
Posted by: dkegyes