-
-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Description
The following code:
std::vector<uint8_t> odata;
jsoncons::ojson oj(jsoncons::json_object_arg);
oj.insert_or_assign("timestamp", jsoncons::ojson("05-12-2020", jsoncons::semantic_tag::datetime) );
oj.insert_or_assign("URL", jsoncons::ojson("http://www.domain.com", jsoncons::semantic_tag::uri) );
jsoncons::cbor::encode_cbor(oj, odata);
jsoncons::ojson oj2 = jsoncons::cbor::decode_cbor<jsoncons::ojson>(odata);
std::cout << "(oj)\n" << pretty_print(oj2) << "\n\n";
produces the following (incorrect) output:
(oj)
{
"timestamp": "05-12-2020",
"URL": -1
}
I have also verified that the encoder is the problem by taking the binary output and putting it into (http://cbor.me) and receiving the same -1 result.