Stranger6667 / jsonschema-rs

JSON Schema validation library
https://docs.rs/jsonschema
MIT License
511 stars 91 forks source link

feat(python): support validation of dict subclasses #466

Closed flbraun closed 6 months ago

flbraun commented 6 months ago

Disclaimer: This is a low-confidence PR as I have zero experience with Rust and the pyo3 library. Feel free to be hard on me :)

Currently, attempting to validate an instance of a dict subclass will raise a ValueError. This should not be happening, since the instance is still dict. Achieve compatibility by checking the instance's inheritance tree, and treat the instance like a dict if that check passes.

Resolves #427

Stranger6667 commented 6 months ago

Thank you! It looks good to me, will check it in more details during the weekend

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.48%. Comparing base (9771bc2) to head (968e3d2).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #466 +/- ## ======================================= Coverage 79.48% 79.48% ======================================= Files 56 56 Lines 5122 5122 ======================================= Hits 4071 4071 Misses 1051 1051 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Stranger6667 commented 6 months ago

Thank you so much! I'll issue a new release shortly