-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSONSchema Draft 7 array Tuple Validation unsupported? Schema.from_dict() raise exception #145
Comments
Schema.from_dict()
not respecting array items tuple validation Draft 7 specification…over file. Removed Tuple Validation from {story,user}_custom_field_values.json schemas as it is currently not supported by the singer-python library, and it will fail when entering the main decorator: @singer.utils.handle_top_exception. Issue was raised at: singer-io/singer-python#145. Also fixed a tiny typo in custom_field_sets.json schema (objects -> object)
I think jsonschema draft7 is fully unsupported, as of Line 14 in 66688d7
and the jsonschema lib in version 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. |
Is this issue not solved yet? I mean |
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
The text was updated successfully, but these errors were encountered: