Open adrien-mg opened 3 years ago
I think jsonschema draft7 is fully unsupported, as of https://github.com/singer-io/singer-python/blob/66688d736fa699beeed63af91db2fdc1f8914bb1/setup.py#L14
and the jsonschema lib in version 2.6.0
only includes the Draft3Validator and Draft4Validator, no validators for draft 5, 6 or 7.
So if there is a specific reason for this jsonschema version, there might be other screws that need to be adjusted for a full draft 7 support.
But i started experimenting with singer-python yesterday, so i may be wrong.
From the JSON Schema draft 7.0 specification: array types can be used to validate tuple as such:
... and as such, the
items
property of a"type": "array"
property can be a pythonlist
.Using the above schema will raise an exception with
singer-python==5.1.5
when entering the@singer.utils.handle_top_exception(LOGGER)
decorator, although I also can see the error in themaster
version of the file: https://github.com/singer-io/singer-python/blob/master/singer/schema.py#L107 where theitems
variable is expected to be adict
(it can also be alist
, as stated above)I think I have a trivial fix which would be to add a
isinstance(items, dict)
check:and I'm happy to raise a PR for it. However I wanted to have the opinion of someone who's closer to the library to know if we even want to support Tuple Validation from the JSON Schema draft 7.0 specifications?
edit: made a bit more readable