I am working with a JSON body that includes various types of values such as numbers, strings, Booleans, and arrays.
{
"name": "vivek",
"age": 12,
"employed": true,
"cars": ["maruti", "wagonR"]
}
When it comes to the age value, only {"age":12}
is considered acceptable. If any other format is entered, the system should prompt for the age to be re-entered (e.g. {"age":"12"}
). What are some possible ways to validate this requirement?