问题遇到的现象和发生背景
请问如何让 MethodArgumentTypeMismatchException 报错会指出一个具体的字段呢?
2022-09-16 17:36:49.818 WARN 16008 --- [ XNIO-2 task-1] o.z.problem.spring.common.AdviceTraits : Bad Request: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "undefined"
[org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "undefined"]
2022-09-16 17:35:39.558 ERROR 16008 --- [hrsystem-task-1]
如何让MethodArgumentTypeMismatchException报错会指出一个具体的字段呢,比如entity有个 number字段,如果是他是undefined,他会报错是 number为undefined,而不是仅仅是说是个int类型的字段