I am building a json request schema at the moment. One of my constraints in the schema is that there value of firstLetter should ONLY contain 1 character, lowercase or uppercase. I tried the following (its a snippet of the schema):
"firstLetter": {
"id": "/properties/firstLetter",
"maxLength": 1,
"minLength": 1,
"pattern": "[a-z][A-Z]",
"type": "string"
}
but it doesn't seem to work. I would also like the regex to have the rule that there should only be 1 character
"^[a-zA-Z]$"or (if it is used in XSD Schema later)"[a-zA-Z]"[a-zA-Z]{1}it matches a single character.