| 446 | } |
| 447 | |
| 448 | void flatten_and_unflatten() |
| 449 | { |
| 450 | json input = json::parse(R"( |
| 451 | { |
| 452 | "application": "hiking", |
| 453 | "reputons": [ |
| 454 | { |
| 455 | "rater": "HikingAsylum", |
| 456 | "assertion": "advanced", |
| 457 | "rated": "Marilyn C", |
| 458 | "rating": 0.90 |
| 459 | }, |
| 460 | { |
| 461 | "rater": "HikingAsylum", |
| 462 | "assertion": "intermediate", |
| 463 | "rated": "Hongmin", |
| 464 | "rating": 0.75 |
| 465 | } |
| 466 | ] |
| 467 | } |
| 468 | )"); |
| 469 | |
| 470 | json flattened = jsonpointer::flatten(input); |
| 471 | |
| 472 | std::cout << pretty_print(flattened) << "\n\n"; |
| 473 | |
| 474 | json unflattened = jsonpointer::unflatten(flattened); |
| 475 | |
| 476 | assert(unflattened == input); |
| 477 | } |
| 478 | |
| 479 | void flatten_and_unflatten2() |
| 480 | { |
no test coverage detected