This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix manual (De)Serialize implementations with serde_json
The new Deserializer implementation (#107) does not work with the 'serde_json' crate, particularly `serde_json::{to_string, from_str}`. The new implementation always expects `byte array` for deserilaiztion. Meanwhile, the 'serde_json' crate always (de)serializes `String` as `Vector` [1][2] which is treated as `sequence` (e.g. not 'byte array') by default for (de)serialization [3]. To fix this issue, this patch extends the new Deserializer implementation to support both `byte array` and `sequence`. [1] https://github.com/serde-rs/json/blob/cc7a1608c9bb7736c884926e016421af41a1ebe7/src/ser.rs#L2168-L2175 [2] https://github.com/serde-rs/json/blob/cc7a1608c9bb7736c884926e016421af41a1ebe7/src/de.rs#L30-L39 [3] https://serde.rs/data-model.html#types Signed-off-by: Patrick Roy <roypat@amazon.co.uk> Signed-off-by: Bo Chen <chen.bo@intel.com>
- Loading branch information