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
But many json deserializers (like serde) support treating missing fields as a null value. If we could do this efficiently in serde, then we could cut down on the size of our serialized output. Unfortunately this would require us to add some form of lookahead to Serializer, which might be tricky.
The text was updated successfully, but these errors were encountered:
Copying your comment from the PR here, so it's not lost
Another option would be when serializing fields, the Serializer passes an outer closure to the Serialize impl. If it decides to serialize the value, then it passes an inner closure to outer one. The outer one actually serializes the field name, then calls the inner one to do the actual serialization. Not calling the closure is equivalent to not serializing the key-value pair.
Right now we serialize a type like:
As:
But many json deserializers (like serde) support treating missing fields as a
null
value. If we could do this efficiently in serde, then we could cut down on the size of our serialized output. Unfortunately this would require us to add some form of lookahead toSerializer
, which might be tricky.The text was updated successfully, but these errors were encountered: