alloy icon indicating copy to clipboard operation
alloy copied to clipboard

[Bug] WithOtherFields duplicates on deserialize

Open mattsse opened this issue 10 months ago • 0 comments

Component

network, json-rpc, provider, pubsub

What version of Alloy are you on?

main

Operating System

None

Describe the bug

the WithOtherFields contains two serde(flatten) with one being a catch all map.

due to how serde flatten behaves, the Otherfields will always contain all key values of the object.

this isn't easy to fix, and would require a lot of custom serde.

a quick fix would be to serialize the inner into a serde_json::Map and remove those keys from the serde_Value we serialized into initially

cc @klkvr

mattsse avatar Apr 09 '24 18:04 mattsse