I have this controller with a get method that recive 3 paramaters as java.lang.Integer
@GetMapping(path = Constantes.CONSULTAR_NODO_SUCESOR)
public ConsultarNodoSucesorResponse consultarNodoSucesor(@RequestHeader HttpHeaders headerRequest,
@RequestParam(required = false) Integer idArbol,
@RequestParam(required = false) Integer nivelFormulario,
@RequestParam(required = false) Integer idSucesor,
@RequestParam(required = false) String rutaRelacion,
@RequestParam(required = false) String tipoRelacion,
HttpServletResponse headerResponse) {
ConsultarNodoSucesorRequest request = new ConsultarNodoSucesorRequest(idArbol, nivelFormulario, idSucesor,
rutaRelacion, tipoRelacion);
return service.consultarNodoSucesor(headerRequest, request, headerResponse);
}
When cosuming the server is returning code 400 for bad request, full error below
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: \"4111111111\
I'm sending in the paramter idArbol the value 4111111111 but It wont work, in the other hand when I send in that same paramters values like 1044444444 It works fine.
Why is this a thing? what is the max value of a Integer