I have a use case where a struct with a raw value gets converted into a Value, which then needs to be serialized to JSON. Upon conversion, RawValue gets downcast to a Map, which loses the special serialization of RawValue, resulting in a JSON containing an object with one entry whose key equals raw::TOKEN.
I am wondering if you would be willing to have code for recovering the “rawness.”
It was a good question that made me think a little bit harder. After going back and forth, I have decided to propose a similar change to async-graphql instead, which was the use case I mentioned:
Hello,
I have a use case where a struct with a raw value gets converted into a
Value
, which then needs to be serialized to JSON. Upon conversion,RawValue
gets downcast to aMap
, which loses the special serialization ofRawValue
, resulting in a JSON containing an object with one entry whose key equalsraw::TOKEN
.I am wondering if you would be willing to have code for recovering the “rawness.”