Closed dg-pb closed 4 months ago
Sorry, but I won't be adding this. msgspec.json
implements a standards compliant JSON parser, not some custom JSON-like format. If you want to efficiently serialize/deserialize bytes objects I recommend using msgspec.msgpack
instead (as recommended in that issue). It has native support for bytes
/bytearray
/memoryview` objects, and even can support zero-copy when decoding them for cases where that makes sense (https://jcristharif.com/msgspec/supported-types.html#bytes-bytearray-memoryview).
Description
So the feature is simple. To OPTIONALLY allow raw, unencoded bytes type to be a value of json. Something along the lines of:
I have already created an issue and laid out my reasoning in
yyjson
github as I was usingorjson
and tried implementing it there. However, I am switching to msgspec due to its speed, the fact that it does not depend on other libraries and other benefits.See: https://github.com/ibireme/yyjson/issues/160
Any chance this could be considered?