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
Is your feature request related to a problem? Please describe.
I'm introducing CBOR as an alternative to an existing JSON codec based on the stdlib encoding/json package, whose marshal and unmarshal behaviors are not at all affected by whether or not a value's type implements BinaryMarshaler or BinaryUnmarshaler. Users can today be successfully encoding and decoding types that implement these interfaces to and from JSON. If they flip the switch to instead use CBOR, today, CBOR may produce or expect something entirely different in structure and content from the current JSON.
Describe the solution you'd like
Encode and Decode options to ignore BinaryUnmarshaler and BinaryMarshaler on decode and encode.
Describe alternatives you've considered
This is a built-in behavior, so I don't think it can be disabled through an existing extension point. Over time, I hope efforts like #507 will make it possible both for users to set custom marshal/unmarshal behaviors on interface types that they do not control, and that the BinaryMarshaler built-in could be implemented with (and configurable by) the same mechanism.
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm introducing CBOR as an alternative to an existing JSON codec based on the stdlib encoding/json package, whose marshal and unmarshal behaviors are not at all affected by whether or not a value's type implements BinaryMarshaler or BinaryUnmarshaler. Users can today be successfully encoding and decoding types that implement these interfaces to and from JSON. If they flip the switch to instead use CBOR, today, CBOR may produce or expect something entirely different in structure and content from the current JSON.
Describe the solution you'd like
Encode and Decode options to ignore BinaryUnmarshaler and BinaryMarshaler on decode and encode.
Describe alternatives you've considered
This is a built-in behavior, so I don't think it can be disabled through an existing extension point. Over time, I hope efforts like #507 will make it possible both for users to set custom marshal/unmarshal behaviors on interface types that they do not control, and that the BinaryMarshaler built-in could be implemented with (and configurable by) the same mechanism.
Additional context
The text was updated successfully, but these errors were encountered: