You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am not sure if that is the correct way for feedback. I could not find if this is a feature being addressed or if there is a plan for providing something similar in deser. At least, I want to contribute it as a point to be aware of.
serde has a long-standing issue about internal buffering which interacts with a lot features and tends to break deserialization unexpectedly: serde-rs/serde#1183 (Example)
Internal buffering is used to implement the flatten attribute, untagged and adjacently tagged enums.
The problem in the example is that serde_json "knows" how to deserialize a HashMap<i64, i64> (by treating string keys as numbers), but due to buffering it turns into a Map<String, i64> which then cannot be deserialized. The problem is also that the Inner type works well on its own, but by being included in the Outer type it starts failing.
The text was updated successfully, but these errors were encountered:
So far it doesn't but this issue is one I want to try to address. Generally internal buffering will absolutely be necessary to address this issue but internal buffering is tricky. My general goal is to have an extensible internal data model but I'm not sure yet what the best approach here is.
Both serde-rs/serde#1183 and serde-rs/serde#1463 are issues I hit with serde and are tricky to address in its current design but I want to try to address here.
Basic support for this landed now but I am not entirely convinced yet that the approach here is the best one. That said, I did chose to implement flattening by "reaching" into the inner deserializer without buffering, which should be less error prone.
I'm closing this as resolved for now, but I am sure that there will be multiple iterations about this before this feature can be considered implemented.
Hi, I am not sure if that is the correct way for feedback. I could not find if this is a feature being addressed or if there is a plan for providing something similar in
deser
. At least, I want to contribute it as a point to be aware of.serde has a long-standing issue about internal buffering which interacts with a lot features and tends to break deserialization unexpectedly: serde-rs/serde#1183 (Example)
Internal buffering is used to implement the
flatten
attribute,untagged
andadjacent
ly tagged enums.The problem in the example is that
serde_json
"knows" how to deserialize aHashMap<i64, i64>
(by treating string keys as numbers), but due to buffering it turns into aMap<String, i64>
which then cannot be deserialized. The problem is also that theInner
type works well on its own, but by being included in theOuter
type it starts failing.The text was updated successfully, but these errors were encountered: