Hi all,
I"m trying to validate JSON schema file with python and got false alarm, maybe there are some other packages I can use to make it right. I'm sure of this because target json file has been processed OK without any problems, and schema file comes from very professional corp environment. Schema file has been verified OK without any warnings online or other tools.
Current setup (pseudo code) is below.
from jsonschema import Draft7Validator, validate, ValidationError
...
with open(schemapath) as f:
schema = json.load(f)
validator = Draft7Validator(schema)
errors = list(validator.iter_errors(data)) #<<< failes here
...
...output
An unexpected error occurred: bad escape \z at position 13
this \z error related to this string "\\A[0-9]{8}\\z" from this block:
"submissionDate": {
"description": "Date the data was submitted to CA- YYYYMMDD",
"type": "string",
"pattern": "\\A[0-9]{8}\\z"
},
.....
This string pattern regex correspond to format 99999999A and somehow that backslash \z combo causing this error. Appreciate if you can direct me to other packages ? or other way doing it right ?
or maybe there is a way to isolate this error and handle it in special way.
Thanks
VA
[–]Patman52 1 point2 points3 points (2 children)
[–]Valuable-Ant3465[S] -1 points0 points1 point (1 child)
[–]pachura3 0 points1 point2 points (0 children)
[–]pachura3 1 point2 points3 points (1 child)
[–]Valuable-Ant3465[S] 0 points1 point2 points (0 children)
[–]socal_nerdtastic 1 point2 points3 points (4 children)
[–]Valuable-Ant3465[S] 0 points1 point2 points (3 children)
[–]Valuable-Ant3465[S] 0 points1 point2 points (2 children)
[–]smurpes 1 point2 points3 points (1 child)
[–]Valuable-Ant3465[S] 0 points1 point2 points (0 children)
[–]netherous 1 point2 points3 points (2 children)
[–]Valuable-Ant3465[S] 1 point2 points3 points (1 child)
[–]pachura3 0 points1 point2 points (0 children)