问题
When I make a json request to a spring boot backend, Jackson is automatically converting numbers to strings. Is there a way to prevent that?
For example:
JSON
{
"numberAsString": 123
}
JAVA
private String numberAsString;
after binding json value to the java field numberAsString
is equal to "123"
. i need to prevent this automatic conversion and need to throw some kind of a exception when this happens.
来源:https://stackoverflow.com/questions/56678885/disable-the-number-to-string-automatic-conversion-in-jackson