Spring is automatically converting Decimal values to Integers while using POST Method in REST APIs. While, I want to throw a custom exception if user enters Decimal values. Is there any easy way to do this.
Eg:: If user enters age = 4.3 , then Spring is converting it to 4.
if (age instanceof Integer) //dowork(); else //throw custom exception
consider age as type Object and then use the above code to do your testing.