Currently, attemping 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 subclasses' inheritance tree, and treat the instance like a dict if that check passes.
`cargo tests` depends on an external, undocumented dependency: the JSON
Schema Test Suite.
This commit introduces instructions how to get test suite.
Without the test suite, `cargo test` fails with:
```
$ cargo test
error: custom attribute panicked
--> tests/test_suite.rs:5:1
|
5 | #[json_schema_test_suite("tests/suite", "draft4", {"optional_bignum_0_0", "optional_bignum_2_0"})]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: Tests directory not found: tests/suite/tests/draft4
```
`cargo test` fails with:
```
$ cargo test master ✭
Compiling json_schema_test_suite_proc_macro v0.3.0 (/home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro)
Compiling jsonschema v0.17.1 (/home/auke/projects/jsonschema-rs/jsonschema)
error[E0432]: unresolved import `syn::ItemFn`
--> /home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro/src/lib.rs:41:37
|
41 | use syn::{parse_macro_input, Ident, ItemFn};
| ^^^^^^ no `ItemFn` in the root
|
note: found an item that was configured out
--> /home/auke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:365:32
|
365 | ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMacro2, ItemMod,
| ^^^^^^
= note: the item is gated behind the `full` feature
For more information about this error, try `rustc --explain E0432`.
```
This commit fixes the issue by applying the suggestion of the compiler.
* build(python): Switch to maturin
* chore: Use `maturin>=0.14.11,<0.15`
Co-authored-by: messense <messense@icloud.com>
* build: Build only `sdist` in the `test-python-sdist` job
Co-authored-by: messense <messense@icloud.com>
* build: Set the proper output directory for `maturin`
* chore: Add more metadata
---------
Co-authored-by: messense <messense@icloud.com>
* Don't depend on a particular ahash rng
* chore: Use `getrandom/js` on `wasm32`
* ci: Run `cargo build` for `wasm32-unknown-unknown`
Co-authored-by: Dmitry Dygalo <dmitry@dygalo.dev>