Hi, I'd like to validate regular expression strings, but it does not seem to give me an error on for example missing closing brackets etc.
tested with python 3.8.2, josnschema 3.2
from jsonschema import Draft7Validator
schema = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'$id': 'testid',
'title': 'regex test schema',
'$ref': '#/definitions/regexp',
'definitions': {
'regexp': {
'description': 'Regex search string',
'type': 'object',
'properties': {
'search': {
'type': 'string',
'format': 'regex',
},
},
'required': ['search'],
},
},
}
validator = Draft7Validator(schema)
print(validator.check_schema(schema))
print(validator.is_valid({'search': 'test'}))
# True
print(validator.is_valid({'search': '[0-9'}))
# True, but i expect False because of missing bracket.
Hi, I'd like to validate regular expression strings, but it does not seem to give me an error on for example missing closing brackets etc.
tested with python 3.8.2, josnschema 3.2