1 #include <iostream> 2 #include <iomanip> 3 #include <nlohmann/json.hpp> 4 5 using json = nlohmann::json; 6 main()7int main() 8 { 9 // a JSON text given as std::vector 10 std::vector<uint8_t> text = {'[', '1', ',', '2', ',', '3', ']', '\0'}; 11 12 // parse and serialize JSON 13 json j_complete = json::parse(text); 14 std::cout << std::setw(4) << j_complete << "\n\n"; 15 } 16