-
Notifications
You must be signed in to change notification settings - Fork 274
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
Fix Params deserialization on serde_json>=1.0.8 #222
Conversation
Due to serde-rs/json#389, serde_json no longer calls `deserialize_any` in `deserialize_identifer` (and all other default implemented methods). This causes `Params` to fail to deserialize maps and sequences since it has hinted that it expects an identifier. This implements `deserialize` correctly, saying that it accepts any type.
Hi @Marwes! Thanks a bunch. Would you mind adding a test to cover current incorrect behaviour? |
It should be covered by https://github.com/Marwes/jsonrpc/blob/9d6fcf1aa9d4f3b2eb174f83b4785284501976f8/core/src/types/params.rs#L98-L110 . It is just that the last build of jsonrpc-core was with serde_json<1.0,8. (Also I couldn't build this locally due to rust-lang/cargo#4810 so I just opted for the minimal change through the github gui :/ ) |
Looks to be building with 1.0.8 so if it passes this should be good https://travis-ci.org/paritytech/jsonrpc/jobs/316075816#L491 |
I see, thanks! Will try to bump in my local Cargo.lock and test. |
Same issue for |
* Fix Params deserialization on serde_json>=1.0.8 Due to serde-rs/json#389, serde_json no longer calls `deserialize_any` in `deserialize_identifer` (and all other default implemented methods). This causes `Params` to fail to deserialize maps and sequences since it has hinted that it expects an identifier. This implements `deserialize` correctly, saying that it accepts any type. * Fix Id deserialization on serde_json>=1.0.8
* Fix Params deserialization on serde_json>=1.0.8 Due to serde-rs/json#389, serde_json no longer calls `deserialize_any` in `deserialize_identifer` (and all other default implemented methods). This causes `Params` to fail to deserialize maps and sequences since it has hinted that it expects an identifier. This implements `deserialize` correctly, saying that it accepts any type. * Fix Id deserialization on serde_json>=1.0.8
Due to serde-rs/json#389, serde_json no longer calls
deserialize_any
indeserialize_identifer
(and all other default implemented methods). This causesParams
to fail to deserialize maps and sequences since it has hinted that it expects an identifier.This implements
deserialize
correctly, saying that it accepts any type.cc @dtolnay (thought you might want to be aware of this regression/bug)