json::to_bson does not handle unsigned 64 bit integers #3894
Labels
aspect: binary formats
BSON, CBOR, MessagePack, UBJSON
confirmed
kind: bug
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Description
Trying to convert a nlohmann::json object which contains an unsigned int of 64 bit length breaks BSON conversion.
I do consider this to be a bug, as BSON should be capable of handling those values [1] , but the corresponding header-bits are not set in write_bson_unsigned. Only entry headers
0x10
(forint32
) and0x12
(forint64
) are written, but11
(foruint_64
) is not.Reproduction steps
This bug is triggered whenever one uses the
json::to_bson
function on any object that contains an uint64_t, that really uses all 64 bits.Expected vs. actual results
I expect BSON to generated, but I get an error message (see below)
Minimal code example
Error messages
Compiler and operating system
Clang-13 on Mint 21 64bit, Clang Trunk (via godbolt)
Library version
3.11.2 (develop branch via godbolt) , 3.10.5
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: