Skip to content
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

[python] ValueError: Unsupported type: 'collections.OrderedDict' #427

Closed
rijenkii opened this issue Apr 26, 2023 · 2 comments · Fixed by #466
Closed

[python] ValueError: Unsupported type: 'collections.OrderedDict' #427

rijenkii opened this issue Apr 26, 2023 · 2 comments · Fixed by #466

Comments

@rijenkii
Copy link

Even though OrderedDict is a subclass of dict, passing it to jsonschema_rs functions raises an exception:

>>> import collections
>>> import jsonschema_rs
>>> jsonschema_rs.is_valid({"type": "object"}, collections.OrderedDict({}))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unsupported type: 'collections.OrderedDict'

How hard would it be to support subclasses of dict?

@flbraun
Copy link

flbraun commented Mar 21, 2024

Hi @rijenkii !
I'm also encountering this issue and would like to see jsonschema_rs handle this. I absolutely love the lib's performance, but this issue unfortunately is a show stopper for adoption in my projects.
I opened a PR to add compatibility for dict subclasses.

@Stranger6667
Copy link
Owner

Released in 0.17.3 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants