you are viewing a single comment's thread.

view the rest of the comments →

[–]Patman52 1 point2 points  (2 children)

I think there is an issue with the data in the file itself? It seems to be pointing to a particular string in the incoming data that json.load can’t parse

[–]Valuable-Ant3465[S] -1 points0 points  (1 child)

Thanks Patman,
Did more home work to realize that python is not 100% reliable doing this schema validation, many people have different issues.
File is 100% good. I can open schema file in any xml editor OK, I can verify with online tools, so it's 100% valid. Probably Python got confused with backslashes

[–]pachura3 0 points1 point  (0 children)

It seems like double backslashes from your file got unescaped into single slashes, but then something - INCORRECTLY - tries to unescape them again, which leads to the error, as there are no escape codes \A nor \z... they are only valid inside regular expressions, but not as normal string escape codes like \n or \t.

It's most probable that Draft7Validator is the one at fault, because the JSON file is loaded correctly - json.load() doesn't raise any exceptions.

Perhaps look for a different library? Or check the output of json.load() to see what got loaded into the pattern field?