Skip to content

Commit

Permalink
Fix Params deserialization on serde_json>=1.0.8 (#222)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Marwes authored and tomusdrw committed Dec 13, 2017
1 parent 0eba7e7 commit 59cb86b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/types/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Serialize for Id {
impl<'a> Deserialize<'a> for Id {
fn deserialize<D>(deserializer: D) -> Result<Id, D::Error>
where D: Deserializer<'a> {
deserializer.deserialize_identifier(IdVisitor)
deserializer.deserialize_any(IdVisitor)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/types/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ParamsVisitor;
impl<'a> Deserialize<'a> for Params {
fn deserialize<D>(deserializer: D) -> Result<Params, D::Error>
where D: Deserializer<'a> {
deserializer.deserialize_identifier(ParamsVisitor)
deserializer.deserialize_any(ParamsVisitor)
}
}

Expand Down

0 comments on commit 59cb86b

Please sign in to comment.