| 500 | } |
| 501 | |
| 502 | void jsonpath_union() |
| 503 | { |
| 504 | auto root = jsoncons::json::parse(R"( |
| 505 | { |
| 506 | "firstName": "John", |
| 507 | "lastName" : "doe", |
| 508 | "age" : 26, |
| 509 | "address" : { |
| 510 | "streetAddress": "naist street", |
| 511 | "city" : "Nara", |
| 512 | "postalCode" : "630-0192" |
| 513 | }, |
| 514 | "phoneNumbers": [ |
| 515 | { |
| 516 | "type" : "iPhone", |
| 517 | "number": "0123-4567-8888" |
| 518 | }, |
| 519 | { |
| 520 | "type" : "home", |
| 521 | "number": "0123-4567-8910" |
| 522 | } |
| 523 | ] |
| 524 | } )"); |
| 525 | |
| 526 | std::string path = "$..[@.firstName,@.address.city]"; |
| 527 | jsoncons::json result = jsonpath::json_query(root,path); |
| 528 | |
| 529 | std::cout << result << "\n"; |
| 530 | } |
| 531 | |
| 532 | void flatten_and_unflatten() |
| 533 | { |
no test coverage detected