I was trying to validate a particular field in an JSON request file.
the field should be between 1-160 characters in length and should NOT allow any special characters .
I tried the below . But it does not work . Any inputs will be deeply appreciated.
"SMSContent": {
"id": "http://jsonschema.net/Request/Data/SMSContent",
"type": "string",
"pattern": "[a-zA-Z]{1,160}"
}
{1,160}since you are usingminLengthandmaxLength? Not all regex implementation support the {n,m} notation. That could be the problem you are running into.