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
using VariantType = std::variant<bool, int64_t, double, std::string, Object,
Array, std::nullopt_t>;
This list has no alternative for binary data, so it cannot cleanly represent base64-encoded JSON, or MessagePack BIN values. Using std::string for arbitrary bytes loses the distinction between text and binary and isn’t portable across formats that expect UTF-8 strings.
Would you consider adding some kind of support for this?
FWIW I have considered adding a new alternative here, but it has its issues: it's kind of a breaking change and all backends must be updated, and also when decoding JSON, there isn't enough information to deduce whether a string is a byte string or regular one. So if supporting this isn't desirable I understand.
Activity
liuzicheng1987 commentedon Nov 15, 2026
@jinchengJL I think adding bytestrings here should be possible