Test case
1 generated file · +2 −0test/inputs/graphql/github1.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+2 −0
| @@ -169,6 +169,7 @@ namespace quicktype { | ||
| 169 | 169 | inline void from_json(const json & j, User& x) { |
| 170 | 170 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 171 | 171 | x.set_login(j.at("login").get<std::string>()); |
| 172 | + j.at("realName"); | |
| 172 | 173 | x.set_real_name(get_stack_optional<std::string>(j, "realName")); |
| 173 | 174 | } |
| 174 | 175 | |
| @@ -200,6 +201,7 @@ namespace quicktype { | ||
| 200 | 201 | |
| 201 | 202 | inline void from_json(const json & j, TopLevel& x) { |
| 202 | 203 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 204 | + j.at("data"); | |
| 203 | 205 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 204 | 206 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 205 | 207 | } |
Test case
1 generated file · +2 −0test/inputs/graphql/github2.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+2 −0
| @@ -218,6 +218,7 @@ namespace quicktype { | ||
| 218 | 218 | inline void from_json(const json & j, RepositoryConnection& x) { |
| 219 | 219 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 220 | 220 | x.set_total_count(j.at("totalCount").get<int64_t>()); |
| 221 | + j.at("nodes"); | |
| 221 | 222 | x.set_nodes(get_stack_optional<std::vector<std::optional<Repository>>>(j, "nodes")); |
| 222 | 223 | } |
| 223 | 224 | |
| @@ -261,6 +262,7 @@ namespace quicktype { | ||
| 261 | 262 | |
| 262 | 263 | inline void from_json(const json & j, TopLevel& x) { |
| 263 | 264 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 265 | + j.at("data"); | |
| 264 | 266 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 265 | 267 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 266 | 268 | } |
Test case
1 generated file · +3 −0test/inputs/graphql/github3.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+3 −0
| @@ -233,6 +233,7 @@ namespace quicktype { | ||
| 233 | 233 | |
| 234 | 234 | inline void from_json(const json & j, PullRequestConnection& x) { |
| 235 | 235 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 236 | + j.at("nodes"); | |
| 236 | 237 | x.set_nodes(get_stack_optional<std::vector<std::optional<PullRequest>>>(j, "nodes")); |
| 237 | 238 | } |
| 238 | 239 | |
| @@ -254,6 +255,7 @@ namespace quicktype { | ||
| 254 | 255 | inline void from_json(const json & j, User& x) { |
| 255 | 256 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 256 | 257 | x.set_login(j.at("login").get<std::string>()); |
| 258 | + j.at("repository"); | |
| 257 | 259 | x.set_repository(get_stack_optional<Repository>(j, "repository")); |
| 258 | 260 | } |
| 259 | 261 | |
| @@ -285,6 +287,7 @@ namespace quicktype { | ||
| 285 | 287 | |
| 286 | 288 | inline void from_json(const json & j, TopLevel& x) { |
| 287 | 289 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 290 | + j.at("data"); | |
| 288 | 291 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 289 | 292 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 290 | 293 | } |
Test case
1 generated file · +4 −0test/inputs/graphql/github4.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+4 −0
| @@ -237,6 +237,7 @@ namespace quicktype { | ||
| 237 | 237 | |
| 238 | 238 | inline void from_json(const json & j, PullRequestConnection& x) { |
| 239 | 239 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 240 | + j.at("nodes"); | |
| 240 | 241 | x.set_nodes(get_stack_optional<std::vector<std::optional<PullRequest>>>(j, "nodes")); |
| 241 | 242 | } |
| 242 | 243 | |
| @@ -258,7 +259,9 @@ namespace quicktype { | ||
| 258 | 259 | inline void from_json(const json & j, User& x) { |
| 259 | 260 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 260 | 261 | x.set_login(j.at("login").get<std::string>()); |
| 262 | + j.at("name"); | |
| 261 | 263 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 264 | + j.at("repository"); | |
| 262 | 265 | x.set_repository(get_stack_optional<Repository>(j, "repository")); |
| 263 | 266 | } |
| 264 | 267 | |
| @@ -291,6 +294,7 @@ namespace quicktype { | ||
| 291 | 294 | |
| 292 | 295 | inline void from_json(const json & j, TopLevel& x) { |
| 293 | 296 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 297 | + j.at("data"); | |
| 294 | 298 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 295 | 299 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 296 | 300 | } |
Test case
1 generated file · +1 −0test/inputs/graphql/github5.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+1 −0
| @@ -200,6 +200,7 @@ namespace quicktype { | ||
| 200 | 200 | |
| 201 | 201 | inline void from_json(const json & j, TopLevel& x) { |
| 202 | 202 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 203 | + j.at("data"); | |
| 203 | 204 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 204 | 205 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 205 | 206 | } |
Test case
1 generated file · +2 −0test/inputs/graphql/github6.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+2 −0
| @@ -180,6 +180,7 @@ namespace quicktype { | ||
| 180 | 180 | |
| 181 | 181 | inline void from_json(const json & j, Data& x) { |
| 182 | 182 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 183 | + j.at("resource"); | |
| 183 | 184 | x.set_resource(get_stack_optional<UniformResourceLocatable>(j, "resource")); |
| 184 | 185 | } |
| 185 | 186 | |
| @@ -200,6 +201,7 @@ namespace quicktype { | ||
| 200 | 201 | |
| 201 | 202 | inline void from_json(const json & j, TopLevel& x) { |
| 202 | 203 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 204 | + j.at("data"); | |
| 203 | 205 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 204 | 206 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 205 | 207 | } |
Test case
1 generated file · +3 −0test/inputs/graphql/github7.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+3 −0
| @@ -288,6 +288,7 @@ namespace quicktype { | ||
| 288 | 288 | |
| 289 | 289 | inline void from_json(const json & j, RepositoryEdge& x) { |
| 290 | 290 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 291 | + j.at("node"); | |
| 291 | 292 | x.set_node(get_stack_optional<Repository>(j, "node")); |
| 292 | 293 | } |
| 293 | 294 | |
| @@ -298,6 +299,7 @@ namespace quicktype { | ||
| 298 | 299 | |
| 299 | 300 | inline void from_json(const json & j, RepositoryConnection& x) { |
| 300 | 301 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 302 | + j.at("edges"); | |
| 301 | 303 | x.set_edges(get_stack_optional<std::vector<std::optional<RepositoryEdge>>>(j, "edges")); |
| 302 | 304 | } |
| 303 | 305 | |
| @@ -342,6 +344,7 @@ namespace quicktype { | ||
| 342 | 344 | |
| 343 | 345 | inline void from_json(const json & j, TopLevel& x) { |
| 344 | 346 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 347 | + j.at("data"); | |
| 345 | 348 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 346 | 349 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 347 | 350 | } |
Test case
1 generated file · +4 −0test/inputs/graphql/github8.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+4 −0
| @@ -218,7 +218,9 @@ namespace quicktype { | ||
| 218 | 218 | inline void from_json(const json & j, Repository& x) { |
| 219 | 219 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 220 | 220 | x.set_name_with_owner(j.at("nameWithOwner").get<std::string>()); |
| 221 | + j.at("n303"); | |
| 221 | 222 | x.set_n303(get_stack_optional<IssueOrPullRequest>(j, "n303")); |
| 223 | + j.at("n307"); | |
| 222 | 224 | x.set_n307(get_stack_optional<IssueOrPullRequest>(j, "n307")); |
| 223 | 225 | } |
| 224 | 226 | |
| @@ -231,6 +233,7 @@ namespace quicktype { | ||
| 231 | 233 | |
| 232 | 234 | inline void from_json(const json & j, Data& x) { |
| 233 | 235 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 236 | + j.at("repository"); | |
| 234 | 237 | x.set_repository(get_stack_optional<Repository>(j, "repository")); |
| 235 | 238 | } |
| 236 | 239 | |
| @@ -251,6 +254,7 @@ namespace quicktype { | ||
| 251 | 254 | |
| 252 | 255 | inline void from_json(const json & j, TopLevel& x) { |
| 253 | 256 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 257 | + j.at("data"); | |
| 254 | 258 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 255 | 259 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 256 | 260 | } |
Test case
1 generated file · +4 −0test/inputs/graphql/github9.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+4 −0
| @@ -226,6 +226,7 @@ namespace quicktype { | ||
| 226 | 226 | inline void from_json(const json & j, Reactable& x) { |
| 227 | 227 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 228 | 228 | x.set_viewer_can_react(j.at("viewerCanReact").get<bool>()); |
| 229 | + j.at("reactionGroups"); | |
| 229 | 230 | x.set_reaction_groups(get_stack_optional<std::vector<Reaction>>(j, "reactionGroups")); |
| 230 | 231 | } |
| 231 | 232 | |
| @@ -237,6 +238,7 @@ namespace quicktype { | ||
| 237 | 238 | |
| 238 | 239 | inline void from_json(const json & j, AddReactionPayload& x) { |
| 239 | 240 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 241 | + j.at("clientMutationId"); | |
| 240 | 242 | x.set_client_mutation_id(get_stack_optional<std::string>(j, "clientMutationId")); |
| 241 | 243 | x.set_reaction(j.at("reaction").get<Reaction>()); |
| 242 | 244 | x.set_subject(j.at("subject").get<Reactable>()); |
| @@ -251,6 +253,7 @@ namespace quicktype { | ||
| 251 | 253 | |
| 252 | 254 | inline void from_json(const json & j, Data& x) { |
| 253 | 255 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 256 | + j.at("addReaction"); | |
| 254 | 257 | x.set_add_reaction(get_stack_optional<AddReactionPayload>(j, "addReaction")); |
| 255 | 258 | } |
| 256 | 259 | |
| @@ -271,6 +274,7 @@ namespace quicktype { | ||
| 271 | 274 | |
| 272 | 275 | inline void from_json(const json & j, TopLevel& x) { |
| 273 | 276 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 277 | + j.at("data"); | |
| 274 | 278 | x.set_data(get_stack_optional<Data>(j, "data")); |
| 275 | 279 | x.set_errors(get_stack_optional<std::vector<Error>>(j, "errors")); |
| 276 | 280 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/050b0.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -286,6 +286,7 @@ namespace quicktype { | ||
| 286 | 286 | inline void from_json(const json & j, OtherName& x) { |
| 287 | 287 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 288 | 288 | x.set_name(j.at("name").get<std::string>()); |
| 289 | + j.at("note"); | |
| 289 | 290 | x.set_note(get_stack_optional<std::string>(j, "note")); |
| 290 | 291 | } |
| 291 | 292 | |
| @@ -317,6 +318,7 @@ namespace quicktype { | ||
| 317 | 318 | x.set_links(j.at("links").get<std::vector<Link>>()); |
| 318 | 319 | x.set_name(j.at("name").get<std::string>()); |
| 319 | 320 | x.set_other_names(j.at("other_names").get<std::vector<OtherName>>()); |
| 321 | + j.at("superseded_by"); | |
| 320 | 322 | x.set_superseded_by(get_stack_optional<std::string>(j, "superseded_by")); |
| 321 | 323 | x.set_text(j.at("text").get<std::vector<Text>>()); |
| 322 | 324 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/0e0c2.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -536,6 +536,7 @@ namespace quicktype { | ||
| 536 | 536 | x.set_language(j.at("language").get<ResultLanguage>()); |
| 537 | 537 | x.set_release_date(j.at("release_date").get<std::string>()); |
| 538 | 538 | x.set_stars(j.at("stars").get<int64_t>()); |
| 539 | + j.at("tags"); | |
| 539 | 540 | x.set_tags(get_stack_optional<std::vector<nlohmann::json>>(j, "tags")); |
| 540 | 541 | x.set_title(j.at("title").get<std::string>()); |
| 541 | 542 | x.set_videos(j.at("videos").get<std::vector<Video>>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/10be4.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -286,6 +286,7 @@ namespace quicktype { | ||
| 286 | 286 | inline void from_json(const json & j, OtherName& x) { |
| 287 | 287 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 288 | 288 | x.set_name(j.at("name").get<std::string>()); |
| 289 | + j.at("note"); | |
| 289 | 290 | x.set_note(get_stack_optional<std::string>(j, "note")); |
| 290 | 291 | } |
| 291 | 292 | |
| @@ -317,6 +318,7 @@ namespace quicktype { | ||
| 317 | 318 | x.set_links(j.at("links").get<std::vector<Link>>()); |
| 318 | 319 | x.set_name(j.at("name").get<std::string>()); |
| 319 | 320 | x.set_other_names(j.at("other_names").get<std::vector<OtherName>>()); |
| 321 | + j.at("superseded_by"); | |
| 320 | 322 | x.set_superseded_by(get_stack_optional<std::string>(j, "superseded_by")); |
| 321 | 323 | x.set_text(j.at("text").get<std::vector<Text>>()); |
| 322 | 324 | } |
Test case
1 generated file · +4 −0test/inputs/json/misc/1b409.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -473,9 +473,12 @@ namespace quicktype { | ||
| 473 | 473 | x.set_namemod(j.at("namemod").get<Namemod>()); |
| 474 | 474 | x.set_nickname(j.at("nickname").get<std::string>()); |
| 475 | 475 | x.set_osid(j.at("osid").get<std::string>()); |
| 476 | + j.at("pvsid"); | |
| 476 | 477 | x.set_pvsid(get_stack_optional<std::string>(j, "pvsid")); |
| 477 | 478 | x.set_sortname(j.at("sortname").get<std::string>()); |
| 479 | + j.at("twitterid"); | |
| 478 | 480 | x.set_twitterid(get_stack_optional<std::string>(j, "twitterid")); |
| 481 | + j.at("youtubeid"); | |
| 479 | 482 | x.set_youtubeid(get_stack_optional<std::string>(j, "youtubeid")); |
| 480 | 483 | } |
| 481 | 484 | |
| @@ -511,6 +514,7 @@ namespace quicktype { | ||
| 511 | 514 | x.set_enddate(j.at("enddate").get<std::string>()); |
| 512 | 515 | x.set_extra(j.at("extra").get<Extra>()); |
| 513 | 516 | x.set_id(j.at("id").get<int64_t>()); |
| 517 | + j.at("leadership_title"); | |
| 514 | 518 | x.set_leadership_title(get_stack_optional<std::string>(j, "leadership_title")); |
| 515 | 519 | x.set_party(j.at("party").get<Party>()); |
| 516 | 520 | x.set_person(j.at("person").get<Person>()); |
Test case
1 generated file · +10 −0test/inputs/json/misc/27332.json
Mcplusplusdefault / quicktype.hpp+10 −0
| @@ -862,7 +862,9 @@ namespace quicktype { | ||
| 862 | 862 | x.set_approved_by(get_untyped(j, "approved_by")); |
| 863 | 863 | x.set_archived(j.at("archived").get<bool>()); |
| 864 | 864 | x.set_author(j.at("author").get<std::string>()); |
| 865 | + j.at("author_flair_css_class"); | |
| 865 | 866 | x.set_author_flair_css_class(get_stack_optional<std::string>(j, "author_flair_css_class")); |
| 867 | + j.at("author_flair_text"); | |
| 866 | 868 | x.set_author_flair_text(get_stack_optional<std::string>(j, "author_flair_text")); |
| 867 | 869 | x.set_banned_at_utc(get_untyped(j, "banned_at_utc")); |
| 868 | 870 | x.set_banned_by(get_untyped(j, "banned_by")); |
| @@ -873,6 +875,7 @@ namespace quicktype { | ||
| 873 | 875 | x.set_contest_mode(j.at("contest_mode").get<bool>()); |
| 874 | 876 | x.set_created(j.at("created").get<double>()); |
| 875 | 877 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 878 | + j.at("distinguished"); | |
| 876 | 879 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 877 | 880 | x.set_domain(j.at("domain").get<Domain>()); |
| 878 | 881 | x.set_downs(j.at("downs").get<int64_t>()); |
| @@ -884,9 +887,12 @@ namespace quicktype { | ||
| 884 | 887 | x.set_is_self(j.at("is_self").get<bool>()); |
| 885 | 888 | x.set_is_video(j.at("is_video").get<bool>()); |
| 886 | 889 | x.set_likes(get_untyped(j, "likes")); |
| 890 | + j.at("link_flair_css_class"); | |
| 887 | 891 | x.set_link_flair_css_class(get_stack_optional<std::string>(j, "link_flair_css_class")); |
| 892 | + j.at("link_flair_text"); | |
| 888 | 893 | x.set_link_flair_text(get_stack_optional<std::string>(j, "link_flair_text")); |
| 889 | 894 | x.set_locked(j.at("locked").get<bool>()); |
| 895 | + j.at("media"); | |
| 890 | 896 | x.set_media(get_stack_optional<Media>(j, "media")); |
| 891 | 897 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 892 | 898 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| @@ -902,9 +908,11 @@ namespace quicktype { | ||
| 902 | 908 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 903 | 909 | x.set_saved(j.at("saved").get<bool>()); |
| 904 | 910 | x.set_score(j.at("score").get<int64_t>()); |
| 911 | + j.at("secure_media"); | |
| 905 | 912 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 906 | 913 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 907 | 914 | x.set_selftext(j.at("selftext").get<std::string>()); |
| 915 | + j.at("selftext_html"); | |
| 908 | 916 | x.set_selftext_html(get_stack_optional<std::string>(j, "selftext_html")); |
| 909 | 917 | x.set_spoiler(j.at("spoiler").get<bool>()); |
| 910 | 918 | x.set_stickied(j.at("stickied").get<bool>()); |
| @@ -914,7 +922,9 @@ namespace quicktype { | ||
| 914 | 922 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 915 | 923 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 916 | 924 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 925 | + j.at("thumbnail_height"); | |
| 917 | 926 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 927 | + j.at("thumbnail_width"); | |
| 918 | 928 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 919 | 929 | x.set_title(j.at("title").get<std::string>()); |
| 920 | 930 | x.set_ups(j.at("ups").get<int64_t>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/29f47.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -809,6 +809,7 @@ namespace quicktype { | ||
| 809 | 809 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 810 | 810 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 811 | 811 | x.set_selftext(j.at("selftext").get<std::string>()); |
| 812 | + j.at("selftext_html"); | |
| 812 | 813 | x.set_selftext_html(get_stack_optional<std::string>(j, "selftext_html")); |
| 813 | 814 | x.set_spoiler(j.at("spoiler").get<bool>()); |
| 814 | 815 | x.set_stickied(j.at("stickied").get<bool>()); |
| @@ -816,9 +817,12 @@ namespace quicktype { | ||
| 816 | 817 | x.set_subreddit_id(j.at("subreddit_id").get<SubredditId>()); |
| 817 | 818 | x.set_subreddit_name_prefixed(j.at("subreddit_name_prefixed").get<SubredditNamePrefixed>()); |
| 818 | 819 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 820 | + j.at("suggested_sort"); | |
| 819 | 821 | x.set_suggested_sort(get_stack_optional<std::string>(j, "suggested_sort")); |
| 820 | 822 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 823 | + j.at("thumbnail_height"); | |
| 821 | 824 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 825 | + j.at("thumbnail_width"); | |
| 822 | 826 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 823 | 827 | x.set_title(j.at("title").get<std::string>()); |
| 824 | 828 | x.set_ups(j.at("ups").get<int64_t>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/2d4e2.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -506,7 +506,9 @@ namespace quicktype { | ||
| 506 | 506 | x.set_osid(j.at("osid").get<std::string>()); |
| 507 | 507 | x.set_pvsid(j.at("pvsid").get<std::string>()); |
| 508 | 508 | x.set_sortname(j.at("sortname").get<std::string>()); |
| 509 | + j.at("twitterid"); | |
| 509 | 510 | x.set_twitterid(get_stack_optional<std::string>(j, "twitterid")); |
| 511 | + j.at("youtubeid"); | |
| 510 | 512 | x.set_youtubeid(get_stack_optional<std::string>(j, "youtubeid")); |
| 511 | 513 | } |
| 512 | 514 | |
| @@ -534,6 +536,7 @@ namespace quicktype { | ||
| 534 | 536 | |
| 535 | 537 | inline void from_json(const json & j, Object& x) { |
| 536 | 538 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 539 | + j.at("caucus"); | |
| 537 | 540 | x.set_caucus(get_stack_optional<Party>(j, "caucus")); |
| 538 | 541 | x.set_congress_numbers(j.at("congress_numbers").get<std::vector<int64_t>>()); |
| 539 | 542 | x.set_current(j.at("current").get<bool>()); |
| @@ -542,6 +545,7 @@ namespace quicktype { | ||
| 542 | 545 | x.set_enddate(j.at("enddate").get<std::string>()); |
| 543 | 546 | x.set_extra(j.at("extra").get<Extra>()); |
| 544 | 547 | x.set_id(j.at("id").get<int64_t>()); |
| 548 | + j.at("leadership_title"); | |
| 545 | 549 | x.set_leadership_title(get_stack_optional<std::string>(j, "leadership_title")); |
| 546 | 550 | x.set_party(j.at("party").get<Party>()); |
| 547 | 551 | x.set_person(j.at("person").get<Person>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/32431.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -399,14 +399,17 @@ namespace quicktype { | ||
| 399 | 399 | x.set_cdi(get_untyped(j, "cdi")); |
| 400 | 400 | x.set_code(j.at("code").get<std::string>()); |
| 401 | 401 | x.set_detail(j.at("detail").get<std::string>()); |
| 402 | + j.at("dmin"); | |
| 402 | 403 | x.set_dmin(get_stack_optional<double>(j, "dmin")); |
| 403 | 404 | x.set_felt(get_untyped(j, "felt")); |
| 405 | + j.at("gap"); | |
| 404 | 406 | x.set_gap(get_stack_optional<int64_t>(j, "gap")); |
| 405 | 407 | x.set_ids(j.at("ids").get<std::string>()); |
| 406 | 408 | x.set_mag(j.at("mag").get<double>()); |
| 407 | 409 | x.set_mag_type(j.at("magType").get<MagType>()); |
| 408 | 410 | x.set_mmi(get_untyped(j, "mmi")); |
| 409 | 411 | x.set_net(j.at("net").get<std::string>()); |
| 412 | + j.at("nst"); | |
| 410 | 413 | x.set_nst(get_stack_optional<int64_t>(j, "nst")); |
| 411 | 414 | x.set_place(j.at("place").get<std::string>()); |
| 412 | 415 | x.set_rms(j.at("rms").get<double>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/32d5c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -144,6 +144,7 @@ namespace quicktype { | ||
| 144 | 144 | |
| 145 | 145 | inline void from_json(const json & j, TopLevelElement& x) { |
| 146 | 146 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 147 | + j.at("BirthDate"); | |
| 147 | 148 | x.set_birth_date(get_stack_optional<std::string>(j, "BirthDate")); |
| 148 | 149 | x.set_birth_date_is_protected(j.at("BirthDateIsProtected").get<bool>()); |
| 149 | 150 | x.set_gender_type_id(j.at("GenderTypeID").get<int64_t>()); |
Test case
1 generated file · +17 −0test/inputs/json/misc/337ed.json
Mcplusplusdefault / quicktype.hpp+17 −0
| @@ -408,8 +408,11 @@ namespace quicktype { | ||
| 408 | 408 | |
| 409 | 409 | inline void from_json(const json & j, Result& x) { |
| 410 | 410 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 411 | + j.at("cost_absolute"); | |
| 411 | 412 | x.set_cost_absolute(get_stack_optional<int64_t>(j, "cost_absolute")); |
| 413 | + j.at("cost_max"); | |
| 412 | 414 | x.set_cost_max(get_stack_optional<int64_t>(j, "cost_max")); |
| 415 | + j.at("cost_min"); | |
| 413 | 416 | x.set_cost_min(get_stack_optional<int64_t>(j, "cost_min")); |
| 414 | 417 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 415 | 418 | x.set_custom_incomes(j.at("customIncomes").get<std::vector<CustomIncome>>()); |
| @@ -417,25 +420,39 @@ namespace quicktype { | ||
| 417 | 420 | x.set_direct_rep_costs_min(get_untyped(j, "direct_rep_costs_min")); |
| 418 | 421 | x.set_end_date(j.at("end_date").get<std::string>()); |
| 419 | 422 | x.set_eur_sources_grants(j.at("eur_sources_grants").get<int64_t>()); |
| 423 | + j.at("eur_sources_grants_src"); | |
| 420 | 424 | x.set_eur_sources_grants_src(get_stack_optional<std::string>(j, "eur_sources_grants_src")); |
| 421 | 425 | x.set_eur_sources_procurement(j.at("eur_sources_procurement").get<int64_t>()); |
| 426 | + j.at("eur_sources_procurement_src"); | |
| 422 | 427 | x.set_eur_sources_procurement_src(get_stack_optional<std::string>(j, "eur_sources_procurement_src")); |
| 423 | 428 | x.set_id(j.at("id").get<std::string>()); |
| 424 | 429 | x.set_new_organisation(get_untyped(j, "new_organisation")); |
| 430 | + j.at("no_clients"); | |
| 425 | 431 | x.set_no_clients(get_stack_optional<std::string>(j, "no_clients")); |
| 432 | + j.at("other_financial_information"); | |
| 426 | 433 | x.set_other_financial_information(get_stack_optional<std::string>(j, "other_financial_information")); |
| 434 | + j.at("other_sources_contributions"); | |
| 427 | 435 | x.set_other_sources_contributions(get_stack_optional<int64_t>(j, "other_sources_contributions")); |
| 436 | + j.at("other_sources_donation"); | |
| 428 | 437 | x.set_other_sources_donation(get_stack_optional<int64_t>(j, "other_sources_donation")); |
| 438 | + j.at("other_sources_total"); | |
| 429 | 439 | x.set_other_sources_total(get_stack_optional<int64_t>(j, "other_sources_total")); |
| 440 | + j.at("public_financing_infranational"); | |
| 430 | 441 | x.set_public_financing_infranational(get_stack_optional<int64_t>(j, "public_financing_infranational")); |
| 442 | + j.at("public_financing_national"); | |
| 431 | 443 | x.set_public_financing_national(get_stack_optional<int64_t>(j, "public_financing_national")); |
| 444 | + j.at("public_financing_total"); | |
| 432 | 445 | x.set_public_financing_total(get_stack_optional<int64_t>(j, "public_financing_total")); |
| 433 | 446 | x.set_representative(j.at("representative").get<std::string>()); |
| 434 | 447 | x.set_start_date(j.at("start_date").get<std::string>()); |
| 435 | 448 | x.set_status(j.at("status").get<Status>()); |
| 449 | + j.at("total_budget"); | |
| 436 | 450 | x.set_total_budget(get_stack_optional<int64_t>(j, "total_budget")); |
| 451 | + j.at("turnover_absolute"); | |
| 437 | 452 | x.set_turnover_absolute(get_stack_optional<int64_t>(j, "turnover_absolute")); |
| 453 | + j.at("turnover_max"); | |
| 438 | 454 | x.set_turnover_max(get_stack_optional<int64_t>(j, "turnover_max")); |
| 455 | + j.at("turnover_min"); | |
| 439 | 456 | x.set_turnover_min(get_stack_optional<int64_t>(j, "turnover_min")); |
| 440 | 457 | x.set_type(j.at("type").get<ResultType>()); |
| 441 | 458 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/34702.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -372,10 +372,12 @@ namespace quicktype { | ||
| 372 | 372 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 373 | 373 | x.set_division(j.at("division").get<std::string>()); |
| 374 | 374 | x.set_fax(j.at("fax").get<double>()); |
| 375 | + j.at("fire_ban_r"); | |
| 375 | 376 | x.set_fire_ban_r(get_stack_optional<FireBanR>(j, "fire_ban_r")); |
| 376 | 377 | x.set_latitude(j.at("latitude").get<double>()); |
| 377 | 378 | x.set_local_govt(j.at("local_govt").get<std::string>()); |
| 378 | 379 | x.set_longitude(j.at("longitude").get<double>()); |
| 380 | + j.at("no"); | |
| 379 | 381 | x.set_no(get_stack_optional<std::string>(j, "no")); |
| 380 | 382 | x.set_phone(j.at("phone").get<double>()); |
| 381 | 383 | x.set_postcode(j.at("postcode").get<int64_t>()); |
| @@ -384,6 +386,7 @@ namespace quicktype { | ||
| 384 | 386 | x.set_station(j.at("station").get<std::string>()); |
| 385 | 387 | x.set_street(j.at("street").get<std::string>()); |
| 386 | 388 | x.set_suburb(j.at("suburb").get<std::string>()); |
| 389 | + j.at("type"); | |
| 387 | 390 | x.set_type(get_stack_optional<PropertiesType>(j, "type")); |
| 388 | 391 | } |
Test case
1 generated file · +4 −0test/inputs/json/misc/4d6fb.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -895,6 +895,7 @@ namespace quicktype { | ||
| 895 | 895 | x.set_link_flair_css_class(get_untyped(j, "link_flair_css_class")); |
| 896 | 896 | x.set_link_flair_text(get_untyped(j, "link_flair_text")); |
| 897 | 897 | x.set_locked(j.at("locked").get<bool>()); |
| 898 | + j.at("media"); | |
| 898 | 899 | x.set_media(get_stack_optional<Media>(j, "media")); |
| 899 | 900 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 900 | 901 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| @@ -910,6 +911,7 @@ namespace quicktype { | ||
| 910 | 911 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 911 | 912 | x.set_saved(j.at("saved").get<bool>()); |
| 912 | 913 | x.set_score(j.at("score").get<int64_t>()); |
| 914 | + j.at("secure_media"); | |
| 913 | 915 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 914 | 916 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 915 | 917 | x.set_selftext(j.at("selftext").get<std::string>()); |
| @@ -922,7 +924,9 @@ namespace quicktype { | ||
| 922 | 924 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 923 | 925 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 924 | 926 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 927 | + j.at("thumbnail_height"); | |
| 925 | 928 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 929 | + j.at("thumbnail_width"); | |
| 926 | 930 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 927 | 931 | x.set_title(j.at("title").get<std::string>()); |
| 928 | 932 | x.set_ups(j.at("ups").get<int64_t>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/570ec.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -267,6 +267,7 @@ namespace quicktype { | ||
| 267 | 267 | inline void from_json(const json & j, OtherName& x) { |
| 268 | 268 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 269 | 269 | x.set_name(j.at("name").get<std::string>()); |
| 270 | + j.at("note"); | |
| 270 | 271 | x.set_note(get_stack_optional<std::string>(j, "note")); |
| 271 | 272 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/66121.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -284,6 +284,7 @@ namespace quicktype { | ||
| 284 | 284 | x.set_links(j.at("links").get<std::vector<Link>>()); |
| 285 | 285 | x.set_name(j.at("name").get<std::string>()); |
| 286 | 286 | x.set_other_names(j.at("other_names").get<std::vector<nlohmann::json>>()); |
| 287 | + j.at("superseded_by"); | |
| 287 | 288 | x.set_superseded_by(get_stack_optional<std::string>(j, "superseded_by")); |
| 288 | 289 | x.set_text(j.at("text").get<std::vector<Text>>()); |
| 289 | 290 | } |
Test case
1 generated file · +10 −0test/inputs/json/misc/6de06.json
Mcplusplusdefault / quicktype.hpp+10 −0
| @@ -900,7 +900,9 @@ namespace quicktype { | ||
| 900 | 900 | x.set_approved_by(get_untyped(j, "approved_by")); |
| 901 | 901 | x.set_archived(j.at("archived").get<bool>()); |
| 902 | 902 | x.set_author(j.at("author").get<std::string>()); |
| 903 | + j.at("author_flair_css_class"); | |
| 903 | 904 | x.set_author_flair_css_class(get_stack_optional<std::string>(j, "author_flair_css_class")); |
| 905 | + j.at("author_flair_text"); | |
| 904 | 906 | x.set_author_flair_text(get_stack_optional<std::string>(j, "author_flair_text")); |
| 905 | 907 | x.set_banned_at_utc(get_untyped(j, "banned_at_utc")); |
| 906 | 908 | x.set_banned_by(get_untyped(j, "banned_by")); |
| @@ -922,9 +924,12 @@ namespace quicktype { | ||
| 922 | 924 | x.set_is_self(j.at("is_self").get<bool>()); |
| 923 | 925 | x.set_is_video(j.at("is_video").get<bool>()); |
| 924 | 926 | x.set_likes(get_untyped(j, "likes")); |
| 927 | + j.at("link_flair_css_class"); | |
| 925 | 928 | x.set_link_flair_css_class(get_stack_optional<std::string>(j, "link_flair_css_class")); |
| 929 | + j.at("link_flair_text"); | |
| 926 | 930 | x.set_link_flair_text(get_stack_optional<std::string>(j, "link_flair_text")); |
| 927 | 931 | x.set_locked(j.at("locked").get<bool>()); |
| 932 | + j.at("media"); | |
| 928 | 933 | x.set_media(get_stack_optional<Media>(j, "media")); |
| 929 | 934 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 930 | 935 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| @@ -940,9 +945,11 @@ namespace quicktype { | ||
| 940 | 945 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 941 | 946 | x.set_saved(j.at("saved").get<bool>()); |
| 942 | 947 | x.set_score(j.at("score").get<int64_t>()); |
| 948 | + j.at("secure_media"); | |
| 943 | 949 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 944 | 950 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 945 | 951 | x.set_selftext(j.at("selftext").get<std::string>()); |
| 952 | + j.at("selftext_html"); | |
| 946 | 953 | x.set_selftext_html(get_stack_optional<std::string>(j, "selftext_html")); |
| 947 | 954 | x.set_spoiler(j.at("spoiler").get<bool>()); |
| 948 | 955 | x.set_stickied(j.at("stickied").get<bool>()); |
| @@ -950,9 +957,12 @@ namespace quicktype { | ||
| 950 | 957 | x.set_subreddit_id(j.at("subreddit_id").get<std::string>()); |
| 951 | 958 | x.set_subreddit_name_prefixed(j.at("subreddit_name_prefixed").get<std::string>()); |
| 952 | 959 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 960 | + j.at("suggested_sort"); | |
| 953 | 961 | x.set_suggested_sort(get_stack_optional<std::string>(j, "suggested_sort")); |
| 954 | 962 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 963 | + j.at("thumbnail_height"); | |
| 955 | 964 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 965 | + j.at("thumbnail_width"); | |
| 956 | 966 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 957 | 967 | x.set_title(j.at("title").get<std::string>()); |
| 958 | 968 | x.set_ups(j.at("ups").get<int64_t>()); |
Test case
1 generated file · +14 −0test/inputs/json/misc/734ad.json
Mcplusplusdefault / quicktype.hpp+14 −0
| @@ -452,6 +452,7 @@ namespace quicktype { | ||
| 452 | 452 | |
| 453 | 453 | inline void from_json(const json & j, Result& x) { |
| 454 | 454 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 455 | + j.at("acronym"); | |
| 455 | 456 | x.set_acronym(get_stack_optional<std::string>(j, "acronym")); |
| 456 | 457 | x.set_activity_consult_committees(j.at("activity_consult_committees").get<std::string>()); |
| 457 | 458 | x.set_activity_eu_legislative(j.at("activity_eu_legislative").get<std::string>()); |
| @@ -459,6 +460,7 @@ namespace quicktype { | ||
| 459 | 460 | x.set_activity_high_level_groups(j.at("activity_high_level_groups").get<std::string>()); |
| 460 | 461 | x.set_activity_industry_forums(j.at("activity_industry_forums").get<std::string>()); |
| 461 | 462 | x.set_activity_inter_groups(j.at("activity_inter_groups").get<std::string>()); |
| 463 | + j.at("activity_other"); | |
| 462 | 464 | x.set_activity_other(get_stack_optional<std::string>(j, "activity_other")); |
| 463 | 465 | x.set_activity_relevant_comm(j.at("activity_relevant_comm").get<std::string>()); |
| 464 | 466 | x.set_be_office_country(get_stack_optional<std::string>(j, "be_office_country")); |
| @@ -476,10 +478,14 @@ namespace quicktype { | ||
| 476 | 478 | x.set_goals(j.at("goals").get<std::string>()); |
| 477 | 479 | x.set_head(j.at("head").get<std::string>()); |
| 478 | 480 | x.set_head_office_country(j.at("head_office_country").get<std::string>()); |
| 481 | + j.at("head_office_lat"); | |
| 479 | 482 | x.set_head_office_lat(get_stack_optional<double>(j, "head_office_lat")); |
| 483 | + j.at("head_office_lon"); | |
| 480 | 484 | x.set_head_office_lon(get_stack_optional<double>(j, "head_office_lon")); |
| 481 | 485 | x.set_head_office_phone(j.at("head_office_phone").get<std::string>()); |
| 486 | + j.at("head_office_post_code"); | |
| 482 | 487 | x.set_head_office_post_code(get_stack_optional<std::string>(j, "head_office_post_code")); |
| 488 | + j.at("head_office_postbox"); | |
| 483 | 489 | x.set_head_office_postbox(get_stack_optional<std::string>(j, "head_office_postbox")); |
| 484 | 490 | x.set_head_office_street(j.at("head_office_street").get<std::string>()); |
| 485 | 491 | x.set_head_office_town(j.at("head_office_town").get<std::string>()); |
| @@ -492,15 +498,22 @@ namespace quicktype { | ||
| 492 | 498 | x.set_main_category(j.at("main_category").get<int64_t>()); |
| 493 | 499 | x.set_main_category_title(j.at("main_category_title").get<std::string>()); |
| 494 | 500 | x.set_members(j.at("members").get<int64_t>()); |
| 501 | + j.at("members_100"); | |
| 495 | 502 | x.set_members_100(get_stack_optional<int64_t>(j, "members_100")); |
| 503 | + j.at("members_25"); | |
| 496 | 504 | x.set_members_25(get_stack_optional<int64_t>(j, "members_25")); |
| 505 | + j.at("members_50"); | |
| 497 | 506 | x.set_members_50(get_stack_optional<int64_t>(j, "members_50")); |
| 507 | + j.at("members_75"); | |
| 498 | 508 | x.set_members_75(get_stack_optional<int64_t>(j, "members_75")); |
| 499 | 509 | x.set_members_fte(j.at("members_fte").get<double>()); |
| 500 | 510 | x.set_name(j.at("name").get<std::string>()); |
| 501 | 511 | x.set_native_name(get_untyped(j, "native_name")); |
| 512 | + j.at("networking"); | |
| 502 | 513 | x.set_networking(get_stack_optional<std::string>(j, "networking")); |
| 514 | + j.at("number_of_natural_persons"); | |
| 503 | 515 | x.set_number_of_natural_persons(get_stack_optional<int64_t>(j, "number_of_natural_persons")); |
| 516 | + j.at("other_code_of_conduct"); | |
| 504 | 517 | x.set_other_code_of_conduct(get_stack_optional<std::string>(j, "other_code_of_conduct")); |
| 505 | 518 | x.set_registration_date(j.at("registration_date").get<std::string>()); |
| 506 | 519 | x.set_status(j.at("status").get<Status>()); |
| @@ -509,6 +522,7 @@ namespace quicktype { | ||
| 509 | 522 | x.set_sub_category_title(j.at("sub_category_title").get<std::string>()); |
| 510 | 523 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| 511 | 524 | x.set_uri(j.at("uri").get<std::string>()); |
| 525 | + j.at("web_site_url"); | |
| 512 | 526 | x.set_web_site_url(get_stack_optional<std::string>(j, "web_site_url")); |
| 513 | 527 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/7f568.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -231,6 +231,7 @@ namespace quicktype { | ||
| 231 | 231 | inline void from_json(const json & j, File& x) { |
| 232 | 232 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 233 | 233 | x.set_filename(j.at("filename").get<std::string>()); |
| 234 | + j.at("language"); | |
| 234 | 235 | x.set_language(get_stack_optional<Language>(j, "language")); |
| 235 | 236 | x.set_raw_url(j.at("raw_url").get<std::string>()); |
| 236 | 237 | x.set_size(j.at("size").get<int64_t>()); |
| @@ -252,6 +253,7 @@ namespace quicktype { | ||
| 252 | 253 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| 253 | 254 | x.set_commits_url(j.at("commits_url").get<std::string>()); |
| 254 | 255 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 256 | + j.at("description"); | |
| 255 | 257 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 256 | 258 | x.set_files(j.at("files").get<std::map<std::string, File>>()); |
| 257 | 259 | x.set_forks_url(j.at("forks_url").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/80aff.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -212,6 +212,7 @@ namespace quicktype { | ||
| 212 | 212 | x.set_id(j.at("id").get<int64_t>()); |
| 213 | 213 | x.set_items(j.at("items").get<int64_t>()); |
| 214 | 214 | x.set_name(j.at("name").get<std::string>()); |
| 215 | + j.at("parent"); | |
| 215 | 216 | x.set_parent(get_stack_optional<int64_t>(j, "parent")); |
| 216 | 217 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| 217 | 218 | x.set_uri(j.at("uri").get<std::string>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/8592b.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -681,7 +681,9 @@ namespace quicktype { | ||
| 681 | 681 | x.set_approved_by(get_untyped(j, "approved_by")); |
| 682 | 682 | x.set_archived(j.at("archived").get<bool>()); |
| 683 | 683 | x.set_author(j.at("author").get<std::string>()); |
| 684 | + j.at("author_flair_css_class"); | |
| 684 | 685 | x.set_author_flair_css_class(get_stack_optional<std::string>(j, "author_flair_css_class")); |
| 686 | + j.at("author_flair_text"); | |
| 685 | 687 | x.set_author_flair_text(get_stack_optional<std::string>(j, "author_flair_text")); |
| 686 | 688 | x.set_banned_at_utc(get_untyped(j, "banned_at_utc")); |
| 687 | 689 | x.set_banned_by(get_untyped(j, "banned_by")); |
| @@ -724,6 +726,7 @@ namespace quicktype { | ||
| 724 | 726 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 725 | 727 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 726 | 728 | x.set_selftext(j.at("selftext").get<std::string>()); |
| 729 | + j.at("selftext_html"); | |
| 727 | 730 | x.set_selftext_html(get_stack_optional<std::string>(j, "selftext_html")); |
| 728 | 731 | x.set_spoiler(j.at("spoiler").get<bool>()); |
| 729 | 732 | x.set_stickied(j.at("stickied").get<bool>()); |
| @@ -733,7 +736,9 @@ namespace quicktype { | ||
| 733 | 736 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 734 | 737 | x.set_suggested_sort(j.at("suggested_sort").get<SuggestedSort>()); |
| 735 | 738 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 739 | + j.at("thumbnail_height"); | |
| 736 | 740 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 741 | + j.at("thumbnail_width"); | |
| 737 | 742 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 738 | 743 | x.set_title(j.at("title").get<std::string>()); |
| 739 | 744 | x.set_ups(j.at("ups").get<int64_t>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/996bd.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -279,6 +279,7 @@ namespace quicktype { | ||
| 279 | 279 | x.set_links(j.at("links").get<std::vector<Link>>()); |
| 280 | 280 | x.set_name(j.at("name").get<std::string>()); |
| 281 | 281 | x.set_other_names(j.at("other_names").get<std::vector<nlohmann::json>>()); |
| 282 | + j.at("superseded_by"); | |
| 282 | 283 | x.set_superseded_by(get_stack_optional<std::string>(j, "superseded_by")); |
| 283 | 284 | x.set_text(j.at("text").get<std::vector<Text>>()); |
| 284 | 285 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/9ac3b.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -243,8 +243,10 @@ namespace quicktype { | ||
| 243 | 243 | x.set_id(j.at("id").get<std::string>()); |
| 244 | 244 | x.set_last_name(j.at("last_name").get<std::string>()); |
| 245 | 245 | x.set_name(j.at("name").get<std::string>()); |
| 246 | + j.at("position"); | |
| 246 | 247 | x.set_position(get_stack_optional<std::string>(j, "position")); |
| 247 | 248 | x.set_status(j.at("status").get<Status>()); |
| 249 | + j.at("title"); | |
| 248 | 250 | x.set_title(get_stack_optional<Title>(j, "title")); |
| 249 | 251 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| 250 | 252 | x.set_uri(j.at("uri").get<std::string>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/ad8be.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -286,6 +286,7 @@ namespace quicktype { | ||
| 286 | 286 | inline void from_json(const json & j, OtherName& x) { |
| 287 | 287 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 288 | 288 | x.set_name(j.at("name").get<std::string>()); |
| 289 | + j.at("note"); | |
| 289 | 290 | x.set_note(get_stack_optional<std::string>(j, "note")); |
| 290 | 291 | } |
| 291 | 292 | |
| @@ -317,6 +318,7 @@ namespace quicktype { | ||
| 317 | 318 | x.set_links(j.at("links").get<std::vector<Link>>()); |
| 318 | 319 | x.set_name(j.at("name").get<std::string>()); |
| 319 | 320 | x.set_other_names(j.at("other_names").get<std::vector<OtherName>>()); |
| 321 | + j.at("superseded_by"); | |
| 320 | 322 | x.set_superseded_by(get_stack_optional<std::string>(j, "superseded_by")); |
| 321 | 323 | x.set_text(j.at("text").get<std::vector<Text>>()); |
| 322 | 324 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/ae7f0.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -557,7 +557,9 @@ namespace quicktype { | ||
| 557 | 557 | x.set_is_self(j.at("is_self").get<bool>()); |
| 558 | 558 | x.set_is_video(j.at("is_video").get<bool>()); |
| 559 | 559 | x.set_likes(get_untyped(j, "likes")); |
| 560 | + j.at("link_flair_css_class"); | |
| 560 | 561 | x.set_link_flair_css_class(get_stack_optional<std::string>(j, "link_flair_css_class")); |
| 562 | + j.at("link_flair_text"); | |
| 561 | 563 | x.set_link_flair_text(get_stack_optional<std::string>(j, "link_flair_text")); |
| 562 | 564 | x.set_locked(j.at("locked").get<bool>()); |
| 563 | 565 | x.set_media(get_untyped(j, "media")); |
Test case
1 generated file · +13 −0test/inputs/json/misc/af2d1.json
Mcplusplusdefault / quicktype.hpp+13 −0
| @@ -494,33 +494,45 @@ namespace quicktype { | ||
| 494 | 494 | |
| 495 | 495 | inline void from_json(const json & j, FeatureProperties& x) { |
| 496 | 496 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 497 | + j.at("add_improv"); | |
| 497 | 498 | x.set_add_improv(get_stack_optional<AddImprov>(j, "add_improv")); |
| 498 | 499 | x.set_area(j.at("area_").get<double>()); |
| 499 | 500 | x.set_asset_numb(j.at("asset_numb").get<std::string>()); |
| 501 | + j.at("comments"); | |
| 500 | 502 | x.set_comments(get_stack_optional<std::string>(j, "comments")); |
| 501 | 503 | x.set_condition(j.at("condition").get<int64_t>()); |
| 504 | + j.at("constructi"); | |
| 502 | 505 | x.set_constructi(get_stack_optional<std::string>(j, "constructi")); |
| 503 | 506 | x.set_createdate(get_untyped(j, "createdate")); |
| 504 | 507 | x.set_createuser(get_untyped(j, "createuser")); |
| 505 | 508 | x.set_disposal_d(get_untyped(j, "disposal_d")); |
| 506 | 509 | x.set_documents(j.at("documents").get<std::string>()); |
| 510 | + j.at("drawing_nu"); | |
| 507 | 511 | x.set_drawing_nu(get_stack_optional<std::string>(j, "drawing_nu")); |
| 512 | + j.at("file_numbe"); | |
| 508 | 513 | x.set_file_numbe(get_stack_optional<std::string>(j, "file_numbe")); |
| 514 | + j.at("folder_num"); | |
| 509 | 515 | x.set_folder_num(get_stack_optional<std::string>(j, "folder_num")); |
| 516 | + j.at("funding_ba"); | |
| 510 | 517 | x.set_funding_ba(get_stack_optional<FundingBa>(j, "funding_ba")); |
| 511 | 518 | x.set_historic_c(j.at("historic_c").get<int64_t>()); |
| 512 | 519 | x.set_inspection(j.at("inspection").get<std::string>()); |
| 513 | 520 | x.set_inspectors(get_untyped(j, "inspectors")); |
| 514 | 521 | x.set_last_updat(get_untyped(j, "last_updat")); |
| 522 | + j.at("level_accu"); | |
| 515 | 523 | x.set_level_accu(get_stack_optional<LevelAccu>(j, "level_accu")); |
| 516 | 524 | x.set_material(j.at("material").get<Material>()); |
| 517 | 525 | x.set_mi_prinx(j.at("mi_prinx").get<int64_t>()); |
| 518 | 526 | x.set_mi_symbolo(j.at("mi_symbolo").get<MiSymbolo>()); |
| 519 | 527 | x.set_number_lan(j.at("number_lan").get<int64_t>()); |
| 528 | + j.at("owner"); | |
| 520 | 529 | x.set_owner(get_stack_optional<std::string>(j, "owner")); |
| 530 | + j.at("positional"); | |
| 521 | 531 | x.set_positional(get_stack_optional<LevelAccu>(j, "positional")); |
| 532 | + j.at("project_nu"); | |
| 522 | 533 | x.set_project_nu(get_stack_optional<std::string>(j, "project_nu")); |
| 523 | 534 | x.set_rec_id(j.at("rec_id").get<int64_t>()); |
| 535 | + j.at("record_cre"); | |
| 524 | 536 | x.set_record_cre(get_stack_optional<std::string>(j, "record_cre")); |
| 525 | 537 | x.set_shape_area(j.at("shape_area").get<double>()); |
| 526 | 538 | x.set_shape_leng(j.at("shape_leng").get<double>()); |
| @@ -528,6 +540,7 @@ namespace quicktype { | ||
| 528 | 540 | x.set_survey_num(get_untyped(j, "survey_num")); |
| 529 | 541 | x.set_toe_rl(j.at("toe_rl").get<double>()); |
| 530 | 542 | x.set_top_rl(j.at("top_rl").get<double>()); |
| 543 | + j.at("type"); | |
| 531 | 544 | x.set_type(get_stack_optional<PropertiesType>(j, "type")); |
| 532 | 545 | x.set_update_dat(j.at("update_dat").get<std::string>()); |
| 533 | 546 | x.set_updatedate(get_untyped(j, "updatedate")); |
Test case
1 generated file · +4 −0test/inputs/json/misc/be234.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -913,6 +913,7 @@ namespace quicktype { | ||
| 913 | 913 | x.set_archived(j.at("archived").get<bool>()); |
| 914 | 914 | x.set_author(j.at("author").get<std::string>()); |
| 915 | 915 | x.set_author_flair_css_class(get_untyped(j, "author_flair_css_class")); |
| 916 | + j.at("author_flair_text"); | |
| 916 | 917 | x.set_author_flair_text(get_stack_optional<std::string>(j, "author_flair_text")); |
| 917 | 918 | x.set_banned_at_utc(get_untyped(j, "banned_at_utc")); |
| 918 | 919 | x.set_banned_by(get_untyped(j, "banned_by")); |
| @@ -923,6 +924,7 @@ namespace quicktype { | ||
| 923 | 924 | x.set_contest_mode(j.at("contest_mode").get<bool>()); |
| 924 | 925 | x.set_created(j.at("created").get<double>()); |
| 925 | 926 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 927 | + j.at("distinguished"); | |
| 926 | 928 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 927 | 929 | x.set_domain(j.at("domain").get<Domain>()); |
| 928 | 930 | x.set_downs(j.at("downs").get<int64_t>()); |
| @@ -937,6 +939,7 @@ namespace quicktype { | ||
| 937 | 939 | x.set_link_flair_css_class(get_untyped(j, "link_flair_css_class")); |
| 938 | 940 | x.set_link_flair_text(get_untyped(j, "link_flair_text")); |
| 939 | 941 | x.set_locked(j.at("locked").get<bool>()); |
| 942 | + j.at("media"); | |
| 940 | 943 | x.set_media(get_stack_optional<Media>(j, "media")); |
| 941 | 944 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 942 | 945 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| @@ -952,6 +955,7 @@ namespace quicktype { | ||
| 952 | 955 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 953 | 956 | x.set_saved(j.at("saved").get<bool>()); |
| 954 | 957 | x.set_score(j.at("score").get<int64_t>()); |
| 958 | + j.at("secure_media"); | |
| 955 | 959 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 956 | 960 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| 957 | 961 | x.set_selftext(j.at("selftext").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/d23d5.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -203,6 +203,7 @@ namespace quicktype { | ||
| 203 | 203 | |
| 204 | 204 | inline void from_json(const json & j, Result& x) { |
| 205 | 205 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 206 | + j.at("acronym"); | |
| 206 | 207 | x.set_acronym(get_stack_optional<std::string>(j, "acronym")); |
| 207 | 208 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 208 | 209 | x.set_id(j.at("id").get<std::string>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/f22f5.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -552,7 +552,9 @@ namespace quicktype { | ||
| 552 | 552 | x.set_is_self(j.at("is_self").get<bool>()); |
| 553 | 553 | x.set_is_video(j.at("is_video").get<bool>()); |
| 554 | 554 | x.set_likes(get_untyped(j, "likes")); |
| 555 | + j.at("link_flair_css_class"); | |
| 555 | 556 | x.set_link_flair_css_class(get_stack_optional<std::string>(j, "link_flair_css_class")); |
| 557 | + j.at("link_flair_text"); | |
| 556 | 558 | x.set_link_flair_text(get_stack_optional<std::string>(j, "link_flair_text")); |
| 557 | 559 | x.set_locked(j.at("locked").get<bool>()); |
| 558 | 560 | x.set_media(get_untyped(j, "media")); |
Test case
1 generated file · +2 −0test/inputs/json/priority/bug2590.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -133,7 +133,9 @@ namespace quicktype { | ||
| 133 | 133 | |
| 134 | 134 | inline void from_json(const json & j, Invoice& x) { |
| 135 | 135 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 136 | + j.at("createdAt"); | |
| 136 | 137 | x.set_created_at(get_stack_optional<std::string>(j, "createdAt")); |
| 138 | + j.at("dueDate"); | |
| 137 | 139 | x.set_due_date(get_stack_optional<std::string>(j, "dueDate")); |
| 138 | 140 | x.set_name(j.at("name").get<std::string>()); |
| 139 | 141 | } |
Test case
1 generated file · +1 −0test/inputs/json/priority/list.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -113,6 +113,7 @@ namespace quicktype { | ||
| 113 | 113 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 114 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 115 | 115 | x.set_data(j.at("data").get<int64_t>()); |
| 116 | + j.at("next"); | |
| 116 | 117 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
| 117 | 118 | } |
Test case
1 generated file · +3 −0test/inputs/json/samples/github-events.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -1614,6 +1614,7 @@ namespace quicktype { | ||
| 1614 | 1614 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1615 | 1615 | x.set_creator(j.at("creator").get<User>()); |
| 1616 | 1616 | x.set_description(j.at("description").get<std::string>()); |
| 1617 | + j.at("due_on"); | |
| 1617 | 1618 | x.set_due_on(get_stack_optional<std::string>(j, "due_on")); |
| 1618 | 1619 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1619 | 1620 | x.set_id(j.at("id").get<int64_t>()); |
| @@ -1666,6 +1667,7 @@ namespace quicktype { | ||
| 1666 | 1667 | x.set_assignee(get_untyped(j, "assignee")); |
| 1667 | 1668 | x.set_assignees(j.at("assignees").get<std::vector<nlohmann::json>>()); |
| 1668 | 1669 | x.set_body(j.at("body").get<std::string>()); |
| 1670 | + j.at("closed_at"); | |
| 1669 | 1671 | x.set_closed_at(get_stack_optional<std::string>(j, "closed_at")); |
| 1670 | 1672 | x.set_comments(j.at("comments").get<int64_t>()); |
| 1671 | 1673 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| @@ -1676,6 +1678,7 @@ namespace quicktype { | ||
| 1676 | 1678 | x.set_labels(j.at("labels").get<std::vector<Label>>()); |
| 1677 | 1679 | x.set_labels_url(j.at("labels_url").get<std::string>()); |
| 1678 | 1680 | x.set_locked(j.at("locked").get<bool>()); |
| 1681 | + j.at("milestone"); | |
| 1679 | 1682 | x.set_milestone(get_stack_optional<Milestone>(j, "milestone")); |
| 1680 | 1683 | x.set_number(j.at("number").get<int64_t>()); |
| 1681 | 1684 | x.set_pull_request(get_stack_optional<IssuePullRequest>(j, "pull_request")); |
Test case
1 generated file · +1 −0test/inputs/json/samples/null-safe.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -184,6 +184,7 @@ namespace quicktype { | ||
| 184 | 184 | x.set_address(get_stack_optional<Address>(j, "address")); |
| 185 | 185 | x.set_created_at(get_stack_optional<std::string>(j, "created_at")); |
| 186 | 186 | x.set_name(j.at("name").get<std::string>()); |
| 187 | + j.at("sex"); | |
| 187 | 188 | x.set_sex(get_stack_optional<int64_t>(j, "sex")); |
| 188 | 189 | } |
Test case
3 generated files · +3 −0test/inputs/json/samples/pokedex.json
Mcplusplus-multi-sourcedefault / Generators.hpp+1 −0
| @@ -55,6 +55,7 @@ namespace quicktype { | ||
| 55 | 55 | x.set_height(j.at("height").get<std::string>()); |
| 56 | 56 | x.set_id(j.at("id").get<int64_t>()); |
| 57 | 57 | x.set_img(j.at("img").get<std::string>()); |
| 58 | + j.at("multipliers"); | |
| 58 | 59 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
| 59 | 60 | x.set_name(j.at("name").get<std::string>()); |
| 60 | 61 | x.set_next_evolution(get_stack_optional<std::vector<Evolution>>(j, "next_evolution")); |
Mcplusplusboost-true--bed8626e10e6 / quicktype.hpp+1 −0
| @@ -258,6 +258,7 @@ namespace quicktype { | ||
| 258 | 258 | x.set_height(j.at("height").get<std::string>()); |
| 259 | 259 | x.set_id(j.at("id").get<int64_t>()); |
| 260 | 260 | x.set_img(j.at("img").get<std::string>()); |
| 261 | + j.at("multipliers"); | |
| 261 | 262 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
| 262 | 263 | x.set_name(j.at("name").get<std::string>()); |
| 263 | 264 | x.set_next_evolution(get_stack_optional<std::vector<Evolution>>(j, "next_evolution")); |
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -257,6 +257,7 @@ namespace quicktype { | ||
| 257 | 257 | x.set_height(j.at("height").get<std::string>()); |
| 258 | 258 | x.set_id(j.at("id").get<int64_t>()); |
| 259 | 259 | x.set_img(j.at("img").get<std::string>()); |
| 260 | + j.at("multipliers"); | |
| 260 | 261 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
| 261 | 262 | x.set_name(j.at("name").get<std::string>()); |
| 262 | 263 | x.set_next_evolution(get_stack_optional<std::vector<Evolution>>(j, "next_evolution")); |
Test case
1 generated file · +5 −0test/inputs/json/samples/reddit.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -764,7 +764,9 @@ namespace quicktype { | ||
| 764 | 764 | x.set_approved_by(get_untyped(j, "approved_by")); |
| 765 | 765 | x.set_archived(j.at("archived").get<bool>()); |
| 766 | 766 | x.set_author(j.at("author").get<std::string>()); |
| 767 | + j.at("author_flair_css_class"); | |
| 767 | 768 | x.set_author_flair_css_class(get_stack_optional<std::string>(j, "author_flair_css_class")); |
| 769 | + j.at("author_flair_text"); | |
| 768 | 770 | x.set_author_flair_text(get_stack_optional<std::string>(j, "author_flair_text")); |
| 769 | 771 | x.set_banned_at_utc(get_untyped(j, "banned_at_utc")); |
| 770 | 772 | x.set_banned_by(get_untyped(j, "banned_by")); |
| @@ -775,6 +777,7 @@ namespace quicktype { | ||
| 775 | 777 | x.set_contest_mode(j.at("contest_mode").get<bool>()); |
| 776 | 778 | x.set_created(j.at("created").get<int64_t>()); |
| 777 | 779 | x.set_created_utc(j.at("created_utc").get<int64_t>()); |
| 780 | + j.at("distinguished"); | |
| 778 | 781 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 779 | 782 | x.set_domain(j.at("domain").get<Domain>()); |
| 780 | 783 | x.set_downs(j.at("downs").get<int64_t>()); |
| @@ -786,7 +789,9 @@ namespace quicktype { | ||
| 786 | 789 | x.set_is_self(j.at("is_self").get<bool>()); |
| 787 | 790 | x.set_is_video(j.at("is_video").get<bool>()); |
| 788 | 791 | x.set_likes(get_untyped(j, "likes")); |
| 792 | + j.at("link_flair_css_class"); | |
| 789 | 793 | x.set_link_flair_css_class(get_stack_optional<std::string>(j, "link_flair_css_class")); |
| 794 | + j.at("link_flair_text"); | |
| 790 | 795 | x.set_link_flair_text(get_stack_optional<std::string>(j, "link_flair_text")); |
| 791 | 796 | x.set_locked(j.at("locked").get<bool>()); |
| 792 | 797 | x.set_media(get_untyped(j, "media")); |
Test case
1 generated file · +4 −0test/inputs/json/samples/us-senators.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -495,7 +495,9 @@ namespace quicktype { | ||
| 495 | 495 | x.set_osid(j.at("osid").get<std::string>()); |
| 496 | 496 | x.set_pvsid(j.at("pvsid").get<std::string>()); |
| 497 | 497 | x.set_sortname(j.at("sortname").get<std::string>()); |
| 498 | + j.at("twitterid"); | |
| 498 | 499 | x.set_twitterid(get_stack_optional<std::string>(j, "twitterid")); |
| 500 | + j.at("youtubeid"); | |
| 499 | 501 | x.set_youtubeid(get_stack_optional<std::string>(j, "youtubeid")); |
| 500 | 502 | } |
| 501 | 503 | |
| @@ -522,6 +524,7 @@ namespace quicktype { | ||
| 522 | 524 | |
| 523 | 525 | inline void from_json(const json & j, Object& x) { |
| 524 | 526 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 527 | + j.at("caucus"); | |
| 525 | 528 | x.set_caucus(get_stack_optional<Party>(j, "caucus")); |
| 526 | 529 | x.set_congress_numbers(j.at("congress_numbers").get<std::vector<int64_t>>()); |
| 527 | 530 | x.set_current(j.at("current").get<bool>()); |
| @@ -529,6 +532,7 @@ namespace quicktype { | ||
| 529 | 532 | x.set_district(get_untyped(j, "district")); |
| 530 | 533 | x.set_enddate(j.at("enddate").get<std::string>()); |
| 531 | 534 | x.set_extra(j.at("extra").get<Extra>()); |
| 535 | + j.at("leadership_title"); | |
| 532 | 536 | x.set_leadership_title(get_stack_optional<std::string>(j, "leadership_title")); |
| 533 | 537 | x.set_party(j.at("party").get<Party>()); |
| 534 | 538 | x.set_person(j.at("person").get<Person>()); |
Test case
1 generated file · +1 −0test/inputs/schema/bool-string.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -151,6 +151,7 @@ namespace quicktype { | ||
| 151 | 151 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 152 | 152 | x.set_arr_nullable(get_stack_optional<std::vector<std::optional<std::string>>>(j, "arrNullable")); |
| 153 | 153 | x.set_arr_one(get_stack_optional<std::vector<std::string>>(j, "arrOne")); |
| 154 | + j.at("nullable"); | |
| 154 | 155 | x.set_nullable(get_stack_optional<std::string>(j, "nullable")); |
| 155 | 156 | x.set_one(j.at("one").get<std::string>()); |
| 156 | 157 | x.set_optional(get_stack_optional<std::string>(j, "optional")); |
Test case
1 generated file · +1 −0test/inputs/schema/direct-union.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -141,6 +141,7 @@ namespace quicktype { | ||
| 141 | 141 | inline void from_json(const json & j, Thing& x) { |
| 142 | 142 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 143 | 143 | x.set_optional(get_stack_optional<std::variant<std::vector<nlohmann::json>, bool, double, int64_t, std::map<std::string, nlohmann::json>, std::string>>(j, "optional")); |
| 144 | + j.at("required"); | |
| 144 | 145 | x.set_required(get_stack_optional<std::variant<std::vector<nlohmann::json>, bool, double, int64_t, std::map<std::string, nlohmann::json>, std::string>>(j, "required")); |
| 145 | 146 | } |
Test case
1 generated file · +1 −0test/inputs/schema/enum-with-null.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -112,6 +112,7 @@ namespace quicktype { | ||
| 112 | 112 | |
| 113 | 113 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 114 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 115 | + j.at("enum"); | |
| 115 | 116 | x.set_top_level_enum(get_stack_optional<Enum>(j, "enum")); |
| 116 | 117 | } |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-class-array-union.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -145,6 +145,7 @@ namespace quicktype { | ||
| 145 | 145 | |
| 146 | 146 | inline void from_json(const json & j, TopLevel& x) { |
| 147 | 147 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 148 | + j.at("foo"); | |
| 148 | 149 | x.set_foo(get_stack_optional<std::variant<std::vector<int64_t>, bool, FooClass, double, int64_t, std::string>>(j, "foo")); |
| 149 | 150 | } |
Test case
1 generated file · +1 −0test/inputs/schema/integer-string.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -151,6 +151,7 @@ namespace quicktype { | ||
| 151 | 151 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 152 | 152 | x.set_arr_nullable(get_stack_optional<std::vector<std::optional<std::string>>>(j, "arrNullable")); |
| 153 | 153 | x.set_arr_one(get_stack_optional<std::vector<std::string>>(j, "arrOne")); |
| 154 | + j.at("nullable"); | |
| 154 | 155 | x.set_nullable(get_stack_optional<std::string>(j, "nullable")); |
| 155 | 156 | x.set_one(j.at("one").get<std::string>()); |
| 156 | 157 | x.set_optional(get_stack_optional<std::string>(j, "optional")); |
Test case
1 generated file · +1 −0test/inputs/schema/strict-optional.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -107,6 +107,7 @@ namespace quicktype { | ||
| 107 | 107 | |
| 108 | 108 | inline void from_json(const json & j, TopLevel& x) { |
| 109 | 109 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 110 | + j.at("foo"); | |
| 110 | 111 | x.set_foo(get_stack_optional<double>(j, "foo")); |
| 111 | 112 | } |
Test case
1 generated file · +1 −0test/inputs/schema/uuid.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -135,6 +135,7 @@ namespace quicktype { | ||
| 135 | 135 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 136 | 136 | x.set_arr_nullable(get_stack_optional<std::vector<std::optional<std::string>>>(j, "arrNullable")); |
| 137 | 137 | x.set_arr_one(get_stack_optional<std::vector<std::string>>(j, "arrOne")); |
| 138 | + j.at("nullable"); | |
| 138 | 139 | x.set_nullable(get_stack_optional<std::string>(j, "nullable")); |
| 139 | 140 | x.set_one(j.at("one").get<std::string>()); |
| 140 | 141 | x.set_optional(get_stack_optional<std::string>(j, "optional")); |
No generated files match these filters.