Closed bymoye closed 1 year ago
For JSON binary objects (bytes
, bytearray
, and memoryview
) serialize as base64-encoded strings. This is intentional and is documented here. To decode back into a bytes object you'd need to provide a type
to the decode
method to tell msgspec to coerce the string back to a bytes object.
Description
In the example, they are not equal because I used bytes for one of the fields in the dict:
maybe it should throw an exception like orjson: Type is not JSON serializable: bytes