{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "My schema", "additionalProperties": false, "properties": { "Password": { "type": "string", "description": "Min 5 chars", "pattern": "^[a-z\\d]{5,}$" } }, "allOf": [ { "type": "object", "properties": { "Password": { "type": "string", "description": "1 char and 1 number", "pattern": "^([a-z]+\\d+|\\d+[a-z]+)\\w*$" } } } ]}
Overall I would suggest that this is probably a business rule that belongs outside of the schema?
"$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "title": "My schema", "additionalProperties": false, "properties": { "Password": { "type": "string", "description": "Min 5 chars", "pattern": "^[a-z\\d]{5,}$", "allOf": [ {