Test case
1 generated file · +1 −0test/inputs/graphql/github2.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+1 −0
| @@ -217,6 +217,7 @@ namespace quicktype { | ||
| 217 | 217 | |
| 218 | 218 | inline void from_json(const json & j, RepositoryConnection& x) { |
| 219 | 219 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 220 | + if (j.find("totalCount") != j.end() && !j.at("totalCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 220 | 221 | x.set_total_count(j.at("totalCount").get<int64_t>()); |
| 221 | 222 | x.set_nodes(get_stack_optional<std::vector<std::optional<Repository>>>(j, "nodes")); |
| 222 | 223 | } |
Test case
1 generated file · +1 −0test/inputs/graphql/github7.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+1 −0
| @@ -260,6 +260,7 @@ namespace quicktype { | ||
| 260 | 260 | |
| 261 | 261 | inline void from_json(const json & j, Connection& x) { |
| 262 | 262 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 263 | + if (j.find("totalCount") != j.end() && !j.at("totalCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 263 | 264 | x.set_total_count(j.at("totalCount").get<int64_t>()); |
| 264 | 265 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/00c36.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -235,9 +235,12 @@ namespace quicktype { | ||
| 235 | 235 | |
| 236 | 236 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 237 | 237 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 238 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 239 | x.set_page(j.at("page").get<int64_t>()); |
| 240 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 241 | x.set_pages(j.at("pages").get<int64_t>()); |
| 240 | 242 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 243 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 244 | x.set_total(j.at("total").get<int64_t>()); |
| 242 | 245 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/010b1.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/016af.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/09f54.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -124,6 +124,7 @@ namespace quicktype { | ||
| 124 | 124 | inline void from_json(const json & j, Description& x) { |
| 125 | 125 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 126 | 126 | x.set_base_period(j.at("base_period").get<std::string>()); |
| 127 | + if (j.find("missing") != j.end() && !j.at("missing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 127 | 128 | x.set_missing(j.at("missing").get<int64_t>()); |
| 128 | 129 | x.set_title(j.at("title").get<std::string>()); |
| 129 | 130 | x.set_units(j.at("units").get<std::string>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/0a358.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -150,6 +150,7 @@ namespace quicktype { | ||
| 150 | 150 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 151 | 151 | x.set_code(j.at("code").get<std::string>()); |
| 152 | 152 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 153 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 153 | 154 | x.set_id(j.at("id").get<int64_t>()); |
| 154 | 155 | x.set_name(j.at("name").get<std::string>()); |
| 155 | 156 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| @@ -168,10 +169,13 @@ namespace quicktype { | ||
| 168 | 169 | |
| 169 | 170 | inline void from_json(const json & j, TopLevel& x) { |
| 170 | 171 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 172 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 171 | 173 | x.set_count(j.at("count").get<int64_t>()); |
| 172 | 174 | x.set_facets(j.at("facets").get<Facets>()); |
| 175 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 173 | 176 | x.set_limit(j.at("limit").get<int64_t>()); |
| 174 | 177 | x.set_next(j.at("next").get<std::string>()); |
| 178 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 175 | 179 | x.set_offset(j.at("offset").get<int64_t>()); |
| 176 | 180 | x.set_previous(j.at("previous").get<bool>()); |
| 177 | 181 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +24 −0test/inputs/json/misc/0a91a.json
Mcplusplusdefault / quicktype.hpp+24 −0
| @@ -1140,6 +1140,7 @@ namespace quicktype { | ||
| 1140 | 1140 | x.set_avatar_url(j.at("avatar_url").get<std::string>()); |
| 1141 | 1141 | x.set_display_login(get_stack_optional<std::string>(j, "display_login")); |
| 1142 | 1142 | x.set_gravatar_id(j.at("gravatar_id").get<std::string>()); |
| 1143 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1143 | 1144 | x.set_id(j.at("id").get<int64_t>()); |
| 1144 | 1145 | x.set_login(j.at("login").get<std::string>()); |
| 1145 | 1146 | x.set_url(j.at("url").get<std::string>()); |
| @@ -1194,6 +1195,7 @@ namespace quicktype { | ||
| 1194 | 1195 | x.set_gists_url(j.at("gists_url").get<std::string>()); |
| 1195 | 1196 | x.set_gravatar_id(j.at("gravatar_id").get<std::string>()); |
| 1196 | 1197 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1198 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1197 | 1199 | x.set_id(j.at("id").get<int64_t>()); |
| 1198 | 1200 | x.set_login(j.at("login").get<std::string>()); |
| 1199 | 1201 | x.set_organizations_url(j.at("organizations_url").get<std::string>()); |
| @@ -1247,7 +1249,9 @@ namespace quicktype { | ||
| 1247 | 1249 | x.set_downloads_url(j.at("downloads_url").get<std::string>()); |
| 1248 | 1250 | x.set_events_url(j.at("events_url").get<std::string>()); |
| 1249 | 1251 | x.set_fork(j.at("fork").get<bool>()); |
| 1252 | + if (j.find("forks") != j.end() && !j.at("forks").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1250 | 1253 | x.set_forks(j.at("forks").get<int64_t>()); |
| 1254 | + if (j.find("forks_count") != j.end() && !j.at("forks_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1251 | 1255 | x.set_forks_count(j.at("forks_count").get<int64_t>()); |
| 1252 | 1256 | x.set_forks_url(j.at("forks_url").get<std::string>()); |
| 1253 | 1257 | x.set_full_name(j.at("full_name").get<std::string>()); |
| @@ -1263,6 +1267,7 @@ namespace quicktype { | ||
| 1263 | 1267 | x.set_homepage(get_untyped(j, "homepage")); |
| 1264 | 1268 | x.set_hooks_url(j.at("hooks_url").get<std::string>()); |
| 1265 | 1269 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1270 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1266 | 1271 | x.set_id(j.at("id").get<int64_t>()); |
| 1267 | 1272 | x.set_issue_comment_url(j.at("issue_comment_url").get<std::string>()); |
| 1268 | 1273 | x.set_issue_events_url(j.at("issue_events_url").get<std::string>()); |
| @@ -1276,15 +1281,19 @@ namespace quicktype { | ||
| 1276 | 1281 | x.set_mirror_url(get_untyped(j, "mirror_url")); |
| 1277 | 1282 | x.set_name(j.at("name").get<std::string>()); |
| 1278 | 1283 | x.set_notifications_url(j.at("notifications_url").get<std::string>()); |
| 1284 | + if (j.find("open_issues") != j.end() && !j.at("open_issues").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1279 | 1285 | x.set_open_issues(j.at("open_issues").get<int64_t>()); |
| 1286 | + if (j.find("open_issues_count") != j.end() && !j.at("open_issues_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1280 | 1287 | x.set_open_issues_count(j.at("open_issues_count").get<int64_t>()); |
| 1281 | 1288 | x.set_owner(j.at("owner").get<MergedBy>()); |
| 1282 | 1289 | x.set_pulls_url(j.at("pulls_url").get<std::string>()); |
| 1283 | 1290 | x.set_pushed_at(j.at("pushed_at").get<std::string>()); |
| 1284 | 1291 | x.set_releases_url(j.at("releases_url").get<std::string>()); |
| 1285 | 1292 | x.set_repo_private(j.at("private").get<bool>()); |
| 1293 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1286 | 1294 | x.set_size(j.at("size").get<int64_t>()); |
| 1287 | 1295 | x.set_ssh_url(j.at("ssh_url").get<std::string>()); |
| 1296 | + if (j.find("stargazers_count") != j.end() && !j.at("stargazers_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1288 | 1297 | x.set_stargazers_count(j.at("stargazers_count").get<int64_t>()); |
| 1289 | 1298 | x.set_stargazers_url(j.at("stargazers_url").get<std::string>()); |
| 1290 | 1299 | x.set_statuses_url(j.at("statuses_url").get<std::string>()); |
| @@ -1296,7 +1305,9 @@ namespace quicktype { | ||
| 1296 | 1305 | x.set_trees_url(j.at("trees_url").get<std::string>()); |
| 1297 | 1306 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| 1298 | 1307 | x.set_url(j.at("url").get<std::string>()); |
| 1308 | + if (j.find("watchers") != j.end() && !j.at("watchers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1299 | 1309 | x.set_watchers(j.at("watchers").get<int64_t>()); |
| 1310 | + if (j.find("watchers_count") != j.end() && !j.at("watchers_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1300 | 1311 | x.set_watchers_count(j.at("watchers_count").get<int64_t>()); |
| 1301 | 1312 | } |
| 1302 | 1313 | |
| @@ -1427,22 +1438,28 @@ namespace quicktype { | ||
| 1427 | 1438 | |
| 1428 | 1439 | inline void from_json(const json & j, PullRequest& x) { |
| 1429 | 1440 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1441 | + if (j.find("additions") != j.end() && !j.at("additions").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1430 | 1442 | x.set_additions(j.at("additions").get<int64_t>()); |
| 1431 | 1443 | x.set_assignee(get_untyped(j, "assignee")); |
| 1432 | 1444 | x.set_assignees(j.at("assignees").get<std::vector<nlohmann::json>>()); |
| 1433 | 1445 | x.set_base(j.at("base").get<Base>()); |
| 1434 | 1446 | x.set_body(j.at("body").get<std::string>()); |
| 1447 | + if (j.find("changed_files") != j.end() && !j.at("changed_files").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1435 | 1448 | x.set_changed_files(j.at("changed_files").get<int64_t>()); |
| 1436 | 1449 | x.set_closed_at(j.at("closed_at").get<std::string>()); |
| 1450 | + if (j.find("comments") != j.end() && !j.at("comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1437 | 1451 | x.set_comments(j.at("comments").get<int64_t>()); |
| 1438 | 1452 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| 1453 | + if (j.find("commits") != j.end() && !j.at("commits").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1439 | 1454 | x.set_commits(j.at("commits").get<int64_t>()); |
| 1440 | 1455 | x.set_commits_url(j.at("commits_url").get<std::string>()); |
| 1441 | 1456 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1457 | + if (j.find("deletions") != j.end() && !j.at("deletions").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1442 | 1458 | x.set_deletions(j.at("deletions").get<int64_t>()); |
| 1443 | 1459 | x.set_diff_url(j.at("diff_url").get<std::string>()); |
| 1444 | 1460 | x.set_head(j.at("head").get<Base>()); |
| 1445 | 1461 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1462 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1446 | 1463 | x.set_id(j.at("id").get<int64_t>()); |
| 1447 | 1464 | x.set_issue_url(j.at("issue_url").get<std::string>()); |
| 1448 | 1465 | x.set_links(j.at("_links").get<Links>()); |
| @@ -1455,11 +1472,13 @@ namespace quicktype { | ||
| 1455 | 1472 | x.set_merged_at(j.at("merged_at").get<std::string>()); |
| 1456 | 1473 | x.set_merged_by(j.at("merged_by").get<MergedBy>()); |
| 1457 | 1474 | x.set_milestone(get_untyped(j, "milestone")); |
| 1475 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1458 | 1476 | x.set_number(j.at("number").get<int64_t>()); |
| 1459 | 1477 | x.set_patch_url(j.at("patch_url").get<std::string>()); |
| 1460 | 1478 | x.set_rebaseable(get_untyped(j, "rebaseable")); |
| 1461 | 1479 | x.set_requested_reviewers(j.at("requested_reviewers").get<std::vector<nlohmann::json>>()); |
| 1462 | 1480 | x.set_review_comment_url(j.at("review_comment_url").get<std::string>()); |
| 1481 | + if (j.find("review_comments") != j.end() && !j.at("review_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1463 | 1482 | x.set_review_comments(j.at("review_comments").get<int64_t>()); |
| 1464 | 1483 | x.set_review_comments_url(j.at("review_comments_url").get<std::string>()); |
| 1465 | 1484 | x.set_state(j.at("state").get<std::string>()); |
| @@ -1521,15 +1540,19 @@ namespace quicktype { | ||
| 1521 | 1540 | x.set_before(get_stack_optional<std::string>(j, "before")); |
| 1522 | 1541 | x.set_commits(get_stack_optional<std::vector<Commit>>(j, "commits")); |
| 1523 | 1542 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 1543 | + if (j.find("distinct_size") != j.end() && !j.at("distinct_size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1524 | 1544 | x.set_distinct_size(get_stack_optional<int64_t>(j, "distinct_size")); |
| 1525 | 1545 | x.set_head(get_stack_optional<std::string>(j, "head")); |
| 1526 | 1546 | x.set_master_branch(get_stack_optional<std::string>(j, "master_branch")); |
| 1547 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1527 | 1548 | x.set_number(get_stack_optional<int64_t>(j, "number")); |
| 1528 | 1549 | x.set_pull_request(get_stack_optional<PullRequest>(j, "pull_request")); |
| 1550 | + if (j.find("push_id") != j.end() && !j.at("push_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1529 | 1551 | x.set_push_id(get_stack_optional<int64_t>(j, "push_id")); |
| 1530 | 1552 | x.set_pusher_type(get_stack_optional<std::string>(j, "pusher_type")); |
| 1531 | 1553 | x.set_ref(get_stack_optional<std::string>(j, "ref")); |
| 1532 | 1554 | x.set_ref_type(get_stack_optional<std::string>(j, "ref_type")); |
| 1555 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1533 | 1556 | x.set_size(get_stack_optional<int64_t>(j, "size")); |
| 1534 | 1557 | } |
| 1535 | 1558 | |
| @@ -1553,6 +1576,7 @@ namespace quicktype { | ||
| 1553 | 1576 | |
| 1554 | 1577 | inline void from_json(const json & j, TopLevelRepo& x) { |
| 1555 | 1578 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1579 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1556 | 1580 | x.set_id(j.at("id").get<int64_t>()); |
| 1557 | 1581 | x.set_name(j.at("name").get<std::string>()); |
| 1558 | 1582 | x.set_url(j.at("url").get<std::string>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/0b91a.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -238,6 +238,7 @@ namespace quicktype { | ||
| 238 | 238 | inline void from_json(const json & j, ResponseInfo& x) { |
| 239 | 239 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 240 | 240 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 241 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 242 | x.set_status(j.at("status").get<int64_t>()); |
| 242 | 243 | } |
| 243 | 244 | |
| @@ -249,8 +250,11 @@ namespace quicktype { | ||
| 249 | 250 | |
| 250 | 251 | inline void from_json(const json & j, Resultset& x) { |
| 251 | 252 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 253 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 252 | 254 | x.set_count(j.at("count").get<int64_t>()); |
| 255 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 253 | 256 | x.set_page(j.at("page").get<int64_t>()); |
| 257 | + if (j.find("pagesize") != j.end() && !j.at("pagesize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 254 | 258 | x.set_pagesize(j.at("pagesize").get<int64_t>()); |
| 255 | 259 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/0cffa.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -760,6 +760,7 @@ namespace quicktype { | ||
| 760 | 760 | x.set_id(j.at("id").get<std::string>()); |
| 761 | 761 | x.set_images(j.at("images").get<Images>()); |
| 762 | 762 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 763 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 763 | 764 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 764 | 765 | x.set_rating(j.at("rating").get<Rating>()); |
| 765 | 766 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -799,6 +800,7 @@ namespace quicktype { | ||
| 799 | 800 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 800 | 801 | x.set_msg(j.at("msg").get<std::string>()); |
| 801 | 802 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 803 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 802 | 804 | x.set_status(j.at("status").get<int64_t>()); |
| 803 | 805 | } |
| 804 | 806 | |
| @@ -811,8 +813,11 @@ namespace quicktype { | ||
| 811 | 813 | |
| 812 | 814 | inline void from_json(const json & j, Pagination& x) { |
| 813 | 815 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 816 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 814 | 817 | x.set_count(j.at("count").get<int64_t>()); |
| 818 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 815 | 819 | x.set_offset(j.at("offset").get<int64_t>()); |
| 820 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 821 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 817 | 822 | } |
Test case
1 generated file · +13 −0test/inputs/json/misc/0e0c2.json
Mcplusplusdefault / quicktype.hpp+13 −0
| @@ -426,6 +426,7 @@ namespace quicktype { | ||
| 426 | 426 | |
| 427 | 427 | inline void from_json(const json & j, Collection& x) { |
| 428 | 428 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 429 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 429 | 430 | x.set_id(j.at("id").get<int64_t>()); |
| 430 | 431 | x.set_movies(j.at("movies").get<std::vector<int64_t>>()); |
| 431 | 432 | x.set_name(j.at("name").get<std::string>()); |
| @@ -444,6 +445,7 @@ namespace quicktype { | ||
| 444 | 445 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 445 | 446 | x.set_cast(j.at("cast").get<std::string>()); |
| 446 | 447 | x.set_director(j.at("director").get<std::string>()); |
| 448 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 447 | 449 | x.set_id(j.at("id").get<int64_t>()); |
| 448 | 450 | x.set_language(j.at("language").get<DetailLanguage>()); |
| 449 | 451 | x.set_storyline(j.at("storyline").get<std::string>()); |
| @@ -478,7 +480,9 @@ namespace quicktype { | ||
| 478 | 480 | |
| 479 | 481 | inline void from_json(const json & j, Image& x) { |
| 480 | 482 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 483 | + if (j.find("favs") != j.end() && !j.at("favs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 481 | 484 | x.set_favs(j.at("favs").get<int64_t>()); |
| 485 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 482 | 486 | x.set_id(j.at("id").get<int64_t>()); |
| 483 | 487 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 484 | 488 | x.set_type(j.at("type").get<Type>()); |
| @@ -512,8 +516,11 @@ namespace quicktype { | ||
| 512 | 516 | |
| 513 | 517 | inline void from_json(const json & j, VoteScore& x) { |
| 514 | 518 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 519 | + if (j.find("avg") != j.end() && !j.at("avg").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 515 | 520 | x.set_avg(j.at("avg").get<int64_t>()); |
| 521 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 516 | 522 | x.set_score(j.at("score").get<int64_t>()); |
| 523 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 517 | 524 | x.set_total(j.at("total").get<int64_t>()); |
| 518 | 525 | } |
| 519 | 526 | |
| @@ -526,20 +533,25 @@ namespace quicktype { | ||
| 526 | 533 | |
| 527 | 534 | inline void from_json(const json & j, Result& x) { |
| 528 | 535 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 536 | + if (j.find("active_screens") != j.end() && !j.at("active_screens").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 529 | 537 | x.set_active_screens(j.at("active_screens").get<int64_t>()); |
| 530 | 538 | x.set_collections(j.at("collections").get<std::vector<Collection>>()); |
| 531 | 539 | x.set_details(j.at("details").get<std::vector<Detail>>()); |
| 540 | + if (j.find("duration") != j.end() && !j.at("duration").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 532 | 541 | x.set_duration(j.at("duration").get<int64_t>()); |
| 533 | 542 | x.set_fav_movie(j.at("fav_movie").get<FavMovie>()); |
| 543 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 534 | 544 | x.set_id(j.at("id").get<int64_t>()); |
| 535 | 545 | x.set_images(j.at("images").get<std::vector<Image>>()); |
| 536 | 546 | x.set_language(j.at("language").get<ResultLanguage>()); |
| 537 | 547 | x.set_release_date(j.at("release_date").get<std::string>()); |
| 548 | + if (j.find("stars") != j.end() && !j.at("stars").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 538 | 549 | x.set_stars(j.at("stars").get<int64_t>()); |
| 539 | 550 | x.set_tags(get_stack_optional<std::vector<nlohmann::json>>(j, "tags")); |
| 540 | 551 | x.set_title(j.at("title").get<std::string>()); |
| 541 | 552 | x.set_videos(j.at("videos").get<std::vector<Video>>()); |
| 542 | 553 | x.set_vote_score(j.at("vote_score").get<VoteScore>()); |
| 554 | + if (j.find("watches") != j.end() && !j.at("watches").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 543 | 555 | x.set_watches(j.at("watches").get<int64_t>()); |
| 544 | 556 | } |
| 545 | 557 | |
| @@ -564,6 +576,7 @@ namespace quicktype { | ||
| 564 | 576 | |
| 565 | 577 | inline void from_json(const json & j, TopLevel& x) { |
| 566 | 578 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 579 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 567 | 580 | x.set_count(j.at("count").get<int64_t>()); |
| 568 | 581 | x.set_next(j.at("next").get<std::string>()); |
| 569 | 582 | x.set_previous(get_untyped(j, "previous")); |
Test case
1 generated file · +5 −0test/inputs/json/misc/127a1.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -760,6 +760,7 @@ namespace quicktype { | ||
| 760 | 760 | x.set_id(j.at("id").get<std::string>()); |
| 761 | 761 | x.set_images(j.at("images").get<Images>()); |
| 762 | 762 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 763 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 763 | 764 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 764 | 765 | x.set_rating(j.at("rating").get<Rating>()); |
| 765 | 766 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -799,6 +800,7 @@ namespace quicktype { | ||
| 799 | 800 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 800 | 801 | x.set_msg(j.at("msg").get<std::string>()); |
| 801 | 802 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 803 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 802 | 804 | x.set_status(j.at("status").get<int64_t>()); |
| 803 | 805 | } |
| 804 | 806 | |
| @@ -811,8 +813,11 @@ namespace quicktype { | ||
| 811 | 813 | |
| 812 | 814 | inline void from_json(const json & j, Pagination& x) { |
| 813 | 815 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 816 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 814 | 817 | x.set_count(j.at("count").get<int64_t>()); |
| 818 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 815 | 819 | x.set_offset(j.at("offset").get<int64_t>()); |
| 820 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 821 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 817 | 822 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/13d8d.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -165,6 +165,7 @@ namespace quicktype { | ||
| 165 | 165 | |
| 166 | 166 | inline void from_json(const json & j, Street& x) { |
| 167 | 167 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 168 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 168 | 169 | x.set_id(j.at("id").get<int64_t>()); |
| 169 | 170 | x.set_name(j.at("name").get<std::string>()); |
| 170 | 171 | } |
| @@ -205,6 +206,7 @@ namespace quicktype { | ||
| 205 | 206 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 206 | 207 | x.set_category(j.at("category").get<std::string>()); |
| 207 | 208 | x.set_context(j.at("context").get<std::string>()); |
| 209 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 208 | 210 | x.set_id(j.at("id").get<int64_t>()); |
| 209 | 211 | x.set_location(j.at("location").get<Location>()); |
| 210 | 212 | x.set_location_subtype(j.at("location_subtype").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/16bc5.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/176f1.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -275,6 +275,7 @@ namespace quicktype { | ||
| 275 | 275 | inline void from_json(const json & j, TopLevel& x) { |
| 276 | 276 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 277 | 277 | x.set_message(j.at("message").get<std::vector<nlohmann::json>>()); |
| 278 | + if (j.find("responseTime") != j.end() && !j.at("responseTime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 278 | 279 | x.set_response_time(j.at("responseTime").get<int64_t>()); |
| 279 | 280 | x.set_results(j.at("Results").get<Results>()); |
| 280 | 281 | x.set_status(j.at("status").get<std::string>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/1a7f5.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/1b28c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +7 −0test/inputs/json/misc/1b409.json
Mcplusplusdefault / quicktype.hpp+7 −0
| @@ -427,8 +427,11 @@ namespace quicktype { | ||
| 427 | 427 | |
| 428 | 428 | inline void from_json(const json & j, Meta& x) { |
| 429 | 429 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 430 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 430 | 431 | x.set_limit(j.at("limit").get<int64_t>()); |
| 432 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 431 | 433 | x.set_offset(j.at("offset").get<int64_t>()); |
| 434 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 432 | 435 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 433 | 436 | } |
| 434 | 437 | |
| @@ -461,10 +464,12 @@ namespace quicktype { | ||
| 461 | 464 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 462 | 465 | x.set_bioguideid(j.at("bioguideid").get<std::string>()); |
| 463 | 466 | x.set_birthday(j.at("birthday").get<std::string>()); |
| 467 | + if (j.find("cspanid") != j.end() && !j.at("cspanid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 464 | 468 | x.set_cspanid(j.at("cspanid").get<int64_t>()); |
| 465 | 469 | x.set_firstname(j.at("firstname").get<std::string>()); |
| 466 | 470 | x.set_gender(j.at("gender").get<Gender>()); |
| 467 | 471 | x.set_gender_label(j.at("gender_label").get<GenderLabel>()); |
| 472 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 468 | 473 | x.set_id(j.at("id").get<int64_t>()); |
| 469 | 474 | x.set_lastname(j.at("lastname").get<std::string>()); |
| 470 | 475 | x.set_link(j.at("link").get<std::string>()); |
| @@ -507,9 +512,11 @@ namespace quicktype { | ||
| 507 | 512 | x.set_congress_numbers(j.at("congress_numbers").get<std::vector<int64_t>>()); |
| 508 | 513 | x.set_current(j.at("current").get<bool>()); |
| 509 | 514 | x.set_description(j.at("description").get<std::string>()); |
| 515 | + if (j.find("district") != j.end() && !j.at("district").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 510 | 516 | x.set_district(j.at("district").get<int64_t>()); |
| 511 | 517 | x.set_enddate(j.at("enddate").get<std::string>()); |
| 512 | 518 | x.set_extra(j.at("extra").get<Extra>()); |
| 519 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 513 | 520 | x.set_id(j.at("id").get<int64_t>()); |
| 514 | 521 | x.set_leadership_title(get_stack_optional<std::string>(j, "leadership_title")); |
| 515 | 522 | x.set_party(j.at("party").get<Party>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/262f0.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -714,6 +714,7 @@ namespace quicktype { | ||
| 714 | 714 | |
| 715 | 715 | inline void from_json(const json & j, Query& x) { |
| 716 | 716 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 717 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 717 | 718 | x.set_count(j.at("count").get<int64_t>()); |
| 718 | 719 | x.set_created(j.at("created").get<std::string>()); |
| 719 | 720 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/26b49.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -762,6 +762,7 @@ namespace quicktype { | ||
| 762 | 762 | x.set_id(j.at("id").get<std::string>()); |
| 763 | 763 | x.set_images(j.at("images").get<Images>()); |
| 764 | 764 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 765 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 765 | 766 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 766 | 767 | x.set_rating(j.at("rating").get<Rating>()); |
| 767 | 768 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -801,6 +802,7 @@ namespace quicktype { | ||
| 801 | 802 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 802 | 803 | x.set_msg(j.at("msg").get<std::string>()); |
| 803 | 804 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 805 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 804 | 806 | x.set_status(j.at("status").get<int64_t>()); |
| 805 | 807 | } |
| 806 | 808 | |
| @@ -813,8 +815,11 @@ namespace quicktype { | ||
| 813 | 815 | |
| 814 | 816 | inline void from_json(const json & j, Pagination& x) { |
| 815 | 817 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 818 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 819 | x.set_count(j.at("count").get<int64_t>()); |
| 820 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 817 | 821 | x.set_offset(j.at("offset").get<int64_t>()); |
| 822 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 818 | 823 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 819 | 824 | } |
Test case
1 generated file · +21 −0test/inputs/json/misc/26c9c.json
Mcplusplusdefault / quicktype.hpp+21 −0
| @@ -976,6 +976,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 976 | 976 | namespace quicktype { |
| 977 | 977 | inline void from_json(const json & j, Top& x) { |
| 978 | 978 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 979 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 979 | 980 | x.set_count(j.at("count").get<int64_t>()); |
| 980 | 981 | x.set_item(j.at("item").get<std::string>()); |
| 981 | 982 | } |
| @@ -990,7 +991,9 @@ namespace quicktype { | ||
| 990 | 991 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 991 | 992 | x.set_average(get_stack_optional<std::string>(j, "average")); |
| 992 | 993 | x.set_largest(j.at("largest").get<std::string>()); |
| 994 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 993 | 995 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 996 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 994 | 997 | x.set_null(j.at("null").get<int64_t>()); |
| 995 | 998 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 996 | 999 | x.set_sum(get_stack_optional<std::string>(j, "sum")); |
| @@ -1031,11 +1034,15 @@ namespace quicktype { | ||
| 1031 | 1034 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 1032 | 1035 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 1033 | 1036 | x.set_format(j.at("format").get<Format>()); |
| 1037 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1034 | 1038 | x.set_id(j.at("id").get<int64_t>()); |
| 1035 | 1039 | x.set_name(j.at("name").get<std::string>()); |
| 1040 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1036 | 1041 | x.set_position(j.at("position").get<int64_t>()); |
| 1037 | 1042 | x.set_render_type_name(j.at("renderTypeName").get<std::string>()); |
| 1043 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1038 | 1044 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 1045 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1039 | 1046 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 1040 | 1047 | } |
| 1041 | 1048 | |
| @@ -1262,6 +1269,7 @@ namespace quicktype { | ||
| 1262 | 1269 | |
| 1263 | 1270 | inline void from_json(const json & j, Expression& x) { |
| 1264 | 1271 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1272 | + if (j.find("columnId") != j.end() && !j.at("columnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1265 | 1273 | x.set_column_id(j.at("columnId").get<int64_t>()); |
| 1266 | 1274 | x.set_type(j.at("type").get<std::string>()); |
| 1267 | 1275 | } |
| @@ -1298,40 +1306,53 @@ namespace quicktype { | ||
| 1298 | 1306 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1299 | 1307 | x.set_attribution(j.at("attribution").get<std::string>()); |
| 1300 | 1308 | x.set_attribution_link(j.at("attributionLink").get<std::string>()); |
| 1309 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1301 | 1310 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 1302 | 1311 | x.set_category(j.at("category").get<std::string>()); |
| 1303 | 1312 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 1313 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1304 | 1314 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 1305 | 1315 | x.set_description(j.at("description").get<std::string>()); |
| 1306 | 1316 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 1317 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1307 | 1318 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 1308 | 1319 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 1309 | 1320 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 1310 | 1321 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 1311 | 1322 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 1312 | 1323 | x.set_id(j.at("id").get<std::string>()); |
| 1324 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1313 | 1325 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 1314 | 1326 | x.set_locale(j.at("locale").get<std::string>()); |
| 1315 | 1327 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 1316 | 1328 | x.set_name(j.at("name").get<std::string>()); |
| 1317 | 1329 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 1330 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1318 | 1331 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 1332 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1319 | 1333 | x.set_oid(j.at("oid").get<int64_t>()); |
| 1320 | 1334 | x.set_owner(j.at("owner").get<Owner>()); |
| 1321 | 1335 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 1322 | 1336 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 1337 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1323 | 1338 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 1339 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1324 | 1340 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 1325 | 1341 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 1326 | 1342 | x.set_query(j.at("query").get<Query>()); |
| 1327 | 1343 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 1344 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1328 | 1345 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 1329 | 1346 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 1330 | 1347 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 1348 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1331 | 1349 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 1332 | 1350 | x.set_tags(j.at("tags").get<std::vector<std::string>>()); |
| 1351 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1333 | 1352 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 1353 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1334 | 1354 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 1355 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1335 | 1356 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 1336 | 1357 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 1337 | 1358 | } |
Test case
1 generated file · +13 −0test/inputs/json/misc/27332.json
Mcplusplusdefault / quicktype.hpp+13 −0
| @@ -746,16 +746,20 @@ namespace quicktype { | ||
| 746 | 746 | inline void from_json(const json & j, Oembed& x) { |
| 747 | 747 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 748 | 748 | x.set_description(j.at("description").get<std::string>()); |
| 749 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 749 | 750 | x.set_height(j.at("height").get<int64_t>()); |
| 750 | 751 | x.set_html(j.at("html").get<std::string>()); |
| 751 | 752 | x.set_provider_name(j.at("provider_name").get<std::string>()); |
| 752 | 753 | x.set_provider_url(j.at("provider_url").get<std::string>()); |
| 754 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 753 | 755 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 754 | 756 | x.set_thumbnail_url(j.at("thumbnail_url").get<std::string>()); |
| 757 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 755 | 758 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 756 | 759 | x.set_title(j.at("title").get<std::string>()); |
| 757 | 760 | x.set_type(j.at("type").get<std::string>()); |
| 758 | 761 | x.set_version(j.at("version").get<std::string>()); |
| 762 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 759 | 763 | x.set_width(j.at("width").get<int64_t>()); |
| 760 | 764 | } |
| 761 | 765 | |
| @@ -790,8 +794,10 @@ namespace quicktype { | ||
| 790 | 794 | inline void from_json(const json & j, MediaEmbed& x) { |
| 791 | 795 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 792 | 796 | x.set_content(get_stack_optional<std::string>(j, "content")); |
| 797 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 793 | 798 | x.set_height(get_stack_optional<int64_t>(j, "height")); |
| 794 | 799 | x.set_scrolling(get_stack_optional<bool>(j, "scrolling")); |
| 800 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 795 | 801 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 796 | 802 | } |
| 797 | 803 | |
| @@ -805,8 +811,10 @@ namespace quicktype { | ||
| 805 | 811 | |
| 806 | 812 | inline void from_json(const json & j, Source& x) { |
| 807 | 813 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 814 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 808 | 815 | x.set_height(j.at("height").get<int64_t>()); |
| 809 | 816 | x.set_url(j.at("url").get<std::string>()); |
| 817 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 810 | 818 | x.set_width(j.at("width").get<int64_t>()); |
| 811 | 819 | } |
| 812 | 820 | |
| @@ -875,8 +883,10 @@ namespace quicktype { | ||
| 875 | 883 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 876 | 884 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 877 | 885 | x.set_domain(j.at("domain").get<Domain>()); |
| 886 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 878 | 887 | x.set_downs(j.at("downs").get<int64_t>()); |
| 879 | 888 | x.set_edited(j.at("edited").get<bool>()); |
| 889 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 880 | 890 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 881 | 891 | x.set_hidden(j.at("hidden").get<bool>()); |
| 882 | 892 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -891,6 +901,7 @@ namespace quicktype { | ||
| 891 | 901 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 892 | 902 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 893 | 903 | x.set_name(j.at("name").get<std::string>()); |
| 904 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 894 | 905 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 895 | 906 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 896 | 907 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -901,6 +912,7 @@ namespace quicktype { | ||
| 901 | 912 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 902 | 913 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 903 | 914 | x.set_saved(j.at("saved").get<bool>()); |
| 915 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 904 | 916 | x.set_score(j.at("score").get<int64_t>()); |
| 905 | 917 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 906 | 918 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -917,6 +929,7 @@ namespace quicktype { | ||
| 917 | 929 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 918 | 930 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 919 | 931 | x.set_title(j.at("title").get<std::string>()); |
| 932 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 920 | 933 | x.set_ups(j.at("ups").get<int64_t>()); |
| 921 | 934 | x.set_url(j.at("url").get<std::string>()); |
| 922 | 935 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +7 −0test/inputs/json/misc/29f47.json
Mcplusplusdefault / quicktype.hpp+7 −0
| @@ -696,8 +696,10 @@ namespace quicktype { | ||
| 696 | 696 | |
| 697 | 697 | inline void from_json(const json & j, Source& x) { |
| 698 | 698 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 699 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 699 | 700 | x.set_height(j.at("height").get<int64_t>()); |
| 700 | 701 | x.set_url(j.at("url").get<std::string>()); |
| 702 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 701 | 703 | x.set_width(j.at("width").get<int64_t>()); |
| 702 | 704 | } |
| 703 | 705 | |
| @@ -779,8 +781,10 @@ namespace quicktype { | ||
| 779 | 781 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 780 | 782 | x.set_distinguished(j.at("distinguished").get<Distinguished>()); |
| 781 | 783 | x.set_domain(j.at("domain").get<Domain>()); |
| 784 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 782 | 785 | x.set_downs(j.at("downs").get<int64_t>()); |
| 783 | 786 | x.set_edited(j.at("edited").get<Edited>()); |
| 787 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 784 | 788 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 785 | 789 | x.set_hidden(j.at("hidden").get<bool>()); |
| 786 | 790 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -795,6 +799,7 @@ namespace quicktype { | ||
| 795 | 799 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 796 | 800 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 797 | 801 | x.set_name(j.at("name").get<std::string>()); |
| 802 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 798 | 803 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 799 | 804 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 800 | 805 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -805,6 +810,7 @@ namespace quicktype { | ||
| 805 | 810 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 806 | 811 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 807 | 812 | x.set_saved(j.at("saved").get<bool>()); |
| 813 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 808 | 814 | x.set_score(j.at("score").get<int64_t>()); |
| 809 | 815 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 810 | 816 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -821,6 +827,7 @@ namespace quicktype { | ||
| 821 | 827 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 822 | 828 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 823 | 829 | x.set_title(j.at("title").get<std::string>()); |
| 830 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 824 | 831 | x.set_ups(j.at("ups").get<int64_t>()); |
| 825 | 832 | x.set_url(j.at("url").get<std::string>()); |
| 826 | 833 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +6 −0test/inputs/json/misc/2d4e2.json
Mcplusplusdefault / quicktype.hpp+6 −0
| @@ -458,8 +458,11 @@ namespace quicktype { | ||
| 458 | 458 | |
| 459 | 459 | inline void from_json(const json & j, Meta& x) { |
| 460 | 460 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 461 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 461 | 462 | x.set_limit(j.at("limit").get<int64_t>()); |
| 463 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 462 | 464 | x.set_offset(j.at("offset").get<int64_t>()); |
| 465 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 463 | 466 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 464 | 467 | } |
| 465 | 468 | |
| @@ -492,10 +495,12 @@ namespace quicktype { | ||
| 492 | 495 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 493 | 496 | x.set_bioguideid(j.at("bioguideid").get<std::string>()); |
| 494 | 497 | x.set_birthday(j.at("birthday").get<std::string>()); |
| 498 | + if (j.find("cspanid") != j.end() && !j.at("cspanid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 495 | 499 | x.set_cspanid(j.at("cspanid").get<int64_t>()); |
| 496 | 500 | x.set_firstname(j.at("firstname").get<std::string>()); |
| 497 | 501 | x.set_gender(j.at("gender").get<Gender>()); |
| 498 | 502 | x.set_gender_label(j.at("gender_label").get<GenderLabel>()); |
| 503 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 499 | 504 | x.set_id(j.at("id").get<int64_t>()); |
| 500 | 505 | x.set_lastname(j.at("lastname").get<std::string>()); |
| 501 | 506 | x.set_link(j.at("link").get<std::string>()); |
| @@ -541,6 +546,7 @@ namespace quicktype { | ||
| 541 | 546 | x.set_district(get_untyped(j, "district")); |
| 542 | 547 | x.set_enddate(j.at("enddate").get<std::string>()); |
| 543 | 548 | x.set_extra(j.at("extra").get<Extra>()); |
| 549 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 544 | 550 | x.set_id(j.at("id").get<int64_t>()); |
| 545 | 551 | x.set_leadership_title(get_stack_optional<std::string>(j, "leadership_title")); |
| 546 | 552 | x.set_party(j.at("party").get<Party>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/2df80.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -271,9 +271,12 @@ namespace quicktype { | ||
| 271 | 271 | |
| 272 | 272 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 273 | 273 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 274 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 274 | 275 | x.set_page(j.at("page").get<int64_t>()); |
| 276 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 275 | 277 | x.set_pages(j.at("pages").get<int64_t>()); |
| 276 | 278 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 279 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 277 | 280 | x.set_total(j.at("total").get<int64_t>()); |
| 278 | 281 | } |
Test case
1 generated file · +8 −0test/inputs/json/misc/32431.json
Mcplusplusdefault / quicktype.hpp+8 −0
| @@ -410,15 +410,20 @@ namespace quicktype { | ||
| 410 | 410 | x.set_nst(get_stack_optional<int64_t>(j, "nst")); |
| 411 | 411 | x.set_place(j.at("place").get<std::string>()); |
| 412 | 412 | x.set_rms(j.at("rms").get<double>()); |
| 413 | + if (j.find("sig") != j.end() && !j.at("sig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 413 | 414 | x.set_sig(j.at("sig").get<int64_t>()); |
| 414 | 415 | x.set_sources(j.at("sources").get<std::string>()); |
| 415 | 416 | x.set_status(j.at("status").get<Status>()); |
| 417 | + if (j.find("time") != j.end() && !j.at("time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 416 | 418 | x.set_time(j.at("time").get<int64_t>()); |
| 417 | 419 | x.set_title(j.at("title").get<std::string>()); |
| 420 | + if (j.find("tsunami") != j.end() && !j.at("tsunami").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 418 | 421 | x.set_tsunami(j.at("tsunami").get<int64_t>()); |
| 419 | 422 | x.set_type(j.at("type").get<PropertiesType>()); |
| 420 | 423 | x.set_types(j.at("types").get<std::string>()); |
| 424 | + if (j.find("tz") != j.end() && !j.at("tz").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 421 | 425 | x.set_tz(j.at("tz").get<int64_t>()); |
| 426 | + if (j.find("updated") != j.end() && !j.at("updated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 422 | 427 | x.set_updated(j.at("updated").get<int64_t>()); |
| 423 | 428 | x.set_url(j.at("url").get<std::string>()); |
| 424 | 429 | } |
| @@ -472,8 +477,11 @@ namespace quicktype { | ||
| 472 | 477 | inline void from_json(const json & j, Metadata& x) { |
| 473 | 478 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 474 | 479 | x.set_api(j.at("api").get<std::string>()); |
| 480 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 475 | 481 | x.set_count(j.at("count").get<int64_t>()); |
| 482 | + if (j.find("generated") != j.end() && !j.at("generated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 476 | 483 | x.set_generated(j.at("generated").get<int64_t>()); |
| 484 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 477 | 485 | x.set_status(j.at("status").get<int64_t>()); |
| 478 | 486 | x.set_title(j.at("title").get<std::string>()); |
| 479 | 487 | x.set_url(j.at("url").get<std::string>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/32d5c.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -146,9 +146,11 @@ namespace quicktype { | ||
| 146 | 146 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 147 | 147 | x.set_birth_date(get_stack_optional<std::string>(j, "BirthDate")); |
| 148 | 148 | x.set_birth_date_is_protected(j.at("BirthDateIsProtected").get<bool>()); |
| 149 | + if (j.find("GenderTypeID") != j.end() && !j.at("GenderTypeID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 149 | 150 | x.set_gender_type_id(j.at("GenderTypeID").get<int64_t>()); |
| 150 | 151 | x.set_notes(j.at("Notes").get<std::string>()); |
| 151 | 152 | x.set_parliamentary_name(j.at("ParliamentaryName").get<std::string>()); |
| 153 | + if (j.find("PersonID") != j.end() && !j.at("PersonID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 152 | 154 | x.set_person_id(j.at("PersonID").get<int64_t>()); |
| 153 | 155 | x.set_photo_url(j.at("PhotoURL").get<std::string>()); |
| 154 | 156 | x.set_preferred_name(j.at("PreferredName").get<std::string>()); |
Test case
1 generated file · +6 −0test/inputs/json/misc/337ed.json
Mcplusplusdefault / quicktype.hpp+6 −0
| @@ -384,6 +384,7 @@ namespace quicktype { | ||
| 384 | 384 | |
| 385 | 385 | inline void from_json(const json & j, CustomIncome& x) { |
| 386 | 386 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 387 | + if (j.find("amount") != j.end() && !j.at("amount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 387 | 388 | x.set_amount(j.at("amount").get<int64_t>()); |
| 388 | 389 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 389 | 390 | x.set_id(j.at("id").get<std::string>()); |
| @@ -416,8 +417,10 @@ namespace quicktype { | ||
| 416 | 417 | x.set_direct_rep_costs_max(get_untyped(j, "direct_rep_costs_max")); |
| 417 | 418 | x.set_direct_rep_costs_min(get_untyped(j, "direct_rep_costs_min")); |
| 418 | 419 | x.set_end_date(j.at("end_date").get<std::string>()); |
| 420 | + if (j.find("eur_sources_grants") != j.end() && !j.at("eur_sources_grants").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 419 | 421 | x.set_eur_sources_grants(j.at("eur_sources_grants").get<int64_t>()); |
| 420 | 422 | x.set_eur_sources_grants_src(get_stack_optional<std::string>(j, "eur_sources_grants_src")); |
| 423 | + if (j.find("eur_sources_procurement") != j.end() && !j.at("eur_sources_procurement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 421 | 424 | x.set_eur_sources_procurement(j.at("eur_sources_procurement").get<int64_t>()); |
| 422 | 425 | x.set_eur_sources_procurement_src(get_stack_optional<std::string>(j, "eur_sources_procurement_src")); |
| 423 | 426 | x.set_id(j.at("id").get<std::string>()); |
| @@ -480,10 +483,13 @@ namespace quicktype { | ||
| 480 | 483 | |
| 481 | 484 | inline void from_json(const json & j, TopLevel& x) { |
| 482 | 485 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 486 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 483 | 487 | x.set_count(j.at("count").get<int64_t>()); |
| 484 | 488 | x.set_facets(j.at("facets").get<Facets>()); |
| 489 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 485 | 490 | x.set_limit(j.at("limit").get<int64_t>()); |
| 486 | 491 | x.set_next(j.at("next").get<std::string>()); |
| 492 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 487 | 493 | x.set_offset(j.at("offset").get<int64_t>()); |
| 488 | 494 | x.set_previous(j.at("previous").get<bool>()); |
| 489 | 495 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/34702.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -378,6 +378,7 @@ namespace quicktype { | ||
| 378 | 378 | x.set_longitude(j.at("longitude").get<double>()); |
| 379 | 379 | x.set_no(get_stack_optional<std::string>(j, "no")); |
| 380 | 380 | x.set_phone(j.at("phone").get<double>()); |
| 381 | + if (j.find("postcode") != j.end() && !j.at("postcode").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 381 | 382 | x.set_postcode(j.at("postcode").get<int64_t>()); |
| 382 | 383 | x.set_psa(j.at("psa").get<std::string>()); |
| 383 | 384 | x.set_region(j.at("region").get<Region>()); |
| @@ -428,6 +429,7 @@ namespace quicktype { | ||
| 428 | 429 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 429 | 430 | x.set_crs(j.at("crs").get<Crs>()); |
| 430 | 431 | x.set_features(j.at("features").get<std::vector<Feature>>()); |
| 432 | + if (j.find("totalFeatures") != j.end() && !j.at("totalFeatures").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 431 | 433 | x.set_total_features(j.at("totalFeatures").get<int64_t>()); |
| 432 | 434 | x.set_type(j.at("type").get<std::string>()); |
| 433 | 435 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/3659d.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/3e9a3.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -275,6 +275,7 @@ namespace quicktype { | ||
| 275 | 275 | inline void from_json(const json & j, TopLevel& x) { |
| 276 | 276 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 277 | 277 | x.set_message(j.at("message").get<std::vector<nlohmann::json>>()); |
| 278 | + if (j.find("responseTime") != j.end() && !j.at("responseTime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 278 | 279 | x.set_response_time(j.at("responseTime").get<int64_t>()); |
| 279 | 280 | x.set_results(j.at("Results").get<Results>()); |
| 280 | 281 | x.set_status(j.at("status").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/3f1ce.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -714,6 +714,7 @@ namespace quicktype { | ||
| 714 | 714 | |
| 715 | 715 | inline void from_json(const json & j, Query& x) { |
| 716 | 716 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 717 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 717 | 718 | x.set_count(j.at("count").get<int64_t>()); |
| 718 | 719 | x.set_created(j.at("created").get<std::string>()); |
| 719 | 720 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +20 −0test/inputs/json/misc/421d4.json
Mcplusplusdefault / quicktype.hpp+20 −0
| @@ -645,6 +645,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 645 | 645 | namespace quicktype { |
| 646 | 646 | inline void from_json(const json & j, Top& x) { |
| 647 | 647 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 648 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 648 | 649 | x.set_count(j.at("count").get<int64_t>()); |
| 649 | 650 | x.set_item(j.at("item").get<std::string>()); |
| 650 | 651 | } |
| @@ -659,7 +660,9 @@ namespace quicktype { | ||
| 659 | 660 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 660 | 661 | x.set_average(get_stack_optional<std::string>(j, "average")); |
| 661 | 662 | x.set_largest(get_stack_optional<std::string>(j, "largest")); |
| 663 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 662 | 664 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 665 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 663 | 666 | x.set_null(j.at("null").get<int64_t>()); |
| 664 | 667 | x.set_smallest(get_stack_optional<std::string>(j, "smallest")); |
| 665 | 668 | x.set_sum(get_stack_optional<std::string>(j, "sum")); |
| @@ -695,11 +698,15 @@ namespace quicktype { | ||
| 695 | 698 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 696 | 699 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 697 | 700 | x.set_format(j.at("format").get<Query>()); |
| 701 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 698 | 702 | x.set_id(j.at("id").get<int64_t>()); |
| 699 | 703 | x.set_name(j.at("name").get<std::string>()); |
| 704 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 700 | 705 | x.set_position(j.at("position").get<int64_t>()); |
| 701 | 706 | x.set_render_type_name(j.at("renderTypeName").get<std::string>()); |
| 707 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 702 | 708 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 709 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 703 | 710 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 704 | 711 | } |
| 705 | 712 | |
| @@ -797,18 +804,22 @@ namespace quicktype { | ||
| 797 | 804 | inline void from_json(const json & j, View& x) { |
| 798 | 805 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 799 | 806 | x.set_attribution(j.at("attribution").get<std::string>()); |
| 807 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 800 | 808 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 801 | 809 | x.set_category(j.at("category").get<std::string>()); |
| 802 | 810 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 811 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 803 | 812 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 804 | 813 | x.set_description(j.at("description").get<std::string>()); |
| 805 | 814 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 815 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 806 | 816 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 807 | 817 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 808 | 818 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 809 | 819 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 810 | 820 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 811 | 821 | x.set_id(j.at("id").get<std::string>()); |
| 822 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 812 | 823 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 813 | 824 | x.set_license(j.at("license").get<License>()); |
| 814 | 825 | x.set_license_id(j.at("licenseId").get<std::string>()); |
| @@ -816,24 +827,33 @@ namespace quicktype { | ||
| 816 | 827 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 817 | 828 | x.set_name(j.at("name").get<std::string>()); |
| 818 | 829 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 830 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 819 | 831 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 832 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 820 | 833 | x.set_oid(j.at("oid").get<int64_t>()); |
| 821 | 834 | x.set_owner(j.at("owner").get<Owner>()); |
| 822 | 835 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 823 | 836 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 837 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 824 | 838 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 839 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 825 | 840 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 826 | 841 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 827 | 842 | x.set_query(j.at("query").get<Query>()); |
| 828 | 843 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 829 | 844 | x.set_row_class(j.at("rowClass").get<std::string>()); |
| 845 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 830 | 846 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 831 | 847 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 832 | 848 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 849 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 833 | 850 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 834 | 851 | x.set_tags(j.at("tags").get<std::vector<std::string>>()); |
| 852 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 835 | 853 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 854 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 836 | 855 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 856 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 837 | 857 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 838 | 858 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 839 | 859 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/437e7.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -741,6 +741,7 @@ namespace quicktype { | ||
| 741 | 741 | x.set_id(j.at("id").get<std::string>()); |
| 742 | 742 | x.set_images(j.at("images").get<Images>()); |
| 743 | 743 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 744 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 744 | 745 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 745 | 746 | x.set_rating(j.at("rating").get<Rating>()); |
| 746 | 747 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -780,6 +781,7 @@ namespace quicktype { | ||
| 780 | 781 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 781 | 782 | x.set_msg(j.at("msg").get<std::string>()); |
| 782 | 783 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 784 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 783 | 785 | x.set_status(j.at("status").get<int64_t>()); |
| 784 | 786 | } |
| 785 | 787 | |
| @@ -792,8 +794,11 @@ namespace quicktype { | ||
| 792 | 794 | |
| 793 | 795 | inline void from_json(const json & j, Pagination& x) { |
| 794 | 796 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 797 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 795 | 798 | x.set_count(j.at("count").get<int64_t>()); |
| 799 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 796 | 800 | x.set_offset(j.at("offset").get<int64_t>()); |
| 801 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 797 | 802 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 798 | 803 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/43970.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -64,6 +64,7 @@ namespace quicktype { | ||
| 64 | 64 | |
| 65 | 65 | inline void from_json(const json & j, TopLevelElement& x) { |
| 66 | 66 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 67 | + if (j.find("ID") != j.end() && !j.at("ID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 67 | 68 | x.set_id(j.at("ID").get<int64_t>()); |
| 68 | 69 | x.set_name(j.at("Name").get<std::string>()); |
| 69 | 70 | x.set_notes(j.at("Notes").get<std::string>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/458db.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -238,6 +238,7 @@ namespace quicktype { | ||
| 238 | 238 | inline void from_json(const json & j, ResponseInfo& x) { |
| 239 | 239 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 240 | 240 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 241 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 242 | x.set_status(j.at("status").get<int64_t>()); |
| 242 | 243 | } |
| 243 | 244 | |
| @@ -249,8 +250,11 @@ namespace quicktype { | ||
| 249 | 250 | |
| 250 | 251 | inline void from_json(const json & j, Resultset& x) { |
| 251 | 252 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 253 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 252 | 254 | x.set_count(j.at("count").get<int64_t>()); |
| 255 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 253 | 256 | x.set_page(j.at("page").get<int64_t>()); |
| 257 | + if (j.find("pagesize") != j.end() && !j.at("pagesize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 254 | 258 | x.set_pagesize(j.at("pagesize").get<int64_t>()); |
| 255 | 259 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/4961a.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/4a0d7.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/4a455.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -296,6 +296,7 @@ namespace quicktype { | ||
| 296 | 296 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 297 | 297 | x.set_crs(j.at("crs").get<Crs>()); |
| 298 | 298 | x.set_features(j.at("features").get<std::vector<Feature>>()); |
| 299 | + if (j.find("totalFeatures") != j.end() && !j.at("totalFeatures").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 299 | 300 | x.set_total_features(j.at("totalFeatures").get<int64_t>()); |
| 300 | 301 | x.set_type(j.at("type").get<std::string>()); |
| 301 | 302 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/4c547.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +13 −0test/inputs/json/misc/4d6fb.json
Mcplusplusdefault / quicktype.hpp+13 −0
| @@ -753,16 +753,20 @@ namespace quicktype { | ||
| 753 | 753 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 754 | 754 | x.set_author_name(j.at("author_name").get<std::string>()); |
| 755 | 755 | x.set_author_url(j.at("author_url").get<std::string>()); |
| 756 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 756 | 757 | x.set_height(j.at("height").get<int64_t>()); |
| 757 | 758 | x.set_html(j.at("html").get<std::string>()); |
| 758 | 759 | x.set_provider_name(j.at("provider_name").get<std::string>()); |
| 759 | 760 | x.set_provider_url(j.at("provider_url").get<std::string>()); |
| 761 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 760 | 762 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 761 | 763 | x.set_thumbnail_url(j.at("thumbnail_url").get<std::string>()); |
| 764 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 762 | 765 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 763 | 766 | x.set_title(j.at("title").get<std::string>()); |
| 764 | 767 | x.set_type(j.at("type").get<std::string>()); |
| 765 | 768 | x.set_version(j.at("version").get<std::string>()); |
| 769 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 766 | 770 | x.set_width(j.at("width").get<int64_t>()); |
| 767 | 771 | } |
| 768 | 772 | |
| @@ -798,8 +802,10 @@ namespace quicktype { | ||
| 798 | 802 | inline void from_json(const json & j, MediaEmbed& x) { |
| 799 | 803 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 800 | 804 | x.set_content(get_stack_optional<std::string>(j, "content")); |
| 805 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 801 | 806 | x.set_height(get_stack_optional<int64_t>(j, "height")); |
| 802 | 807 | x.set_scrolling(get_stack_optional<bool>(j, "scrolling")); |
| 808 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 803 | 809 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 804 | 810 | } |
| 805 | 811 | |
| @@ -813,8 +819,10 @@ namespace quicktype { | ||
| 813 | 819 | |
| 814 | 820 | inline void from_json(const json & j, Source& x) { |
| 815 | 821 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 822 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 823 | x.set_height(j.at("height").get<int64_t>()); |
| 817 | 824 | x.set_url(j.at("url").get<std::string>()); |
| 825 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 818 | 826 | x.set_width(j.at("width").get<int64_t>()); |
| 819 | 827 | } |
| 820 | 828 | |
| @@ -883,8 +891,10 @@ namespace quicktype { | ||
| 883 | 891 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 884 | 892 | x.set_distinguished(get_untyped(j, "distinguished")); |
| 885 | 893 | x.set_domain(j.at("domain").get<std::string>()); |
| 894 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 886 | 895 | x.set_downs(j.at("downs").get<int64_t>()); |
| 887 | 896 | x.set_edited(j.at("edited").get<bool>()); |
| 897 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 888 | 898 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 889 | 899 | x.set_hidden(j.at("hidden").get<bool>()); |
| 890 | 900 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -899,6 +909,7 @@ namespace quicktype { | ||
| 899 | 909 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 900 | 910 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 901 | 911 | x.set_name(j.at("name").get<std::string>()); |
| 912 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 902 | 913 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 903 | 914 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 904 | 915 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -909,6 +920,7 @@ namespace quicktype { | ||
| 909 | 920 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 910 | 921 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 911 | 922 | x.set_saved(j.at("saved").get<bool>()); |
| 923 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 912 | 924 | x.set_score(j.at("score").get<int64_t>()); |
| 913 | 925 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 914 | 926 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -925,6 +937,7 @@ namespace quicktype { | ||
| 925 | 937 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 926 | 938 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 927 | 939 | x.set_title(j.at("title").get<std::string>()); |
| 940 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 928 | 941 | x.set_ups(j.at("ups").get<int64_t>()); |
| 929 | 942 | x.set_url(j.at("url").get<std::string>()); |
| 930 | 943 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/4e336.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/54d32.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -173,10 +173,13 @@ namespace quicktype { | ||
| 173 | 173 | |
| 174 | 174 | inline void from_json(const json & j, TopLevel& x) { |
| 175 | 175 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 176 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 176 | 177 | x.set_count(j.at("count").get<int64_t>()); |
| 177 | 178 | x.set_facets(j.at("facets").get<Facets>()); |
| 179 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 178 | 180 | x.set_limit(j.at("limit").get<int64_t>()); |
| 179 | 181 | x.set_next(j.at("next").get<std::string>()); |
| 182 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 180 | 183 | x.set_offset(j.at("offset").get<int64_t>()); |
| 181 | 184 | x.set_previous(j.at("previous").get<bool>()); |
| 182 | 185 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/5eae5.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -70,6 +70,7 @@ namespace quicktype { | ||
| 70 | 70 | inline void from_json(const json & j, TopLevelElement& x) { |
| 71 | 71 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 72 | 72 | x.set_date(j.at("Date").get<std::string>()); |
| 73 | + if (j.find("ID") != j.end() && !j.at("ID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 73 | 74 | x.set_id(j.at("ID").get<int64_t>()); |
| 74 | 75 | x.set_sponsor(j.at("Sponsor").get<std::string>()); |
| 75 | 76 | x.set_title(j.at("Title").get<std::string>()); |
Test case
1 generated file · +21 −0test/inputs/json/misc/5f7fe.json
Mcplusplusdefault / quicktype.hpp+21 −0
| @@ -961,6 +961,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 961 | 961 | namespace quicktype { |
| 962 | 962 | inline void from_json(const json & j, Top& x) { |
| 963 | 963 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 964 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 964 | 965 | x.set_count(j.at("count").get<int64_t>()); |
| 965 | 966 | x.set_item(j.at("item").get<std::string>()); |
| 966 | 967 | } |
| @@ -974,7 +975,9 @@ namespace quicktype { | ||
| 974 | 975 | inline void from_json(const json & j, CachedContents& x) { |
| 975 | 976 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 976 | 977 | x.set_largest(j.at("largest").get<std::string>()); |
| 978 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 977 | 979 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 980 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 978 | 981 | x.set_null(j.at("null").get<int64_t>()); |
| 979 | 982 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 980 | 983 | x.set_top(j.at("top").get<std::vector<Top>>()); |
| @@ -1008,11 +1011,15 @@ namespace quicktype { | ||
| 1008 | 1011 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 1009 | 1012 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 1010 | 1013 | x.set_format(j.at("format").get<Format>()); |
| 1014 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1011 | 1015 | x.set_id(j.at("id").get<int64_t>()); |
| 1012 | 1016 | x.set_name(j.at("name").get<std::string>()); |
| 1017 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1013 | 1018 | x.set_position(j.at("position").get<int64_t>()); |
| 1014 | 1019 | x.set_render_type_name(j.at("renderTypeName").get<TypeName>()); |
| 1020 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1015 | 1021 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 1022 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1016 | 1023 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 1017 | 1024 | } |
| 1018 | 1025 | |
| @@ -1239,6 +1246,7 @@ namespace quicktype { | ||
| 1239 | 1246 | |
| 1240 | 1247 | inline void from_json(const json & j, Expression& x) { |
| 1241 | 1248 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1249 | + if (j.find("columnId") != j.end() && !j.at("columnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1242 | 1250 | x.set_column_id(j.at("columnId").get<int64_t>()); |
| 1243 | 1251 | x.set_type(j.at("type").get<std::string>()); |
| 1244 | 1252 | } |
| @@ -1275,40 +1283,53 @@ namespace quicktype { | ||
| 1275 | 1283 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1276 | 1284 | x.set_attribution(j.at("attribution").get<std::string>()); |
| 1277 | 1285 | x.set_attribution_link(j.at("attributionLink").get<std::string>()); |
| 1286 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1278 | 1287 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 1279 | 1288 | x.set_category(j.at("category").get<std::string>()); |
| 1280 | 1289 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 1290 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1281 | 1291 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 1282 | 1292 | x.set_description(j.at("description").get<std::string>()); |
| 1283 | 1293 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 1294 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1284 | 1295 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 1285 | 1296 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 1286 | 1297 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 1287 | 1298 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 1288 | 1299 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 1289 | 1300 | x.set_id(j.at("id").get<std::string>()); |
| 1301 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1290 | 1302 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 1291 | 1303 | x.set_locale(j.at("locale").get<std::string>()); |
| 1292 | 1304 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 1293 | 1305 | x.set_name(j.at("name").get<std::string>()); |
| 1294 | 1306 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 1307 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1295 | 1308 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 1309 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1296 | 1310 | x.set_oid(j.at("oid").get<int64_t>()); |
| 1297 | 1311 | x.set_owner(j.at("owner").get<Owner>()); |
| 1298 | 1312 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 1299 | 1313 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 1314 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1300 | 1315 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 1316 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1301 | 1317 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 1302 | 1318 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 1303 | 1319 | x.set_query(j.at("query").get<Query>()); |
| 1304 | 1320 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 1321 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1305 | 1322 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 1306 | 1323 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 1307 | 1324 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 1325 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1308 | 1326 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 1309 | 1327 | x.set_tags(j.at("tags").get<std::vector<std::string>>()); |
| 1328 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1310 | 1329 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 1330 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1311 | 1331 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 1332 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1312 | 1333 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 1313 | 1334 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 1314 | 1335 | } |
Test case
1 generated file · +21 −0test/inputs/json/misc/617e8.json
Mcplusplusdefault / quicktype.hpp+21 −0
| @@ -956,6 +956,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 956 | 956 | namespace quicktype { |
| 957 | 957 | inline void from_json(const json & j, Top& x) { |
| 958 | 958 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 959 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 959 | 960 | x.set_count(j.at("count").get<int64_t>()); |
| 960 | 961 | x.set_item(j.at("item").get<std::string>()); |
| 961 | 962 | } |
| @@ -969,7 +970,9 @@ namespace quicktype { | ||
| 969 | 970 | inline void from_json(const json & j, CachedContents& x) { |
| 970 | 971 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 971 | 972 | x.set_largest(j.at("largest").get<std::string>()); |
| 973 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 972 | 974 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 975 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 973 | 976 | x.set_null(j.at("null").get<int64_t>()); |
| 974 | 977 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 975 | 978 | x.set_top(j.at("top").get<std::vector<Top>>()); |
| @@ -1004,11 +1007,15 @@ namespace quicktype { | ||
| 1004 | 1007 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 1005 | 1008 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 1006 | 1009 | x.set_format(j.at("format").get<Format>()); |
| 1010 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1007 | 1011 | x.set_id(j.at("id").get<int64_t>()); |
| 1008 | 1012 | x.set_name(j.at("name").get<std::string>()); |
| 1013 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1009 | 1014 | x.set_position(j.at("position").get<int64_t>()); |
| 1010 | 1015 | x.set_render_type_name(j.at("renderTypeName").get<TypeName>()); |
| 1016 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1011 | 1017 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 1018 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1012 | 1019 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 1013 | 1020 | } |
| 1014 | 1021 | |
| @@ -1232,6 +1239,7 @@ namespace quicktype { | ||
| 1232 | 1239 | |
| 1233 | 1240 | inline void from_json(const json & j, Expression& x) { |
| 1234 | 1241 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1242 | + if (j.find("columnId") != j.end() && !j.at("columnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1235 | 1243 | x.set_column_id(j.at("columnId").get<int64_t>()); |
| 1236 | 1244 | x.set_type(j.at("type").get<std::string>()); |
| 1237 | 1245 | } |
| @@ -1268,40 +1276,53 @@ namespace quicktype { | ||
| 1268 | 1276 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1269 | 1277 | x.set_attribution(j.at("attribution").get<std::string>()); |
| 1270 | 1278 | x.set_attribution_link(j.at("attributionLink").get<std::string>()); |
| 1279 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1271 | 1280 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 1272 | 1281 | x.set_category(j.at("category").get<std::string>()); |
| 1273 | 1282 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 1283 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1274 | 1284 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 1275 | 1285 | x.set_description(j.at("description").get<std::string>()); |
| 1276 | 1286 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 1287 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1277 | 1288 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 1278 | 1289 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 1279 | 1290 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 1280 | 1291 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 1281 | 1292 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 1282 | 1293 | x.set_id(j.at("id").get<std::string>()); |
| 1294 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1283 | 1295 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 1284 | 1296 | x.set_locale(j.at("locale").get<std::string>()); |
| 1285 | 1297 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 1286 | 1298 | x.set_name(j.at("name").get<std::string>()); |
| 1287 | 1299 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 1300 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1288 | 1301 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 1302 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1289 | 1303 | x.set_oid(j.at("oid").get<int64_t>()); |
| 1290 | 1304 | x.set_owner(j.at("owner").get<Owner>()); |
| 1291 | 1305 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 1292 | 1306 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 1307 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1293 | 1308 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 1309 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1294 | 1310 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 1295 | 1311 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 1296 | 1312 | x.set_query(j.at("query").get<Query>()); |
| 1297 | 1313 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 1314 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1298 | 1315 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 1299 | 1316 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 1300 | 1317 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 1318 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1301 | 1319 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 1302 | 1320 | x.set_tags(j.at("tags").get<std::vector<std::string>>()); |
| 1321 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1303 | 1322 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 1323 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1304 | 1324 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 1325 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1305 | 1326 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 1306 | 1327 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 1307 | 1328 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/65dec.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -410,6 +410,7 @@ namespace quicktype { | ||
| 410 | 410 | inline void from_json(const json & j, Card& x) { |
| 411 | 411 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 412 | 412 | x.set_artist(j.at("artist").get<std::string>()); |
| 413 | + if (j.find("cmc") != j.end() && !j.at("cmc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 413 | 414 | x.set_cmc(j.at("cmc").get<int64_t>()); |
| 414 | 415 | x.set_color_identity(get_stack_optional<std::vector<ColorIdentity>>(j, "colorIdentity")); |
| 415 | 416 | x.set_colors(get_stack_optional<std::vector<Watermark>>(j, "colors")); |
| @@ -420,6 +421,7 @@ namespace quicktype { | ||
| 420 | 421 | x.set_legalities(j.at("legalities").get<std::vector<LegalityElement>>()); |
| 421 | 422 | x.set_mana_cost(get_stack_optional<std::string>(j, "manaCost")); |
| 422 | 423 | x.set_mci_number(get_stack_optional<std::string>(j, "mciNumber")); |
| 424 | + if (j.find("multiverseid") != j.end() && !j.at("multiverseid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 423 | 425 | x.set_multiverseid(j.at("multiverseid").get<int64_t>()); |
| 424 | 426 | x.set_name(j.at("name").get<std::string>()); |
| 425 | 427 | x.set_original_text(j.at("originalText").get<std::string>()); |
| @@ -479,6 +481,7 @@ namespace quicktype { | ||
| 479 | 481 | x.set_code(j.at("code").get<std::string>()); |
| 480 | 482 | x.set_gatherer_code(j.at("gathererCode").get<std::string>()); |
| 481 | 483 | x.set_magic_cards_info_code(j.at("magicCardsInfoCode").get<std::string>()); |
| 484 | + if (j.find("mkm_id") != j.end() && !j.at("mkm_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 482 | 485 | x.set_mkm_id(j.at("mkm_id").get<int64_t>()); |
| 483 | 486 | x.set_mkm_name(j.at("mkm_name").get<std::string>()); |
| 484 | 487 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/6617c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -98,6 +98,7 @@ namespace quicktype { | ||
| 98 | 98 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 99 | 99 | x.set_iss_position(j.at("iss_position").get<IssPosition>()); |
| 100 | 100 | x.set_message(j.at("message").get<std::string>()); |
| 101 | + if (j.find("timestamp") != j.end() && !j.at("timestamp").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 101 | 102 | x.set_timestamp(j.at("timestamp").get<int64_t>()); |
| 102 | 103 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/67c03.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -97,6 +97,7 @@ namespace quicktype { | ||
| 97 | 97 | inline void from_json(const json & j, TopLevel& x) { |
| 98 | 98 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 99 | 99 | x.set_message(j.at("message").get<std::string>()); |
| 100 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 100 | 101 | x.set_number(j.at("number").get<int64_t>()); |
| 101 | 102 | x.set_people(j.at("people").get<std::vector<Person>>()); |
| 102 | 103 | } |
Test case
1 generated file · +12 −0test/inputs/json/misc/68c30.json
Mcplusplusdefault / quicktype.hpp+12 −0
| @@ -199,11 +199,15 @@ namespace quicktype { | ||
| 199 | 199 | inline void from_json(const json & j, Out& x) { |
| 200 | 200 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 201 | 201 | x.set_addr(j.at("addr").get<std::string>()); |
| 202 | + if (j.find("n") != j.end() && !j.at("n").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 202 | 203 | x.set_n(j.at("n").get<int64_t>()); |
| 203 | 204 | x.set_script(j.at("script").get<std::string>()); |
| 204 | 205 | x.set_spent(j.at("spent").get<bool>()); |
| 206 | + if (j.find("tx_index") != j.end() && !j.at("tx_index").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 205 | 207 | x.set_tx_index(j.at("tx_index").get<int64_t>()); |
| 208 | + if (j.find("type") != j.end() && !j.at("type").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 206 | 209 | x.set_type(j.at("type").get<int64_t>()); |
| 210 | + if (j.find("value") != j.end() && !j.at("value").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 207 | 211 | x.set_value(j.at("value").get<int64_t>()); |
| 208 | 212 | } |
| 209 | 213 | |
| @@ -222,6 +226,7 @@ namespace quicktype { | ||
| 222 | 226 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 223 | 227 | x.set_prev_out(j.at("prev_out").get<Out>()); |
| 224 | 228 | x.set_script(j.at("script").get<std::string>()); |
| 229 | + if (j.find("sequence") != j.end() && !j.at("sequence").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 225 | 230 | x.set_sequence(j.at("sequence").get<int64_t>()); |
| 226 | 231 | } |
| 227 | 232 | |
| @@ -237,14 +242,21 @@ namespace quicktype { | ||
| 237 | 242 | x.set_double_spend(j.at("double_spend").get<bool>()); |
| 238 | 243 | x.set_hash(j.at("hash").get<std::string>()); |
| 239 | 244 | x.set_inputs(j.at("inputs").get<std::vector<Input>>()); |
| 245 | + if (j.find("lock_time") != j.end() && !j.at("lock_time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 240 | 246 | x.set_lock_time(j.at("lock_time").get<int64_t>()); |
| 241 | 247 | x.set_out(j.at("out").get<std::vector<Out>>()); |
| 242 | 248 | x.set_relayed_by(j.at("relayed_by").get<std::string>()); |
| 249 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 243 | 250 | x.set_size(j.at("size").get<int64_t>()); |
| 251 | + if (j.find("time") != j.end() && !j.at("time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 244 | 252 | x.set_time(j.at("time").get<int64_t>()); |
| 253 | + if (j.find("tx_index") != j.end() && !j.at("tx_index").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 245 | 254 | x.set_tx_index(j.at("tx_index").get<int64_t>()); |
| 255 | + if (j.find("ver") != j.end() && !j.at("ver").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 246 | 256 | x.set_ver(j.at("ver").get<int64_t>()); |
| 257 | + if (j.find("vin_sz") != j.end() && !j.at("vin_sz").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 247 | 258 | x.set_vin_sz(j.at("vin_sz").get<int64_t>()); |
| 259 | + if (j.find("vout_sz") != j.end() && !j.at("vout_sz").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 248 | 260 | x.set_vout_sz(j.at("vout_sz").get<int64_t>()); |
| 249 | 261 | } |
Test case
1 generated file · +4 −0test/inputs/json/misc/6c155.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -300,6 +300,7 @@ namespace quicktype { | ||
| 300 | 300 | inline void from_json(const json & j, ResponseInfo& x) { |
| 301 | 301 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 302 | 302 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 303 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 303 | 304 | x.set_status(j.at("status").get<int64_t>()); |
| 304 | 305 | } |
| 305 | 306 | |
| @@ -311,8 +312,11 @@ namespace quicktype { | ||
| 311 | 312 | |
| 312 | 313 | inline void from_json(const json & j, Resultset& x) { |
| 313 | 314 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 315 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 314 | 316 | x.set_count(j.at("count").get<int64_t>()); |
| 317 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 315 | 318 | x.set_page(j.at("page").get<int64_t>()); |
| 319 | + if (j.find("pagesize") != j.end() && !j.at("pagesize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 316 | 320 | x.set_pagesize(j.at("pagesize").get<int64_t>()); |
| 317 | 321 | } |
Test case
1 generated file · +13 −0test/inputs/json/misc/6de06.json
Mcplusplusdefault / quicktype.hpp+13 −0
| @@ -767,16 +767,20 @@ namespace quicktype { | ||
| 767 | 767 | inline void from_json(const json & j, Oembed& x) { |
| 768 | 768 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 769 | 769 | x.set_description(j.at("description").get<std::string>()); |
| 770 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 770 | 771 | x.set_height(j.at("height").get<int64_t>()); |
| 771 | 772 | x.set_html(j.at("html").get<std::string>()); |
| 772 | 773 | x.set_provider_name(j.at("provider_name").get<std::string>()); |
| 773 | 774 | x.set_provider_url(j.at("provider_url").get<std::string>()); |
| 775 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 774 | 776 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 775 | 777 | x.set_thumbnail_url(j.at("thumbnail_url").get<std::string>()); |
| 778 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 776 | 779 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 777 | 780 | x.set_title(j.at("title").get<std::string>()); |
| 778 | 781 | x.set_type(j.at("type").get<std::string>()); |
| 779 | 782 | x.set_version(j.at("version").get<std::string>()); |
| 783 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 780 | 784 | x.set_width(j.at("width").get<int64_t>()); |
| 781 | 785 | } |
| 782 | 786 | |
| @@ -811,8 +815,10 @@ namespace quicktype { | ||
| 811 | 815 | inline void from_json(const json & j, MediaEmbed& x) { |
| 812 | 816 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 813 | 817 | x.set_content(get_stack_optional<std::string>(j, "content")); |
| 818 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 814 | 819 | x.set_height(get_stack_optional<int64_t>(j, "height")); |
| 815 | 820 | x.set_scrolling(get_stack_optional<bool>(j, "scrolling")); |
| 821 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 822 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 817 | 823 | } |
| 818 | 824 | |
| @@ -826,8 +832,10 @@ namespace quicktype { | ||
| 826 | 832 | |
| 827 | 833 | inline void from_json(const json & j, Source& x) { |
| 828 | 834 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 835 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 829 | 836 | x.set_height(j.at("height").get<int64_t>()); |
| 830 | 837 | x.set_url(j.at("url").get<std::string>()); |
| 838 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 831 | 839 | x.set_width(j.at("width").get<int64_t>()); |
| 832 | 840 | } |
| 833 | 841 | |
| @@ -913,8 +921,10 @@ namespace quicktype { | ||
| 913 | 921 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 914 | 922 | x.set_distinguished(get_untyped(j, "distinguished")); |
| 915 | 923 | x.set_domain(j.at("domain").get<std::string>()); |
| 924 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 916 | 925 | x.set_downs(j.at("downs").get<int64_t>()); |
| 917 | 926 | x.set_edited(j.at("edited").get<bool>()); |
| 927 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 918 | 928 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 919 | 929 | x.set_hidden(j.at("hidden").get<bool>()); |
| 920 | 930 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -929,6 +939,7 @@ namespace quicktype { | ||
| 929 | 939 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 930 | 940 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 931 | 941 | x.set_name(j.at("name").get<std::string>()); |
| 942 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 932 | 943 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 933 | 944 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 934 | 945 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -939,6 +950,7 @@ namespace quicktype { | ||
| 939 | 950 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 940 | 951 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 941 | 952 | x.set_saved(j.at("saved").get<bool>()); |
| 953 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 942 | 954 | x.set_score(j.at("score").get<int64_t>()); |
| 943 | 955 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 944 | 956 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -955,6 +967,7 @@ namespace quicktype { | ||
| 955 | 967 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 956 | 968 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 957 | 969 | x.set_title(j.at("title").get<std::string>()); |
| 970 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 958 | 971 | x.set_ups(j.at("ups").get<int64_t>()); |
| 959 | 972 | x.set_url(j.at("url").get<std::string>()); |
| 960 | 973 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/6dec6.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -714,6 +714,7 @@ namespace quicktype { | ||
| 714 | 714 | |
| 715 | 715 | inline void from_json(const json & j, Query& x) { |
| 716 | 716 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 717 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 717 | 718 | x.set_count(j.at("count").get<int64_t>()); |
| 718 | 719 | x.set_created(j.at("created").get<std::string>()); |
| 719 | 720 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +2 −0test/inputs/json/misc/6eb00.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -64,7 +64,9 @@ namespace quicktype { | ||
| 64 | 64 | |
| 65 | 65 | inline void from_json(const json & j, TopLevelElement& x) { |
| 66 | 66 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 67 | + if (j.find("DirectorateID") != j.end() && !j.at("DirectorateID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 67 | 68 | x.set_directorate_id(j.at("DirectorateID").get<int64_t>()); |
| 69 | + if (j.find("Id") != j.end() && !j.at("Id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 68 | 70 | x.set_id(j.at("Id").get<int64_t>()); |
| 69 | 71 | x.set_name(j.at("Name").get<std::string>()); |
| 70 | 72 | } |
Test case
1 generated file · +7 −0test/inputs/json/misc/734ad.json
Mcplusplusdefault / quicktype.hpp+7 −0
| @@ -470,6 +470,7 @@ namespace quicktype { | ||
| 470 | 470 | x.set_be_office_street(get_stack_optional<std::string>(j, "be_office_street")); |
| 471 | 471 | x.set_be_office_town(get_stack_optional<std::string>(j, "be_office_town")); |
| 472 | 472 | x.set_code_of_conduct(j.at("code_of_conduct").get<std::string>()); |
| 473 | + if (j.find("contact_country") != j.end() && !j.at("contact_country").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 473 | 474 | x.set_contact_country(j.at("contact_country").get<int64_t>()); |
| 474 | 475 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 475 | 476 | x.set_entity(j.at("entity").get<std::string>()); |
| @@ -489,8 +490,10 @@ namespace quicktype { | ||
| 489 | 490 | x.set_last_update_date(j.at("last_update_date").get<std::string>()); |
| 490 | 491 | x.set_legal(j.at("legal").get<std::string>()); |
| 491 | 492 | x.set_legal_status(j.at("legal_status").get<std::string>()); |
| 493 | + if (j.find("main_category") != j.end() && !j.at("main_category").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 492 | 494 | x.set_main_category(j.at("main_category").get<int64_t>()); |
| 493 | 495 | x.set_main_category_title(j.at("main_category_title").get<std::string>()); |
| 496 | + if (j.find("members") != j.end() && !j.at("members").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 494 | 497 | x.set_members(j.at("members").get<int64_t>()); |
| 495 | 498 | x.set_members_100(get_stack_optional<int64_t>(j, "members_100")); |
| 496 | 499 | x.set_members_25(get_stack_optional<int64_t>(j, "members_25")); |
| @@ -505,6 +508,7 @@ namespace quicktype { | ||
| 505 | 508 | x.set_registration_date(j.at("registration_date").get<std::string>()); |
| 506 | 509 | x.set_status(j.at("status").get<Status>()); |
| 507 | 510 | x.set_structure_members(j.at("structure_members").get<std::string>()); |
| 511 | + if (j.find("sub_category") != j.end() && !j.at("sub_category").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 508 | 512 | x.set_sub_category(j.at("sub_category").get<int64_t>()); |
| 509 | 513 | x.set_sub_category_title(j.at("sub_category_title").get<std::string>()); |
| 510 | 514 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| @@ -576,10 +580,13 @@ namespace quicktype { | ||
| 576 | 580 | |
| 577 | 581 | inline void from_json(const json & j, TopLevel& x) { |
| 578 | 582 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 583 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 579 | 584 | x.set_count(j.at("count").get<int64_t>()); |
| 580 | 585 | x.set_facets(j.at("facets").get<Facets>()); |
| 586 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 581 | 587 | x.set_limit(j.at("limit").get<int64_t>()); |
| 582 | 588 | x.set_next(j.at("next").get<std::string>()); |
| 589 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 583 | 590 | x.set_offset(j.at("offset").get<int64_t>()); |
| 584 | 591 | x.set_previous(j.at("previous").get<bool>()); |
| 585 | 592 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/7681c.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -760,6 +760,7 @@ namespace quicktype { | ||
| 760 | 760 | x.set_id(j.at("id").get<std::string>()); |
| 761 | 761 | x.set_images(j.at("images").get<Images>()); |
| 762 | 762 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 763 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 763 | 764 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 764 | 765 | x.set_rating(j.at("rating").get<Rating>()); |
| 765 | 766 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -799,6 +800,7 @@ namespace quicktype { | ||
| 799 | 800 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 800 | 801 | x.set_msg(j.at("msg").get<std::string>()); |
| 801 | 802 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 803 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 802 | 804 | x.set_status(j.at("status").get<int64_t>()); |
| 803 | 805 | } |
| 804 | 806 | |
| @@ -811,8 +813,11 @@ namespace quicktype { | ||
| 811 | 813 | |
| 812 | 814 | inline void from_json(const json & j, Pagination& x) { |
| 813 | 815 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 816 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 814 | 817 | x.set_count(j.at("count").get<int64_t>()); |
| 818 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 815 | 819 | x.set_offset(j.at("offset").get<int64_t>()); |
| 820 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 821 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 817 | 822 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/7df41.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -99,8 +99,10 @@ namespace quicktype { | ||
| 99 | 99 | |
| 100 | 100 | inline void from_json(const json & j, Pc& x) { |
| 101 | 101 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 102 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 102 | 103 | x.set_count(j.at("count").get<int64_t>()); |
| 103 | 104 | x.set_label(j.at("label").get<std::string>()); |
| 105 | + if (j.find("peak24") != j.end() && !j.at("peak24").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 104 | 106 | x.set_peak24(j.at("peak24").get<int64_t>()); |
| 105 | 107 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/7dfa6.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/7eb30.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -227,12 +227,16 @@ namespace quicktype { | ||
| 227 | 227 | x.set_fav(j.at("fav").get<bool>()); |
| 228 | 228 | x.set_group(j.at("group").get<Group>()); |
| 229 | 229 | x.set_location(j.at("location").get<Location>()); |
| 230 | + if (j.find("min_screens") != j.end() && !j.at("min_screens").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 230 | 231 | x.set_min_screens(j.at("min_screens").get<int64_t>()); |
| 232 | + if (j.find("num_views") != j.end() && !j.at("num_views").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 231 | 233 | x.set_num_views(j.at("num_views").get<int64_t>()); |
| 232 | 234 | x.set_showtimes(j.at("showtimes").get<std::string>()); |
| 235 | + if (j.find("stars") != j.end() && !j.at("stars").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 233 | 236 | x.set_stars(j.at("stars").get<int64_t>()); |
| 234 | 237 | x.set_tel(j.at("tel").get<Tel>()); |
| 235 | 238 | x.set_thai(j.at("thai").get<std::string>()); |
| 239 | + if (j.find("today_screens") != j.end() && !j.at("today_screens").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 236 | 240 | x.set_today_screens(j.at("today_screens").get<int64_t>()); |
| 237 | 241 | x.set_url(j.at("url").get<std::string>()); |
| 238 | 242 | x.set_website(j.at("website").get<std::string>()); |
| @@ -258,6 +262,7 @@ namespace quicktype { | ||
| 258 | 262 | |
| 259 | 263 | inline void from_json(const json & j, TopLevel& x) { |
| 260 | 264 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 265 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 261 | 266 | x.set_count(j.at("count").get<int64_t>()); |
| 262 | 267 | x.set_next(j.at("next").get<std::string>()); |
| 263 | 268 | x.set_previous(get_untyped(j, "previous")); |
Test case
1 generated file · +2 −0test/inputs/json/misc/7f568.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -233,6 +233,7 @@ namespace quicktype { | ||
| 233 | 233 | x.set_filename(j.at("filename").get<std::string>()); |
| 234 | 234 | x.set_language(get_stack_optional<Language>(j, "language")); |
| 235 | 235 | x.set_raw_url(j.at("raw_url").get<std::string>()); |
| 236 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 236 | 237 | x.set_size(j.at("size").get<int64_t>()); |
| 237 | 238 | x.set_type(j.at("type").get<Type>()); |
| 238 | 239 | } |
| @@ -248,6 +249,7 @@ namespace quicktype { | ||
| 248 | 249 | |
| 249 | 250 | inline void from_json(const json & j, TopLevelElement& x) { |
| 250 | 251 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 252 | + if (j.find("comments") != j.end() && !j.at("comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 251 | 253 | x.set_comments(j.at("comments").get<int64_t>()); |
| 252 | 254 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| 253 | 255 | x.set_commits_url(j.at("commits_url").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/7fbfb.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -235,9 +235,12 @@ namespace quicktype { | ||
| 235 | 235 | |
| 236 | 236 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 237 | 237 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 238 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 239 | x.set_page(j.at("page").get<int64_t>()); |
| 240 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 241 | x.set_pages(j.at("pages").get<int64_t>()); |
| 240 | 242 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 243 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 244 | x.set_total(j.at("total").get<int64_t>()); |
| 242 | 245 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/80aff.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -209,7 +209,9 @@ namespace quicktype { | ||
| 209 | 209 | inline void from_json(const json & j, Result& x) { |
| 210 | 210 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 211 | 211 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 212 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 212 | 213 | x.set_id(j.at("id").get<int64_t>()); |
| 214 | + if (j.find("items") != j.end() && !j.at("items").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 213 | 215 | x.set_items(j.at("items").get<int64_t>()); |
| 214 | 216 | x.set_name(j.at("name").get<std::string>()); |
| 215 | 217 | x.set_parent(get_stack_optional<int64_t>(j, "parent")); |
| @@ -230,10 +232,13 @@ namespace quicktype { | ||
| 230 | 232 | |
| 231 | 233 | inline void from_json(const json & j, TopLevel& x) { |
| 232 | 234 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 235 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 233 | 236 | x.set_count(j.at("count").get<int64_t>()); |
| 234 | 237 | x.set_facets(j.at("facets").get<Facets>()); |
| 238 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 235 | 239 | x.set_limit(j.at("limit").get<int64_t>()); |
| 236 | 240 | x.set_next(j.at("next").get<bool>()); |
| 241 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 237 | 242 | x.set_offset(j.at("offset").get<int64_t>()); |
| 238 | 243 | x.set_previous(j.at("previous").get<bool>()); |
| 239 | 244 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +7 −0test/inputs/json/misc/8592b.json
Mcplusplusdefault / quicktype.hpp+7 −0
| @@ -635,8 +635,10 @@ namespace quicktype { | ||
| 635 | 635 | |
| 636 | 636 | inline void from_json(const json & j, Source& x) { |
| 637 | 637 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 638 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 638 | 639 | x.set_height(j.at("height").get<int64_t>()); |
| 639 | 640 | x.set_url(j.at("url").get<std::string>()); |
| 641 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 640 | 642 | x.set_width(j.at("width").get<int64_t>()); |
| 641 | 643 | } |
| 642 | 644 | |
| @@ -694,8 +696,10 @@ namespace quicktype { | ||
| 694 | 696 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 695 | 697 | x.set_distinguished(get_untyped(j, "distinguished")); |
| 696 | 698 | x.set_domain(j.at("domain").get<std::string>()); |
| 699 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 697 | 700 | x.set_downs(j.at("downs").get<int64_t>()); |
| 698 | 701 | x.set_edited(j.at("edited").get<bool>()); |
| 702 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 699 | 703 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 700 | 704 | x.set_hidden(j.at("hidden").get<bool>()); |
| 701 | 705 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -710,6 +714,7 @@ namespace quicktype { | ||
| 710 | 714 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 711 | 715 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 712 | 716 | x.set_name(j.at("name").get<std::string>()); |
| 717 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 713 | 718 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 714 | 719 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 715 | 720 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -720,6 +725,7 @@ namespace quicktype { | ||
| 720 | 725 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 721 | 726 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 722 | 727 | x.set_saved(j.at("saved").get<bool>()); |
| 728 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 723 | 729 | x.set_score(j.at("score").get<int64_t>()); |
| 724 | 730 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 725 | 731 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -736,6 +742,7 @@ namespace quicktype { | ||
| 736 | 742 | x.set_thumbnail_height(get_stack_optional<int64_t>(j, "thumbnail_height")); |
| 737 | 743 | x.set_thumbnail_width(get_stack_optional<int64_t>(j, "thumbnail_width")); |
| 738 | 744 | x.set_title(j.at("title").get<std::string>()); |
| 745 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 739 | 746 | x.set_ups(j.at("ups").get<int64_t>()); |
| 740 | 747 | x.set_url(j.at("url").get<std::string>()); |
| 741 | 748 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/88130.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/8a62c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/9929c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/9ac3b.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -267,10 +267,13 @@ namespace quicktype { | ||
| 267 | 267 | |
| 268 | 268 | inline void from_json(const json & j, TopLevel& x) { |
| 269 | 269 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 270 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 270 | 271 | x.set_count(j.at("count").get<int64_t>()); |
| 271 | 272 | x.set_facets(j.at("facets").get<Facets>()); |
| 273 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 272 | 274 | x.set_limit(j.at("limit").get<int64_t>()); |
| 273 | 275 | x.set_next(j.at("next").get<std::string>()); |
| 276 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 274 | 277 | x.set_offset(j.at("offset").get<int64_t>()); |
| 275 | 278 | x.set_previous(j.at("previous").get<bool>()); |
| 276 | 279 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/a0496.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -231,6 +231,7 @@ namespace quicktype { | ||
| 231 | 231 | x.set_errors(j.at("errors").get<Errors>()); |
| 232 | 232 | x.set_frequency(j.at("frequency").get<std::string>()); |
| 233 | 233 | x.set_from_date(j.at("from_date").get<std::string>()); |
| 234 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 234 | 235 | x.set_id(j.at("id").get<int64_t>()); |
| 235 | 236 | x.set_name(j.at("name").get<std::string>()); |
| 236 | 237 | x.set_premium(j.at("premium").get<bool>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/a1eca.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +20 −0test/inputs/json/misc/a3d8c.json
Mcplusplusdefault / quicktype.hpp+20 −0
| @@ -635,6 +635,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 635 | 635 | namespace quicktype { |
| 636 | 636 | inline void from_json(const json & j, Top& x) { |
| 637 | 637 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 638 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 638 | 639 | x.set_count(j.at("count").get<int64_t>()); |
| 639 | 640 | x.set_item(j.at("item").get<std::string>()); |
| 640 | 641 | } |
| @@ -649,7 +650,9 @@ namespace quicktype { | ||
| 649 | 650 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 650 | 651 | x.set_average(get_stack_optional<std::string>(j, "average")); |
| 651 | 652 | x.set_largest(j.at("largest").get<std::string>()); |
| 653 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 652 | 654 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 655 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 653 | 656 | x.set_null(j.at("null").get<int64_t>()); |
| 654 | 657 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 655 | 658 | x.set_sum(get_stack_optional<std::string>(j, "sum")); |
| @@ -685,11 +688,15 @@ namespace quicktype { | ||
| 685 | 688 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 686 | 689 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 687 | 690 | x.set_format(j.at("format").get<Query>()); |
| 691 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 688 | 692 | x.set_id(j.at("id").get<int64_t>()); |
| 689 | 693 | x.set_name(j.at("name").get<std::string>()); |
| 694 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 690 | 695 | x.set_position(j.at("position").get<int64_t>()); |
| 691 | 696 | x.set_render_type_name(j.at("renderTypeName").get<TypeName>()); |
| 697 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 692 | 698 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 699 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 693 | 700 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 694 | 701 | } |
| 695 | 702 | |
| @@ -786,17 +793,21 @@ namespace quicktype { | ||
| 786 | 793 | |
| 787 | 794 | inline void from_json(const json & j, View& x) { |
| 788 | 795 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 796 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 789 | 797 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 790 | 798 | x.set_category(j.at("category").get<std::string>()); |
| 791 | 799 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 800 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 792 | 801 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 793 | 802 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 803 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 794 | 804 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 795 | 805 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 796 | 806 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 797 | 807 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 798 | 808 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 799 | 809 | x.set_id(j.at("id").get<std::string>()); |
| 810 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 800 | 811 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 801 | 812 | x.set_license(j.at("license").get<License>()); |
| 802 | 813 | x.set_license_id(j.at("licenseId").get<std::string>()); |
| @@ -804,23 +815,32 @@ namespace quicktype { | ||
| 804 | 815 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 805 | 816 | x.set_name(j.at("name").get<std::string>()); |
| 806 | 817 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 818 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 807 | 819 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 820 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 808 | 821 | x.set_oid(j.at("oid").get<int64_t>()); |
| 809 | 822 | x.set_owner(j.at("owner").get<Owner>()); |
| 810 | 823 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 811 | 824 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 825 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 812 | 826 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 827 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 813 | 828 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 814 | 829 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 815 | 830 | x.set_query(j.at("query").get<Query>()); |
| 816 | 831 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 817 | 832 | x.set_row_class(j.at("rowClass").get<std::string>()); |
| 833 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 818 | 834 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 819 | 835 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 820 | 836 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 837 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 821 | 838 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 839 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 822 | 840 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 841 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 823 | 842 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 843 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 824 | 844 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 825 | 845 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 826 | 846 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/a45b0.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/ab0d1.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/abb4b.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/ae7f0.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -548,8 +548,10 @@ namespace quicktype { | ||
| 548 | 548 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 549 | 549 | x.set_distinguished(get_untyped(j, "distinguished")); |
| 550 | 550 | x.set_domain(j.at("domain").get<Domain>()); |
| 551 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 551 | 552 | x.set_downs(j.at("downs").get<int64_t>()); |
| 552 | 553 | x.set_edited(j.at("edited").get<bool>()); |
| 554 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 553 | 555 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 554 | 556 | x.set_hidden(j.at("hidden").get<bool>()); |
| 555 | 557 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -564,6 +566,7 @@ namespace quicktype { | ||
| 564 | 566 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 565 | 567 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 566 | 568 | x.set_name(j.at("name").get<std::string>()); |
| 569 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 567 | 570 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 568 | 571 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 569 | 572 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -572,6 +575,7 @@ namespace quicktype { | ||
| 572 | 575 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 573 | 576 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 574 | 577 | x.set_saved(j.at("saved").get<bool>()); |
| 578 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 575 | 579 | x.set_score(j.at("score").get<int64_t>()); |
| 576 | 580 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 577 | 581 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -586,6 +590,7 @@ namespace quicktype { | ||
| 586 | 590 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 587 | 591 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 588 | 592 | x.set_title(j.at("title").get<std::string>()); |
| 593 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 589 | 594 | x.set_ups(j.at("ups").get<int64_t>()); |
| 590 | 595 | x.set_url(j.at("url").get<std::string>()); |
| 591 | 596 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +6 −0test/inputs/json/misc/af2d1.json
Mcplusplusdefault / quicktype.hpp+6 −0
| @@ -498,6 +498,7 @@ namespace quicktype { | ||
| 498 | 498 | x.set_area(j.at("area_").get<double>()); |
| 499 | 499 | x.set_asset_numb(j.at("asset_numb").get<std::string>()); |
| 500 | 500 | x.set_comments(get_stack_optional<std::string>(j, "comments")); |
| 501 | + if (j.find("condition") != j.end() && !j.at("condition").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 501 | 502 | x.set_condition(j.at("condition").get<int64_t>()); |
| 502 | 503 | x.set_constructi(get_stack_optional<std::string>(j, "constructi")); |
| 503 | 504 | x.set_createdate(get_untyped(j, "createdate")); |
| @@ -508,18 +509,22 @@ namespace quicktype { | ||
| 508 | 509 | x.set_file_numbe(get_stack_optional<std::string>(j, "file_numbe")); |
| 509 | 510 | x.set_folder_num(get_stack_optional<std::string>(j, "folder_num")); |
| 510 | 511 | x.set_funding_ba(get_stack_optional<FundingBa>(j, "funding_ba")); |
| 512 | + if (j.find("historic_c") != j.end() && !j.at("historic_c").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 511 | 513 | x.set_historic_c(j.at("historic_c").get<int64_t>()); |
| 512 | 514 | x.set_inspection(j.at("inspection").get<std::string>()); |
| 513 | 515 | x.set_inspectors(get_untyped(j, "inspectors")); |
| 514 | 516 | x.set_last_updat(get_untyped(j, "last_updat")); |
| 515 | 517 | x.set_level_accu(get_stack_optional<LevelAccu>(j, "level_accu")); |
| 516 | 518 | x.set_material(j.at("material").get<Material>()); |
| 519 | + if (j.find("mi_prinx") != j.end() && !j.at("mi_prinx").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 517 | 520 | x.set_mi_prinx(j.at("mi_prinx").get<int64_t>()); |
| 518 | 521 | x.set_mi_symbolo(j.at("mi_symbolo").get<MiSymbolo>()); |
| 522 | + if (j.find("number_lan") != j.end() && !j.at("number_lan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 519 | 523 | x.set_number_lan(j.at("number_lan").get<int64_t>()); |
| 520 | 524 | x.set_owner(get_stack_optional<std::string>(j, "owner")); |
| 521 | 525 | x.set_positional(get_stack_optional<LevelAccu>(j, "positional")); |
| 522 | 526 | x.set_project_nu(get_stack_optional<std::string>(j, "project_nu")); |
| 527 | + if (j.find("rec_id") != j.end() && !j.at("rec_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 523 | 528 | x.set_rec_id(j.at("rec_id").get<int64_t>()); |
| 524 | 529 | x.set_record_cre(get_stack_optional<std::string>(j, "record_cre")); |
| 525 | 530 | x.set_shape_area(j.at("shape_area").get<double>()); |
| @@ -598,6 +603,7 @@ namespace quicktype { | ||
| 598 | 603 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 599 | 604 | x.set_crs(j.at("crs").get<Crs>()); |
| 600 | 605 | x.set_features(j.at("features").get<std::vector<Feature>>()); |
| 606 | + if (j.find("totalFeatures") != j.end() && !j.at("totalFeatures").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 601 | 607 | x.set_total_features(j.at("totalFeatures").get<int64_t>()); |
| 602 | 608 | x.set_type(j.at("type").get<std::string>()); |
| 603 | 609 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/b6f2c.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/bb1ec.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +15 −0test/inputs/json/misc/be234.json
Mcplusplusdefault / quicktype.hpp+15 −0
| @@ -783,16 +783,20 @@ namespace quicktype { | ||
| 783 | 783 | inline void from_json(const json & j, Oembed& x) { |
| 784 | 784 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 785 | 785 | x.set_description(j.at("description").get<std::string>()); |
| 786 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 786 | 787 | x.set_height(j.at("height").get<int64_t>()); |
| 787 | 788 | x.set_html(j.at("html").get<std::string>()); |
| 788 | 789 | x.set_provider_name(j.at("provider_name").get<std::string>()); |
| 789 | 790 | x.set_provider_url(j.at("provider_url").get<std::string>()); |
| 791 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 790 | 792 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 791 | 793 | x.set_thumbnail_url(j.at("thumbnail_url").get<std::string>()); |
| 794 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 792 | 795 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 793 | 796 | x.set_title(j.at("title").get<std::string>()); |
| 794 | 797 | x.set_type(j.at("type").get<std::string>()); |
| 795 | 798 | x.set_version(j.at("version").get<std::string>()); |
| 799 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 796 | 800 | x.set_width(j.at("width").get<int64_t>()); |
| 797 | 801 | } |
| 798 | 802 | |
| @@ -827,8 +831,10 @@ namespace quicktype { | ||
| 827 | 831 | inline void from_json(const json & j, MediaEmbed& x) { |
| 828 | 832 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 829 | 833 | x.set_content(get_stack_optional<std::string>(j, "content")); |
| 834 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 830 | 835 | x.set_height(get_stack_optional<int64_t>(j, "height")); |
| 831 | 836 | x.set_scrolling(get_stack_optional<bool>(j, "scrolling")); |
| 837 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 832 | 838 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 833 | 839 | } |
| 834 | 840 | |
| @@ -842,8 +848,10 @@ namespace quicktype { | ||
| 842 | 848 | |
| 843 | 849 | inline void from_json(const json & j, Source& x) { |
| 844 | 850 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 851 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 845 | 852 | x.set_height(j.at("height").get<int64_t>()); |
| 846 | 853 | x.set_url(j.at("url").get<std::string>()); |
| 854 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 847 | 855 | x.set_width(j.at("width").get<int64_t>()); |
| 848 | 856 | } |
| 849 | 857 | |
| @@ -925,8 +933,10 @@ namespace quicktype { | ||
| 925 | 933 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 926 | 934 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 927 | 935 | x.set_domain(j.at("domain").get<Domain>()); |
| 936 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 928 | 937 | x.set_downs(j.at("downs").get<int64_t>()); |
| 929 | 938 | x.set_edited(j.at("edited").get<bool>()); |
| 939 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 930 | 940 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 931 | 941 | x.set_hidden(j.at("hidden").get<bool>()); |
| 932 | 942 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -941,6 +951,7 @@ namespace quicktype { | ||
| 941 | 951 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 942 | 952 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 943 | 953 | x.set_name(j.at("name").get<std::string>()); |
| 954 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 944 | 955 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 945 | 956 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 946 | 957 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -951,6 +962,7 @@ namespace quicktype { | ||
| 951 | 962 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 952 | 963 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 953 | 964 | x.set_saved(j.at("saved").get<bool>()); |
| 965 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 954 | 966 | x.set_score(j.at("score").get<int64_t>()); |
| 955 | 967 | x.set_secure_media(get_stack_optional<Media>(j, "secure_media")); |
| 956 | 968 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -964,9 +976,12 @@ namespace quicktype { | ||
| 964 | 976 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 965 | 977 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 966 | 978 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 979 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 967 | 980 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 981 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 968 | 982 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 969 | 983 | x.set_title(j.at("title").get<std::string>()); |
| 984 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 970 | 985 | x.set_ups(j.at("ups").get<int64_t>()); |
| 971 | 986 | x.set_url(j.at("url").get<std::string>()); |
| 972 | 987 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/c0356.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -119,6 +119,7 @@ namespace quicktype { | ||
| 119 | 119 | inline void from_json(const json & j, Description& x) { |
| 120 | 120 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 121 | 121 | x.set_base_period(j.at("base_period").get<std::string>()); |
| 122 | + if (j.find("missing") != j.end() && !j.at("missing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 122 | 123 | x.set_missing(j.at("missing").get<int64_t>()); |
| 123 | 124 | x.set_title(j.at("title").get<std::string>()); |
| 124 | 125 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/c3303.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -753,6 +753,7 @@ namespace quicktype { | ||
| 753 | 753 | x.set_id(j.at("id").get<std::string>()); |
| 754 | 754 | x.set_images(j.at("images").get<Images>()); |
| 755 | 755 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 756 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 756 | 757 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 757 | 758 | x.set_rating(j.at("rating").get<Rating>()); |
| 758 | 759 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -792,6 +793,7 @@ namespace quicktype { | ||
| 792 | 793 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 793 | 794 | x.set_msg(j.at("msg").get<std::string>()); |
| 794 | 795 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 796 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 795 | 797 | x.set_status(j.at("status").get<int64_t>()); |
| 796 | 798 | } |
| 797 | 799 | |
| @@ -804,8 +806,11 @@ namespace quicktype { | ||
| 804 | 806 | |
| 805 | 807 | inline void from_json(const json & j, Pagination& x) { |
| 806 | 808 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 809 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 807 | 810 | x.set_count(j.at("count").get<int64_t>()); |
| 811 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 808 | 812 | x.set_offset(j.at("offset").get<int64_t>()); |
| 813 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 809 | 814 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 810 | 815 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/c8c7e.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -235,9 +235,12 @@ namespace quicktype { | ||
| 235 | 235 | |
| 236 | 236 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 237 | 237 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 238 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 239 | x.set_page(j.at("page").get<int64_t>()); |
| 240 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 241 | x.set_pages(j.at("pages").get<int64_t>()); |
| 240 | 242 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 243 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 244 | x.set_total(j.at("total").get<int64_t>()); |
| 242 | 245 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/cda6c.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -235,9 +235,12 @@ namespace quicktype { | ||
| 235 | 235 | |
| 236 | 236 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 237 | 237 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 238 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 239 | x.set_page(j.at("page").get<int64_t>()); |
| 240 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 241 | x.set_pages(j.at("pages").get<int64_t>()); |
| 240 | 242 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 243 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 244 | x.set_total(j.at("total").get<int64_t>()); |
| 242 | 245 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/cf0d8.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/d0908.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -75,6 +75,7 @@ namespace quicktype { | ||
| 75 | 75 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 78 | + if (j.find("population") != j.end() && !j.at("population").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 79 | x.set_population(j.at("population").get<int64_t>()); |
| 79 | 80 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/d23d5.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -223,10 +223,13 @@ namespace quicktype { | ||
| 223 | 223 | |
| 224 | 224 | inline void from_json(const json & j, TopLevel& x) { |
| 225 | 225 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 226 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 226 | 227 | x.set_count(j.at("count").get<int64_t>()); |
| 227 | 228 | x.set_facets(j.at("facets").get<Facets>()); |
| 229 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 228 | 230 | x.set_limit(j.at("limit").get<int64_t>()); |
| 229 | 231 | x.set_next(j.at("next").get<std::string>()); |
| 232 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 230 | 233 | x.set_offset(j.at("offset").get<int64_t>()); |
| 231 | 234 | x.set_previous(j.at("previous").get<bool>()); |
| 232 | 235 | x.set_results(j.at("results").get<std::vector<Result>>()); |
Test case
1 generated file · +1 −0test/inputs/json/misc/dbfb3.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -714,6 +714,7 @@ namespace quicktype { | ||
| 714 | 714 | |
| 715 | 715 | inline void from_json(const json & j, Query& x) { |
| 716 | 716 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 717 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 717 | 718 | x.set_count(j.at("count").get<int64_t>()); |
| 718 | 719 | x.set_created(j.at("created").get<std::string>()); |
| 719 | 720 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/dc44f.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -421,6 +421,7 @@ namespace quicktype { | ||
| 421 | 421 | inline void from_json(const json & j, Card& x) { |
| 422 | 422 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 423 | 423 | x.set_artist(j.at("artist").get<std::string>()); |
| 424 | + if (j.find("cmc") != j.end() && !j.at("cmc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 424 | 425 | x.set_cmc(j.at("cmc").get<int64_t>()); |
| 425 | 426 | x.set_color_identity(get_stack_optional<std::vector<ColorIdentity>>(j, "colorIdentity")); |
| 426 | 427 | x.set_colors(get_stack_optional<std::vector<Color>>(j, "colors")); |
| @@ -431,6 +432,7 @@ namespace quicktype { | ||
| 431 | 432 | x.set_legalities(j.at("legalities").get<std::vector<LegalityElement>>()); |
| 432 | 433 | x.set_mana_cost(get_stack_optional<std::string>(j, "manaCost")); |
| 433 | 434 | x.set_mci_number(get_stack_optional<std::string>(j, "mciNumber")); |
| 435 | + if (j.find("multiverseid") != j.end() && !j.at("multiverseid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 434 | 436 | x.set_multiverseid(j.at("multiverseid").get<int64_t>()); |
| 435 | 437 | x.set_name(j.at("name").get<std::string>()); |
| 436 | 438 | x.set_original_text(get_stack_optional<std::string>(j, "originalText")); |
| @@ -488,6 +490,7 @@ namespace quicktype { | ||
| 488 | 490 | x.set_code(j.at("code").get<std::string>()); |
| 489 | 491 | x.set_gatherer_code(j.at("gathererCode").get<std::string>()); |
| 490 | 492 | x.set_magic_cards_info_code(j.at("magicCardsInfoCode").get<std::string>()); |
| 493 | + if (j.find("mkm_id") != j.end() && !j.at("mkm_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 491 | 494 | x.set_mkm_id(j.at("mkm_id").get<int64_t>()); |
| 492 | 495 | x.set_mkm_name(j.at("mkm_name").get<std::string>()); |
| 493 | 496 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/dd1ce.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -421,6 +421,7 @@ namespace quicktype { | ||
| 421 | 421 | inline void from_json(const json & j, Card& x) { |
| 422 | 422 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 423 | 423 | x.set_artist(j.at("artist").get<std::string>()); |
| 424 | + if (j.find("cmc") != j.end() && !j.at("cmc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 424 | 425 | x.set_cmc(j.at("cmc").get<int64_t>()); |
| 425 | 426 | x.set_color_identity(get_stack_optional<std::vector<ColorIdentity>>(j, "colorIdentity")); |
| 426 | 427 | x.set_colors(get_stack_optional<std::vector<Color>>(j, "colors")); |
| @@ -431,6 +432,7 @@ namespace quicktype { | ||
| 431 | 432 | x.set_legalities(j.at("legalities").get<std::vector<LegalityElement>>()); |
| 432 | 433 | x.set_mana_cost(get_stack_optional<std::string>(j, "manaCost")); |
| 433 | 434 | x.set_mci_number(get_stack_optional<std::string>(j, "mciNumber")); |
| 435 | + if (j.find("multiverseid") != j.end() && !j.at("multiverseid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 434 | 436 | x.set_multiverseid(j.at("multiverseid").get<int64_t>()); |
| 435 | 437 | x.set_name(j.at("name").get<std::string>()); |
| 436 | 438 | x.set_original_text(get_stack_optional<std::string>(j, "originalText")); |
| @@ -488,6 +490,7 @@ namespace quicktype { | ||
| 488 | 490 | x.set_code(j.at("code").get<std::string>()); |
| 489 | 491 | x.set_gatherer_code(j.at("gathererCode").get<std::string>()); |
| 490 | 492 | x.set_magic_cards_info_code(j.at("magicCardsInfoCode").get<std::string>()); |
| 493 | + if (j.find("mkm_id") != j.end() && !j.at("mkm_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 491 | 494 | x.set_mkm_id(j.at("mkm_id").get<int64_t>()); |
| 492 | 495 | x.set_mkm_name(j.at("mkm_name").get<std::string>()); |
| 493 | 496 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +4 −0test/inputs/json/misc/dec3a.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -340,6 +340,7 @@ namespace quicktype { | ||
| 340 | 340 | inline void from_json(const json & j, ResponseInfo& x) { |
| 341 | 341 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 342 | 342 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 343 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 343 | 344 | x.set_status(j.at("status").get<int64_t>()); |
| 344 | 345 | } |
| 345 | 346 | |
| @@ -351,8 +352,11 @@ namespace quicktype { | ||
| 351 | 352 | |
| 352 | 353 | inline void from_json(const json & j, Resultset& x) { |
| 353 | 354 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 355 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 354 | 356 | x.set_count(j.at("count").get<int64_t>()); |
| 357 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 355 | 358 | x.set_page(j.at("page").get<int64_t>()); |
| 359 | + if (j.find("pagesize") != j.end() && !j.at("pagesize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 356 | 360 | x.set_pagesize(j.at("pagesize").get<int64_t>()); |
| 357 | 361 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/df957.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -709,6 +709,7 @@ namespace quicktype { | ||
| 709 | 709 | |
| 710 | 710 | inline void from_json(const json & j, Query& x) { |
| 711 | 711 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 712 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 712 | 713 | x.set_count(j.at("count").get<int64_t>()); |
| 713 | 714 | x.set_created(j.at("created").get<std::string>()); |
| 714 | 715 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/e0ac7.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -755,6 +755,7 @@ namespace quicktype { | ||
| 755 | 755 | x.set_id(j.at("id").get<std::string>()); |
| 756 | 756 | x.set_images(j.at("images").get<Images>()); |
| 757 | 757 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 758 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 758 | 759 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 759 | 760 | x.set_rating(j.at("rating").get<Rating>()); |
| 760 | 761 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -794,6 +795,7 @@ namespace quicktype { | ||
| 794 | 795 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 795 | 796 | x.set_msg(j.at("msg").get<std::string>()); |
| 796 | 797 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 798 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 797 | 799 | x.set_status(j.at("status").get<int64_t>()); |
| 798 | 800 | } |
| 799 | 801 | |
| @@ -806,8 +808,11 @@ namespace quicktype { | ||
| 806 | 808 | |
| 807 | 809 | inline void from_json(const json & j, Pagination& x) { |
| 808 | 810 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 811 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 809 | 812 | x.set_count(j.at("count").get<int64_t>()); |
| 813 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 810 | 814 | x.set_offset(j.at("offset").get<int64_t>()); |
| 815 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 811 | 816 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 812 | 817 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/e2915.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -714,6 +714,7 @@ namespace quicktype { | ||
| 714 | 714 | |
| 715 | 715 | inline void from_json(const json & j, Query& x) { |
| 716 | 716 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 717 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 717 | 718 | x.set_count(j.at("count").get<int64_t>()); |
| 718 | 719 | x.set_created(j.at("created").get<std::string>()); |
| 719 | 720 | x.set_lang(j.at("lang").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/misc/e53b5.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -235,9 +235,12 @@ namespace quicktype { | ||
| 235 | 235 | |
| 236 | 236 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 237 | 237 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 238 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 239 | x.set_page(j.at("page").get<int64_t>()); |
| 240 | + if (j.find("pages") != j.end() && !j.at("pages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 241 | x.set_pages(j.at("pages").get<int64_t>()); |
| 240 | 242 | x.set_per_page(j.at("per_page").get<std::string>()); |
| 243 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 244 | x.set_total(j.at("total").get<int64_t>()); |
| 242 | 245 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/e8a0b.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +20 −0test/inputs/json/misc/e8b04.json
Mcplusplusdefault / quicktype.hpp+20 −0
| @@ -1153,6 +1153,7 @@ namespace quicktype { | ||
| 1153 | 1153 | |
| 1154 | 1154 | inline void from_json(const json & j, TableColumnId& x) { |
| 1155 | 1155 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1156 | + if (j.find("2819740") != j.end() && !j.at("2819740").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1156 | 1157 | x.set_the_2819740(j.at("2819740").get<int64_t>()); |
| 1157 | 1158 | } |
| 1158 | 1159 | |
| @@ -1165,9 +1166,11 @@ namespace quicktype { | ||
| 1165 | 1166 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1166 | 1167 | x.set_custom_values(get_stack_optional<std::vector<std::string>>(j, "customValues")); |
| 1167 | 1168 | x.set_freeform(get_stack_optional<bool>(j, "freeform")); |
| 1169 | + if (j.find("includeAuto") != j.end() && !j.at("includeAuto").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1168 | 1170 | x.set_include_auto(get_stack_optional<int64_t>(j, "includeAuto")); |
| 1169 | 1171 | x.set_metadata_operator(get_stack_optional<MetadataOperator>(j, "operator")); |
| 1170 | 1172 | x.set_table_column_id(get_stack_optional<TableColumnId>(j, "tableColumnId")); |
| 1173 | + if (j.find("unifiedVersion") != j.end() && !j.at("unifiedVersion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1171 | 1174 | x.set_unified_version(get_stack_optional<int64_t>(j, "unifiedVersion")); |
| 1172 | 1175 | } |
| 1173 | 1176 | |
| @@ -1255,6 +1258,7 @@ namespace quicktype { | ||
| 1255 | 1258 | |
| 1256 | 1259 | inline void from_json(const json & j, Field& x) { |
| 1257 | 1260 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1261 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1258 | 1262 | x.set_table_column_id(j.at("tableColumnId").get<int64_t>()); |
| 1259 | 1263 | x.set_type(j.at("type").get<FieldType>()); |
| 1260 | 1264 | } |
| @@ -1394,6 +1398,7 @@ namespace quicktype { | ||
| 1394 | 1398 | x.set_display_name(j.at("displayName").get<std::string>()); |
| 1395 | 1399 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 1396 | 1400 | x.set_id(j.at("id").get<std::string>()); |
| 1401 | + if (j.find("lastNotificationSeenAt") != j.end() && !j.at("lastNotificationSeenAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1397 | 1402 | x.set_last_notification_seen_at(get_stack_optional<int64_t>(j, "lastNotificationSeenAt")); |
| 1398 | 1403 | x.set_profile_image_url_large(get_stack_optional<std::string>(j, "profileImageUrlLarge")); |
| 1399 | 1404 | x.set_profile_image_url_medium(get_stack_optional<std::string>(j, "profileImageUrlMedium")); |
| @@ -1419,6 +1424,7 @@ namespace quicktype { | ||
| 1419 | 1424 | |
| 1420 | 1425 | inline void from_json(const json & j, Ratings& x) { |
| 1421 | 1426 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1427 | + if (j.find("rating") != j.end() && !j.at("rating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1422 | 1428 | x.set_rating(j.at("rating").get<int64_t>()); |
| 1423 | 1429 | } |
| 1424 | 1430 | |
| @@ -1447,17 +1453,21 @@ namespace quicktype { | ||
| 1447 | 1453 | |
| 1448 | 1454 | inline void from_json(const json & j, TopLevelElement& x) { |
| 1449 | 1455 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1456 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1450 | 1457 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 1451 | 1458 | x.set_category(get_stack_optional<std::string>(j, "category")); |
| 1459 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1452 | 1460 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 1453 | 1461 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 1454 | 1462 | x.set_display_type(get_stack_optional<DisplayType>(j, "displayType")); |
| 1463 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1455 | 1464 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 1456 | 1465 | x.set_flags(get_stack_optional<std::vector<TopLevelFlag>>(j, "flags")); |
| 1457 | 1466 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 1458 | 1467 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 1459 | 1468 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 1460 | 1469 | x.set_id(j.at("id").get<std::string>()); |
| 1470 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1461 | 1471 | x.set_index_updated_at(get_stack_optional<int64_t>(j, "indexUpdatedAt")); |
| 1462 | 1472 | x.set_locale(j.at("locale").get<std::string>()); |
| 1463 | 1473 | x.set_metadata(j.at("metadata").get<TopLevelMetadata>()); |
| @@ -1465,26 +1475,36 @@ namespace quicktype { | ||
| 1465 | 1475 | x.set_modifying_view_uid(get_stack_optional<ModifyingViewUid>(j, "modifyingViewUid")); |
| 1466 | 1476 | x.set_name(j.at("name").get<std::string>()); |
| 1467 | 1477 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 1478 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1468 | 1479 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 1480 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1469 | 1481 | x.set_oid(j.at("oid").get<int64_t>()); |
| 1470 | 1482 | x.set_owner(j.at("owner").get<Owner>()); |
| 1471 | 1483 | x.set_provenance(j.at("provenance").get<Provenance>()); |
| 1472 | 1484 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 1485 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1473 | 1486 | x.set_publication_date(get_stack_optional<int64_t>(j, "publicationDate")); |
| 1487 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1474 | 1488 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 1475 | 1489 | x.set_publication_stage(j.at("publicationStage").get<PublicationStage>()); |
| 1476 | 1490 | x.set_ratings(get_stack_optional<Ratings>(j, "ratings")); |
| 1477 | 1491 | x.set_resource_name(get_stack_optional<std::string>(j, "resourceName")); |
| 1478 | 1492 | x.set_rights(j.at("rights").get<std::vector<Right>>()); |
| 1479 | 1493 | x.set_row_class(get_stack_optional<std::string>(j, "rowClass")); |
| 1494 | + if (j.find("rowIdentifierColumnId") != j.end() && !j.at("rowIdentifierColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1480 | 1495 | x.set_row_identifier_column_id(get_stack_optional<int64_t>(j, "rowIdentifierColumnId")); |
| 1496 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1481 | 1497 | x.set_rows_updated_at(get_stack_optional<int64_t>(j, "rowsUpdatedAt")); |
| 1482 | 1498 | x.set_rows_updated_by(get_stack_optional<RowsUpdatedBy>(j, "rowsUpdatedBy")); |
| 1483 | 1499 | x.set_table_author(j.at("tableAuthor").get<TableAuthor>()); |
| 1500 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1484 | 1501 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 1485 | 1502 | x.set_tags(get_stack_optional<std::vector<std::string>>(j, "tags")); |
| 1503 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1486 | 1504 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 1505 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1487 | 1506 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 1507 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1488 | 1508 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 1489 | 1509 | x.set_view_type(j.at("viewType").get<ViewType>()); |
| 1490 | 1510 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/f22f5.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -543,8 +543,10 @@ namespace quicktype { | ||
| 543 | 543 | x.set_created_utc(j.at("created_utc").get<double>()); |
| 544 | 544 | x.set_distinguished(get_untyped(j, "distinguished")); |
| 545 | 545 | x.set_domain(j.at("domain").get<std::string>()); |
| 546 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 546 | 547 | x.set_downs(j.at("downs").get<int64_t>()); |
| 547 | 548 | x.set_edited(j.at("edited").get<bool>()); |
| 549 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 548 | 550 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 549 | 551 | x.set_hidden(j.at("hidden").get<bool>()); |
| 550 | 552 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -559,6 +561,7 @@ namespace quicktype { | ||
| 559 | 561 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 560 | 562 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 561 | 563 | x.set_name(j.at("name").get<std::string>()); |
| 564 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 562 | 565 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 563 | 566 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 564 | 567 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -567,6 +570,7 @@ namespace quicktype { | ||
| 567 | 570 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 568 | 571 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 569 | 572 | x.set_saved(j.at("saved").get<bool>()); |
| 573 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 570 | 574 | x.set_score(j.at("score").get<int64_t>()); |
| 571 | 575 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 572 | 576 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -581,6 +585,7 @@ namespace quicktype { | ||
| 581 | 585 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 582 | 586 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 583 | 587 | x.set_title(j.at("title").get<std::string>()); |
| 588 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 584 | 589 | x.set_ups(j.at("ups").get<int64_t>()); |
| 585 | 590 | x.set_url(j.at("url").get<std::string>()); |
| 586 | 591 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +5 −0test/inputs/json/misc/f3edf.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/f466a.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -84,11 +84,16 @@ namespace quicktype { | ||
| 84 | 84 | |
| 85 | 85 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 86 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 87 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 87 | 88 | x.set_age(j.at("age").get<int64_t>()); |
| 88 | 89 | x.set_country(j.at("country").get<Country>()); |
| 90 | + if (j.find("females") != j.end() && !j.at("females").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 89 | 91 | x.set_females(j.at("females").get<int64_t>()); |
| 92 | + if (j.find("males") != j.end() && !j.at("males").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 90 | 93 | x.set_males(j.at("males").get<int64_t>()); |
| 94 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 95 | x.set_total(j.at("total").get<int64_t>()); |
| 96 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 92 | 97 | x.set_year(j.at("year").get<int64_t>()); |
| 93 | 98 | } |
Test case
1 generated file · +5 −0test/inputs/json/misc/f6a65.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -760,6 +760,7 @@ namespace quicktype { | ||
| 760 | 760 | x.set_id(j.at("id").get<std::string>()); |
| 761 | 761 | x.set_images(j.at("images").get<Images>()); |
| 762 | 762 | x.set_import_datetime(j.at("import_datetime").get<std::string>()); |
| 763 | + if (j.find("is_indexable") != j.end() && !j.at("is_indexable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 763 | 764 | x.set_is_indexable(j.at("is_indexable").get<int64_t>()); |
| 764 | 765 | x.set_rating(j.at("rating").get<Rating>()); |
| 765 | 766 | x.set_slug(j.at("slug").get<std::string>()); |
| @@ -799,6 +800,7 @@ namespace quicktype { | ||
| 799 | 800 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 800 | 801 | x.set_msg(j.at("msg").get<std::string>()); |
| 801 | 802 | x.set_response_id(j.at("response_id").get<std::string>()); |
| 803 | + if (j.find("status") != j.end() && !j.at("status").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 802 | 804 | x.set_status(j.at("status").get<int64_t>()); |
| 803 | 805 | } |
| 804 | 806 | |
| @@ -811,8 +813,11 @@ namespace quicktype { | ||
| 811 | 813 | |
| 812 | 814 | inline void from_json(const json & j, Pagination& x) { |
| 813 | 815 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 816 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 814 | 817 | x.set_count(j.at("count").get<int64_t>()); |
| 818 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 815 | 819 | x.set_offset(j.at("offset").get<int64_t>()); |
| 820 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 816 | 821 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 817 | 822 | } |
Test case
1 generated file · +20 −0test/inputs/json/misc/f74d5.json
Mcplusplusdefault / quicktype.hpp+20 −0
| @@ -635,6 +635,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 635 | 635 | namespace quicktype { |
| 636 | 636 | inline void from_json(const json & j, Top& x) { |
| 637 | 637 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 638 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 638 | 639 | x.set_count(j.at("count").get<int64_t>()); |
| 639 | 640 | x.set_item(j.at("item").get<std::string>()); |
| 640 | 641 | } |
| @@ -649,7 +650,9 @@ namespace quicktype { | ||
| 649 | 650 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 650 | 651 | x.set_average(get_stack_optional<std::string>(j, "average")); |
| 651 | 652 | x.set_largest(j.at("largest").get<std::string>()); |
| 653 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 652 | 654 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 655 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 653 | 656 | x.set_null(j.at("null").get<int64_t>()); |
| 654 | 657 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 655 | 658 | x.set_sum(get_stack_optional<std::string>(j, "sum")); |
| @@ -685,11 +688,15 @@ namespace quicktype { | ||
| 685 | 688 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 686 | 689 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 687 | 690 | x.set_format(j.at("format").get<Query>()); |
| 691 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 688 | 692 | x.set_id(j.at("id").get<int64_t>()); |
| 689 | 693 | x.set_name(j.at("name").get<std::string>()); |
| 694 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 690 | 695 | x.set_position(j.at("position").get<int64_t>()); |
| 691 | 696 | x.set_render_type_name(j.at("renderTypeName").get<TypeName>()); |
| 697 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 692 | 698 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 699 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 693 | 700 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 694 | 701 | } |
| 695 | 702 | |
| @@ -786,17 +793,21 @@ namespace quicktype { | ||
| 786 | 793 | |
| 787 | 794 | inline void from_json(const json & j, View& x) { |
| 788 | 795 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 796 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 789 | 797 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 790 | 798 | x.set_category(j.at("category").get<std::string>()); |
| 791 | 799 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 800 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 792 | 801 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 793 | 802 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 803 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 794 | 804 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 795 | 805 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 796 | 806 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 797 | 807 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 798 | 808 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 799 | 809 | x.set_id(j.at("id").get<std::string>()); |
| 810 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 800 | 811 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 801 | 812 | x.set_license(j.at("license").get<License>()); |
| 802 | 813 | x.set_license_id(j.at("licenseId").get<std::string>()); |
| @@ -804,23 +815,32 @@ namespace quicktype { | ||
| 804 | 815 | x.set_metadata(j.at("metadata").get<Metadata>()); |
| 805 | 816 | x.set_name(j.at("name").get<std::string>()); |
| 806 | 817 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 818 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 807 | 819 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 820 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 808 | 821 | x.set_oid(j.at("oid").get<int64_t>()); |
| 809 | 822 | x.set_owner(j.at("owner").get<Owner>()); |
| 810 | 823 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 811 | 824 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 825 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 812 | 826 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 827 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 813 | 828 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 814 | 829 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 815 | 830 | x.set_query(j.at("query").get<Query>()); |
| 816 | 831 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 817 | 832 | x.set_row_class(j.at("rowClass").get<std::string>()); |
| 833 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 818 | 834 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 819 | 835 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 820 | 836 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 837 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 821 | 838 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 839 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 822 | 840 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 841 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 823 | 842 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 843 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 824 | 844 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 825 | 845 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 826 | 846 | } |
Test case
1 generated file · +3 −0test/inputs/json/misc/f974d.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -72,9 +72,12 @@ namespace quicktype { | ||
| 72 | 72 | |
| 73 | 73 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 74 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 75 | + if (j.find("block_index") != j.end() && !j.at("block_index").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 75 | 76 | x.set_block_index(j.at("block_index").get<int64_t>()); |
| 76 | 77 | x.set_hash(j.at("hash").get<std::string>()); |
| 78 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 77 | 79 | x.set_height(j.at("height").get<int64_t>()); |
| 80 | + if (j.find("time") != j.end() && !j.at("time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 81 | x.set_time(j.at("time").get<int64_t>()); |
| 79 | 82 | x.set_tx_indexes(j.at("txIndexes").get<std::vector<int64_t>>()); |
| 80 | 83 | } |
Test case
1 generated file · +2 −0test/inputs/json/misc/faff5.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -74,7 +74,9 @@ namespace quicktype { | ||
| 74 | 74 | |
| 75 | 75 | inline void from_json(const json & j, Response& x) { |
| 76 | 76 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 77 | + if (j.find("player_count") != j.end() && !j.at("player_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 77 | 78 | x.set_player_count(j.at("player_count").get<int64_t>()); |
| 79 | + if (j.find("result") != j.end() && !j.at("result").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 80 | x.set_result(j.at("result").get<int64_t>()); |
| 79 | 81 | } |
Test case
1 generated file · +23 −0test/inputs/json/misc/fcca3.json
Mcplusplusdefault / quicktype.hpp+23 −0
| @@ -1074,6 +1074,7 @@ struct adl_serializer<std::variant<int64_t, std::string>> { | ||
| 1074 | 1074 | namespace quicktype { |
| 1075 | 1075 | inline void from_json(const json & j, Top& x) { |
| 1076 | 1076 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1077 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1077 | 1078 | x.set_count(j.at("count").get<int64_t>()); |
| 1078 | 1079 | x.set_item(j.at("item").get<std::string>()); |
| 1079 | 1080 | } |
| @@ -1088,7 +1089,9 @@ namespace quicktype { | ||
| 1088 | 1089 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1089 | 1090 | x.set_average(get_stack_optional<std::string>(j, "average")); |
| 1090 | 1091 | x.set_largest(j.at("largest").get<std::string>()); |
| 1092 | + if (j.find("non_null") != j.end() && !j.at("non_null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1091 | 1093 | x.set_non_null(j.at("non_null").get<int64_t>()); |
| 1094 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1092 | 1095 | x.set_null(j.at("null").get<int64_t>()); |
| 1093 | 1096 | x.set_smallest(j.at("smallest").get<std::string>()); |
| 1094 | 1097 | x.set_sum(get_stack_optional<std::string>(j, "sum")); |
| @@ -1128,11 +1131,15 @@ namespace quicktype { | ||
| 1128 | 1131 | x.set_field_name(j.at("fieldName").get<std::string>()); |
| 1129 | 1132 | x.set_flags(get_stack_optional<std::vector<std::string>>(j, "flags")); |
| 1130 | 1133 | x.set_format(j.at("format").get<Format>()); |
| 1134 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1131 | 1135 | x.set_id(j.at("id").get<int64_t>()); |
| 1132 | 1136 | x.set_name(j.at("name").get<std::string>()); |
| 1137 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1133 | 1138 | x.set_position(j.at("position").get<int64_t>()); |
| 1134 | 1139 | x.set_render_type_name(j.at("renderTypeName").get<TypeName>()); |
| 1140 | + if (j.find("tableColumnId") != j.end() && !j.at("tableColumnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1135 | 1141 | x.set_table_column_id(get_stack_optional<int64_t>(j, "tableColumnId")); |
| 1142 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1136 | 1143 | x.set_width(get_stack_optional<int64_t>(j, "width")); |
| 1137 | 1144 | } |
| 1138 | 1145 | |
| @@ -1256,6 +1263,7 @@ namespace quicktype { | ||
| 1256 | 1263 | |
| 1257 | 1264 | inline void from_json(const json & j, TableColumnId& x) { |
| 1258 | 1265 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1266 | + if (j.find("703610") != j.end() && !j.at("703610").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1259 | 1267 | x.set_the_703610(j.at("703610").get<int64_t>()); |
| 1260 | 1268 | } |
| 1261 | 1269 | |
| @@ -1295,6 +1303,7 @@ namespace quicktype { | ||
| 1295 | 1303 | inline void from_json(const json & j, FilterConditionMetadata& x) { |
| 1296 | 1304 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1297 | 1305 | x.set_advanced(j.at("advanced").get<bool>()); |
| 1306 | + if (j.find("unifiedVersion") != j.end() && !j.at("unifiedVersion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1298 | 1307 | x.set_unified_version(j.at("unifiedVersion").get<int64_t>()); |
| 1299 | 1308 | } |
| 1300 | 1309 | |
| @@ -1412,6 +1421,7 @@ namespace quicktype { | ||
| 1412 | 1421 | |
| 1413 | 1422 | inline void from_json(const json & j, Expression& x) { |
| 1414 | 1423 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1424 | + if (j.find("columnId") != j.end() && !j.at("columnId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1415 | 1425 | x.set_column_id(j.at("columnId").get<int64_t>()); |
| 1416 | 1426 | x.set_type(j.at("type").get<std::string>()); |
| 1417 | 1427 | } |
| @@ -1447,40 +1457,53 @@ namespace quicktype { | ||
| 1447 | 1457 | inline void from_json(const json & j, View& x) { |
| 1448 | 1458 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1449 | 1459 | x.set_attribution(j.at("attribution").get<std::string>()); |
| 1460 | + if (j.find("averageRating") != j.end() && !j.at("averageRating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1450 | 1461 | x.set_average_rating(j.at("averageRating").get<int64_t>()); |
| 1451 | 1462 | x.set_category(j.at("category").get<std::string>()); |
| 1452 | 1463 | x.set_columns(j.at("columns").get<std::vector<Column>>()); |
| 1464 | + if (j.find("createdAt") != j.end() && !j.at("createdAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1453 | 1465 | x.set_created_at(j.at("createdAt").get<int64_t>()); |
| 1454 | 1466 | x.set_description(j.at("description").get<std::string>()); |
| 1455 | 1467 | x.set_display_type(j.at("displayType").get<std::string>()); |
| 1468 | + if (j.find("downloadCount") != j.end() && !j.at("downloadCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1456 | 1469 | x.set_download_count(j.at("downloadCount").get<int64_t>()); |
| 1457 | 1470 | x.set_flags(j.at("flags").get<std::vector<std::string>>()); |
| 1458 | 1471 | x.set_grants(j.at("grants").get<std::vector<Grant>>()); |
| 1459 | 1472 | x.set_hide_from_catalog(j.at("hideFromCatalog").get<bool>()); |
| 1460 | 1473 | x.set_hide_from_data_json(j.at("hideFromDataJson").get<bool>()); |
| 1461 | 1474 | x.set_id(j.at("id").get<std::string>()); |
| 1475 | + if (j.find("indexUpdatedAt") != j.end() && !j.at("indexUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1462 | 1476 | x.set_index_updated_at(j.at("indexUpdatedAt").get<int64_t>()); |
| 1463 | 1477 | x.set_locale(j.at("locale").get<std::string>()); |
| 1464 | 1478 | x.set_metadata(j.at("metadata").get<ViewMetadata>()); |
| 1465 | 1479 | x.set_name(j.at("name").get<std::string>()); |
| 1466 | 1480 | x.set_new_backend(j.at("newBackend").get<bool>()); |
| 1481 | + if (j.find("numberOfComments") != j.end() && !j.at("numberOfComments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1467 | 1482 | x.set_number_of_comments(j.at("numberOfComments").get<int64_t>()); |
| 1483 | + if (j.find("oid") != j.end() && !j.at("oid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1468 | 1484 | x.set_oid(j.at("oid").get<int64_t>()); |
| 1469 | 1485 | x.set_owner(j.at("owner").get<Owner>()); |
| 1470 | 1486 | x.set_provenance(j.at("provenance").get<std::string>()); |
| 1471 | 1487 | x.set_publication_append_enabled(j.at("publicationAppendEnabled").get<bool>()); |
| 1488 | + if (j.find("publicationDate") != j.end() && !j.at("publicationDate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1472 | 1489 | x.set_publication_date(j.at("publicationDate").get<int64_t>()); |
| 1490 | + if (j.find("publicationGroup") != j.end() && !j.at("publicationGroup").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1473 | 1491 | x.set_publication_group(j.at("publicationGroup").get<int64_t>()); |
| 1474 | 1492 | x.set_publication_stage(j.at("publicationStage").get<std::string>()); |
| 1475 | 1493 | x.set_query(j.at("query").get<Query>()); |
| 1476 | 1494 | x.set_rights(j.at("rights").get<std::vector<std::string>>()); |
| 1495 | + if (j.find("rowsUpdatedAt") != j.end() && !j.at("rowsUpdatedAt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1477 | 1496 | x.set_rows_updated_at(j.at("rowsUpdatedAt").get<int64_t>()); |
| 1478 | 1497 | x.set_rows_updated_by(j.at("rowsUpdatedBy").get<std::string>()); |
| 1479 | 1498 | x.set_table_author(j.at("tableAuthor").get<Owner>()); |
| 1499 | + if (j.find("tableId") != j.end() && !j.at("tableId").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1480 | 1500 | x.set_table_id(j.at("tableId").get<int64_t>()); |
| 1481 | 1501 | x.set_tags(j.at("tags").get<std::vector<std::string>>()); |
| 1502 | + if (j.find("totalTimesRated") != j.end() && !j.at("totalTimesRated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1482 | 1503 | x.set_total_times_rated(j.at("totalTimesRated").get<int64_t>()); |
| 1504 | + if (j.find("viewCount") != j.end() && !j.at("viewCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1483 | 1505 | x.set_view_count(j.at("viewCount").get<int64_t>()); |
| 1506 | + if (j.find("viewLastModified") != j.end() && !j.at("viewLastModified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1484 | 1507 | x.set_view_last_modified(j.at("viewLastModified").get<int64_t>()); |
| 1485 | 1508 | x.set_view_type(j.at("viewType").get<std::string>()); |
| 1486 | 1509 | } |
Test case
1 generated file · +1 −0test/inputs/json/misc/fd329.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -124,6 +124,7 @@ namespace quicktype { | ||
| 124 | 124 | inline void from_json(const json & j, Description& x) { |
| 125 | 125 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 126 | 126 | x.set_base_period(j.at("base_period").get<std::string>()); |
| 127 | + if (j.find("missing") != j.end() && !j.at("missing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 127 | 128 | x.set_missing(j.at("missing").get<int64_t>()); |
| 128 | 129 | x.set_title(j.at("title").get<std::string>()); |
| 129 | 130 | x.set_units(j.at("units").get<std::string>()); |
Test case
1 generated file · +62 −0test/inputs/json/priority/bug427.json
Mcplusplusdefault / quicktype.hpp+62 −0
| @@ -2763,8 +2763,10 @@ namespace quicktype { | ||
| 2763 | 2763 | |
| 2764 | 2764 | inline void from_json(const json & j, Source& x) { |
| 2765 | 2765 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2766 | + if (j.find("character") != j.end() && !j.at("character").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2766 | 2767 | x.set_character(j.at("character").get<int64_t>()); |
| 2767 | 2768 | x.set_file_name(j.at("fileName").get<FileName>()); |
| 2769 | + if (j.find("line") != j.end() && !j.at("line").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2768 | 2770 | x.set_line(j.at("line").get<int64_t>()); |
| 2769 | 2771 | } |
| 2770 | 2772 | |
| @@ -2792,6 +2794,7 @@ namespace quicktype { | ||
| 2792 | 2794 | inline void from_json(const json & j, Group& x) { |
| 2793 | 2795 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2794 | 2796 | x.set_children(j.at("children").get<std::vector<int64_t>>()); |
| 2797 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2795 | 2798 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2796 | 2799 | x.set_title(j.at("title").get<std::string>()); |
| 2797 | 2800 | } |
| @@ -2847,7 +2850,9 @@ namespace quicktype { | ||
| 2847 | 2850 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2848 | 2851 | x.set_comment(get_stack_optional<TentacledComment>(j, "comment")); |
| 2849 | 2852 | x.set_flags(j.at("flags").get<TentacledFlags>()); |
| 2853 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2850 | 2854 | x.set_id(j.at("id").get<int64_t>()); |
| 2855 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2851 | 2856 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2852 | 2857 | x.set_kind_string(j.at("kindString").get<ParameterKindString>()); |
| 2853 | 2858 | x.set_name(j.at("name").get<std::string>()); |
| @@ -2884,7 +2889,9 @@ namespace quicktype { | ||
| 2884 | 2889 | inline void from_json(const json & j, IndexSignatureElement& x) { |
| 2885 | 2890 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2886 | 2891 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 2892 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2887 | 2893 | x.set_id(j.at("id").get<int64_t>()); |
| 2894 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2888 | 2895 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2889 | 2896 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 2890 | 2897 | x.set_name(j.at("name").get<std::string>()); |
| @@ -2921,7 +2928,9 @@ namespace quicktype { | ||
| 2921 | 2928 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2922 | 2929 | x.set_comment(get_stack_optional<FluffyComment>(j, "comment")); |
| 2923 | 2930 | x.set_flags(j.at("flags").get<FluffyFlags>()); |
| 2931 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2924 | 2932 | x.set_id(j.at("id").get<int64_t>()); |
| 2933 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2925 | 2934 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2926 | 2935 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 2927 | 2936 | x.set_name(j.at("name").get<std::string>()); |
| @@ -2948,7 +2957,9 @@ namespace quicktype { | ||
| 2948 | 2957 | x.set_default_value(get_stack_optional<std::string>(j, "defaultValue")); |
| 2949 | 2958 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 2950 | 2959 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 2960 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2951 | 2961 | x.set_id(j.at("id").get<int64_t>()); |
| 2962 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2952 | 2963 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2953 | 2964 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 2954 | 2965 | x.set_name(j.at("name").get<std::string>()); |
| @@ -2982,7 +2993,9 @@ namespace quicktype { | ||
| 2982 | 2993 | x.set_children(j.at("children").get<std::vector<GetSignature>>()); |
| 2983 | 2994 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 2984 | 2995 | x.set_groups(j.at("groups").get<std::vector<Group>>()); |
| 2996 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2985 | 2997 | x.set_id(j.at("id").get<int64_t>()); |
| 2998 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2986 | 2999 | x.set_kind(j.at("kind").get<int64_t>()); |
| 2987 | 3000 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 2988 | 3001 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3017,7 +3030,9 @@ namespace quicktype { | ||
| 3017 | 3030 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3018 | 3031 | x.set_comment(get_stack_optional<PurpleComment>(j, "comment")); |
| 3019 | 3032 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3033 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3020 | 3034 | x.set_id(j.at("id").get<int64_t>()); |
| 3035 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3021 | 3036 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3022 | 3037 | x.set_kind_string(j.at("kindString").get<SignatureKindString>()); |
| 3023 | 3038 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3060,7 +3075,9 @@ namespace quicktype { | ||
| 3060 | 3075 | x.set_comment(get_stack_optional<PurpleComment>(j, "comment")); |
| 3061 | 3076 | x.set_default_value(get_stack_optional<std::string>(j, "defaultValue")); |
| 3062 | 3077 | x.set_flags(j.at("flags").get<PurpleFlags>()); |
| 3078 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3063 | 3079 | x.set_id(j.at("id").get<int64_t>()); |
| 3080 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3064 | 3081 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3065 | 3082 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 3066 | 3083 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3136,6 +3153,7 @@ namespace quicktype { | ||
| 3136 | 3153 | inline void from_json(const json & j, ExtendedBy& x) { |
| 3137 | 3154 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3138 | 3155 | x.set_constraint(get_heap_optional<ExtendedBy>(j, "constraint")); |
| 3156 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3139 | 3157 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3140 | 3158 | x.set_name(j.at("name").get<std::string>()); |
| 3141 | 3159 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3169,6 +3187,7 @@ namespace quicktype { | ||
| 3169 | 3187 | x.set_declaration(get_heap_optional<GetSignature>(j, "declaration")); |
| 3170 | 3188 | x.set_element_type(get_stack_optional<ElementType>(j, "elementType")); |
| 3171 | 3189 | x.set_elements(get_stack_optional<std::vector<ExtendedBy>>(j, "elements")); |
| 3190 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3172 | 3191 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3173 | 3192 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 3174 | 3193 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3191,7 +3210,9 @@ namespace quicktype { | ||
| 3191 | 3210 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3192 | 3211 | x.set_comment(get_stack_optional<TentacledComment>(j, "comment")); |
| 3193 | 3212 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3213 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3194 | 3214 | x.set_id(j.at("id").get<int64_t>()); |
| 3215 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3195 | 3216 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3196 | 3217 | x.set_kind_string(j.at("kindString").get<ParameterKindString>()); |
| 3197 | 3218 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3213,9 +3234,11 @@ namespace quicktype { | ||
| 3213 | 3234 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3214 | 3235 | x.set_comment(get_stack_optional<StickyComment>(j, "comment")); |
| 3215 | 3236 | x.set_flags(j.at("flags").get<IndigoFlags>()); |
| 3237 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3216 | 3238 | x.set_id(j.at("id").get<int64_t>()); |
| 3217 | 3239 | x.set_implementation_of(get_heap_optional<ExtendedBy>(j, "implementationOf")); |
| 3218 | 3240 | x.set_inherited_from(get_heap_optional<ExtendedBy>(j, "inheritedFrom")); |
| 3241 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3219 | 3242 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3220 | 3243 | x.set_kind_string(j.at("kindString").get<SignatureKindString>()); |
| 3221 | 3244 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3261,7 +3284,9 @@ namespace quicktype { | ||
| 3261 | 3284 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3262 | 3285 | x.set_comment(get_stack_optional<FluffyComment>(j, "comment")); |
| 3263 | 3286 | x.set_flags(j.at("flags").get<FluffyFlags>()); |
| 3287 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3264 | 3288 | x.set_id(j.at("id").get<int64_t>()); |
| 3289 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3265 | 3290 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3266 | 3291 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 3267 | 3292 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3296,7 +3321,9 @@ namespace quicktype { | ||
| 3296 | 3321 | inline void from_json(const json & j, IndexSignature& x) { |
| 3297 | 3322 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3298 | 3323 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3324 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3299 | 3325 | x.set_id(j.at("id").get<int64_t>()); |
| 3326 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3300 | 3327 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3301 | 3328 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3302 | 3329 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3331,7 +3358,9 @@ namespace quicktype { | ||
| 3331 | 3358 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3332 | 3359 | x.set_comment(get_stack_optional<FluffyComment>(j, "comment")); |
| 3333 | 3360 | x.set_flags(j.at("flags").get<FluffyFlags>()); |
| 3361 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3334 | 3362 | x.set_id(j.at("id").get<int64_t>()); |
| 3363 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3335 | 3364 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3336 | 3365 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3337 | 3366 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3355,7 +3384,9 @@ namespace quicktype { | ||
| 3355 | 3384 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3356 | 3385 | x.set_comment(get_stack_optional<IndigoComment>(j, "comment")); |
| 3357 | 3386 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3387 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3358 | 3388 | x.set_id(j.at("id").get<int64_t>()); |
| 3389 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3359 | 3390 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3360 | 3391 | x.set_kind_string(j.at("kindString").get<SignatureKindString>()); |
| 3361 | 3392 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3380,8 +3411,10 @@ namespace quicktype { | ||
| 3380 | 3411 | x.set_children(get_stack_optional<std::vector<StickyChild>>(j, "children")); |
| 3381 | 3412 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3382 | 3413 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3414 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3383 | 3415 | x.set_id(j.at("id").get<int64_t>()); |
| 3384 | 3416 | x.set_index_signature(get_stack_optional<IndexSignature>(j, "indexSignature")); |
| 3417 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3385 | 3418 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3386 | 3419 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3387 | 3420 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3423,6 +3456,7 @@ namespace quicktype { | ||
| 3423 | 3456 | x.set_declaration(get_stack_optional<FluffyDeclaration>(j, "declaration")); |
| 3424 | 3457 | x.set_element_type(get_heap_optional<ExtendedBy>(j, "elementType")); |
| 3425 | 3458 | x.set_elements(get_stack_optional<std::vector<ElementType>>(j, "elements")); |
| 3459 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3426 | 3460 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3427 | 3461 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 3428 | 3462 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3451,9 +3485,11 @@ namespace quicktype { | ||
| 3451 | 3485 | x.set_flags(j.at("flags").get<StickyFlags>()); |
| 3452 | 3486 | x.set_get_signature(get_heap_optional<GetSignature>(j, "getSignature")); |
| 3453 | 3487 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3488 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3454 | 3489 | x.set_id(j.at("id").get<int64_t>()); |
| 3455 | 3490 | x.set_implementation_of(get_heap_optional<ExtendedBy>(j, "implementationOf")); |
| 3456 | 3491 | x.set_inherited_from(get_heap_optional<ExtendedBy>(j, "inheritedFrom")); |
| 3492 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3457 | 3493 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3458 | 3494 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 3459 | 3495 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3512,7 +3548,9 @@ namespace quicktype { | ||
| 3512 | 3548 | x.set_comment(j.at("comment").get<FluffyComment>()); |
| 3513 | 3549 | x.set_default_value(get_stack_optional<std::string>(j, "defaultValue")); |
| 3514 | 3550 | x.set_flags(j.at("flags").get<FluffyFlags>()); |
| 3551 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3515 | 3552 | x.set_id(j.at("id").get<int64_t>()); |
| 3553 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3516 | 3554 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3517 | 3555 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 3518 | 3556 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3538,8 +3576,10 @@ namespace quicktype { | ||
| 3538 | 3576 | x.set_children(get_stack_optional<std::vector<IndigoChild>>(j, "children")); |
| 3539 | 3577 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3540 | 3578 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3579 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3541 | 3580 | x.set_id(j.at("id").get<int64_t>()); |
| 3542 | 3581 | x.set_index_signature(get_heap_optional<IndexSignatureElement>(j, "indexSignature")); |
| 3582 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3543 | 3583 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3544 | 3584 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3545 | 3585 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3565,6 +3605,7 @@ namespace quicktype { | ||
| 3565 | 3605 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3566 | 3606 | x.set_declaration(get_stack_optional<TentacledDeclaration>(j, "declaration")); |
| 3567 | 3607 | x.set_element_type(get_stack_optional<ElementType>(j, "elementType")); |
| 3608 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3568 | 3609 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3569 | 3610 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 3570 | 3611 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3586,7 +3627,9 @@ namespace quicktype { | ||
| 3586 | 3627 | x.set_comment(get_stack_optional<TentacledComment>(j, "comment")); |
| 3587 | 3628 | x.set_default_value(get_stack_optional<std::string>(j, "defaultValue")); |
| 3588 | 3629 | x.set_flags(j.at("flags").get<TentacledFlags>()); |
| 3630 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3589 | 3631 | x.set_id(j.at("id").get<int64_t>()); |
| 3632 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3590 | 3633 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3591 | 3634 | x.set_kind_string(j.at("kindString").get<ParameterKindString>()); |
| 3592 | 3635 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3610,6 +3653,7 @@ namespace quicktype { | ||
| 3610 | 3653 | inline void from_json(const json & j, CunningType& x) { |
| 3611 | 3654 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3612 | 3655 | x.set_declaration(get_stack_optional<PurpleDeclaration>(j, "declaration")); |
| 3656 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3613 | 3657 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3614 | 3658 | x.set_name(get_stack_optional<Name>(j, "name")); |
| 3615 | 3659 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3629,7 +3673,9 @@ namespace quicktype { | ||
| 3629 | 3673 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3630 | 3674 | x.set_comment(j.at("comment").get<StickyComment>()); |
| 3631 | 3675 | x.set_flags(j.at("flags").get<IndigoFlags>()); |
| 3676 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3632 | 3677 | x.set_id(j.at("id").get<int64_t>()); |
| 3678 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3633 | 3679 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3634 | 3680 | x.set_kind_string(j.at("kindString").get<SignatureKindString>()); |
| 3635 | 3681 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3656,7 +3702,9 @@ namespace quicktype { | ||
| 3656 | 3702 | x.set_children(get_stack_optional<std::vector<GetSignature>>(j, "children")); |
| 3657 | 3703 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3658 | 3704 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3705 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3659 | 3706 | x.set_id(j.at("id").get<int64_t>()); |
| 3707 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3660 | 3708 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3661 | 3709 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3662 | 3710 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3694,7 +3742,9 @@ namespace quicktype { | ||
| 3694 | 3742 | inline void from_json(const json & j, IndecentChild& x) { |
| 3695 | 3743 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3696 | 3744 | x.set_flags(j.at("flags").get<FluffyFlags>()); |
| 3745 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3697 | 3746 | x.set_id(j.at("id").get<int64_t>()); |
| 3747 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3698 | 3748 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3699 | 3749 | x.set_kind_string(j.at("kindString").get<PurpleKindString>()); |
| 3700 | 3750 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3718,7 +3768,9 @@ namespace quicktype { | ||
| 3718 | 3768 | x.set_children(get_stack_optional<std::vector<IndecentChild>>(j, "children")); |
| 3719 | 3769 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3720 | 3770 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3771 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3721 | 3772 | x.set_id(j.at("id").get<int64_t>()); |
| 3773 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3722 | 3774 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3723 | 3775 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3724 | 3776 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3756,6 +3808,7 @@ namespace quicktype { | ||
| 3756 | 3808 | x.set_declaration(get_stack_optional<StickyDeclaration>(j, "declaration")); |
| 3757 | 3809 | x.set_element_type(get_stack_optional<ElementType>(j, "elementType")); |
| 3758 | 3810 | x.set_elements(get_stack_optional<std::vector<ExtendedBy>>(j, "elements")); |
| 3811 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3759 | 3812 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3760 | 3813 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 3761 | 3814 | x.set_type(j.at("type").get<TypeEnum>()); |
| @@ -3779,6 +3832,7 @@ namespace quicktype { | ||
| 3779 | 3832 | |
| 3780 | 3833 | inline void from_json(const json & j, MischievousType& x) { |
| 3781 | 3834 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3835 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3782 | 3836 | x.set_id(get_stack_optional<int64_t>(j, "id")); |
| 3783 | 3837 | x.set_name(get_stack_optional<Name>(j, "name")); |
| 3784 | 3838 | x.set_target(get_stack_optional<ElementType>(j, "target")); |
| @@ -3799,7 +3853,9 @@ namespace quicktype { | ||
| 3799 | 3853 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3800 | 3854 | x.set_comment(get_stack_optional<PurpleComment>(j, "comment")); |
| 3801 | 3855 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3856 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3802 | 3857 | x.set_id(j.at("id").get<int64_t>()); |
| 3858 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3803 | 3859 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3804 | 3860 | x.set_kind_string(j.at("kindString").get<std::string>()); |
| 3805 | 3861 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3826,9 +3882,11 @@ namespace quicktype { | ||
| 3826 | 3882 | x.set_extended_types(get_stack_optional<std::vector<ExtendedBy>>(j, "extendedTypes")); |
| 3827 | 3883 | x.set_flags(j.at("flags").get<IndecentFlags>()); |
| 3828 | 3884 | x.set_groups(get_stack_optional<std::vector<Group>>(j, "groups")); |
| 3885 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3829 | 3886 | x.set_id(j.at("id").get<int64_t>()); |
| 3830 | 3887 | x.set_implemented_by(get_stack_optional<std::vector<ExtendedBy>>(j, "implementedBy")); |
| 3831 | 3888 | x.set_implemented_types(get_stack_optional<std::vector<ExtendedBy>>(j, "implementedTypes")); |
| 3889 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3832 | 3890 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3833 | 3891 | x.set_kind_string(j.at("kindString").get<FluffyKindString>()); |
| 3834 | 3892 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3877,7 +3935,9 @@ namespace quicktype { | ||
| 3877 | 3935 | x.set_comment(get_stack_optional<IndecentComment>(j, "comment")); |
| 3878 | 3936 | x.set_flags(j.at("flags").get<PurpleFlags>()); |
| 3879 | 3937 | x.set_groups(j.at("groups").get<std::vector<Group>>()); |
| 3938 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3880 | 3939 | x.set_id(j.at("id").get<int64_t>()); |
| 3940 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3881 | 3941 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3882 | 3942 | x.set_kind_string(j.at("kindString").get<TentacledKindString>()); |
| 3883 | 3943 | x.set_name(j.at("name").get<std::string>()); |
| @@ -3904,7 +3964,9 @@ namespace quicktype { | ||
| 3904 | 3964 | x.set_children(j.at("children").get<std::vector<TopLevelChild>>()); |
| 3905 | 3965 | x.set_flags(j.at("flags").get<GetSignatureFlags>()); |
| 3906 | 3966 | x.set_groups(j.at("groups").get<std::vector<Group>>()); |
| 3967 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3907 | 3968 | x.set_id(j.at("id").get<int64_t>()); |
| 3969 | + if (j.find("kind") != j.end() && !j.at("kind").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3908 | 3970 | x.set_kind(j.at("kind").get<int64_t>()); |
| 3909 | 3971 | x.set_name(j.at("name").get<std::string>()); |
| 3910 | 3972 | } |
Test case
1 generated file · +5 −0test/inputs/json/priority/bug790.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -88,12 +88,17 @@ namespace quicktype { | ||
| 88 | 88 | inline void from_json(const json & j, TopLevel& x) { |
| 89 | 89 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 90 | 90 | x.set_children_data(j.at("children_data").get<std::vector<TopLevel>>()); |
| 91 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 91 | 92 | x.set_id(j.at("id").get<int64_t>()); |
| 92 | 93 | x.set_is_active(j.at("is_active").get<bool>()); |
| 94 | + if (j.find("level") != j.end() && !j.at("level").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 93 | 95 | x.set_level(j.at("level").get<int64_t>()); |
| 94 | 96 | x.set_name(j.at("name").get<std::string>()); |
| 97 | + if (j.find("parent_id") != j.end() && !j.at("parent_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 95 | 98 | x.set_parent_id(j.at("parent_id").get<int64_t>()); |
| 99 | + if (j.find("position") != j.end() && !j.at("position").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 96 | 100 | x.set_position(j.at("position").get<int64_t>()); |
| 101 | + if (j.find("product_count") != j.end() && !j.at("product_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 97 | 102 | x.set_product_count(j.at("product_count").get<int64_t>()); |
| 98 | 103 | } |
Test case
1 generated file · +2 −0test/inputs/json/priority/bug855-short.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -77,7 +77,9 @@ namespace quicktype { | ||
| 77 | 77 | x.set_channel_id(j.at("channel_id").get<std::string>()); |
| 78 | 78 | x.set_channel_name(j.at("channel_name").get<std::string>()); |
| 79 | 79 | x.set_code(j.at("code").get<std::string>()); |
| 80 | + if (j.find("emoticon_set") != j.end() && !j.at("emoticon_set").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 80 | 81 | x.set_emoticon_set(j.at("emoticon_set").get<int64_t>()); |
| 82 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 81 | 83 | x.set_id(j.at("id").get<int64_t>()); |
| 82 | 84 | } |
Test case
1 generated file · +35 −0test/inputs/json/priority/bug863.json
Mcplusplusdefault / quicktype.hpp+35 −0
| @@ -418,20 +418,27 @@ struct adl_serializer<std::variant<std::vector<quicktype::PurpleTopLevel>, quick | ||
| 418 | 418 | namespace quicktype { |
| 419 | 419 | inline void from_json(const json & j, PurpleTopLevel& x) { |
| 420 | 420 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 421 | + if (j.find("ALIENLEVEL") != j.end() && !j.at("ALIENLEVEL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 421 | 422 | x.set_alienlevel(j.at("ALIENLEVEL").get<int64_t>()); |
| 422 | 423 | x.set_breed(j.at("BREED").get<Breed>()); |
| 424 | + if (j.find("CHAR_DIMENSION") != j.end() && !j.at("CHAR_DIMENSION").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 423 | 425 | x.set_char_dimension(j.at("CHAR_DIMENSION").get<int64_t>()); |
| 426 | + if (j.find("CHAR_INSTANCE") != j.end() && !j.at("CHAR_INSTANCE").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 424 | 427 | x.set_char_instance(j.at("CHAR_INSTANCE").get<int64_t>()); |
| 425 | 428 | x.set_defender_rank_title(j.at("DEFENDER_RANK_TITLE").get<std::string>()); |
| 426 | 429 | x.set_firstname(j.at("FIRSTNAME").get<Firstname>()); |
| 430 | + if (j.find("HEADID") != j.end() && !j.at("HEADID").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 427 | 431 | x.set_headid(j.at("HEADID").get<int64_t>()); |
| 428 | 432 | x.set_lastname(j.at("LASTNAME").get<Lastname>()); |
| 433 | + if (j.find("LEVELX") != j.end() && !j.at("LEVELX").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 429 | 434 | x.set_levelx(j.at("LEVELX").get<int64_t>()); |
| 430 | 435 | x.set_name(j.at("NAME").get<std::string>()); |
| 431 | 436 | x.set_prof(j.at("PROF").get<std::string>()); |
| 432 | 437 | x.set_prof_title(j.at("PROF_TITLE").get<std::string>()); |
| 438 | + if (j.find("PVPRATING") != j.end() && !j.at("PVPRATING").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 433 | 439 | x.set_pvprating(j.at("PVPRATING").get<int64_t>()); |
| 434 | 440 | x.set_pvptitle(j.at("PVPTITLE").get<Pvptitle>()); |
| 441 | + if (j.find("RANK") != j.end() && !j.at("RANK").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 435 | 442 | x.set_rank(j.at("RANK").get<int64_t>()); |
| 436 | 443 | x.set_rank_title(j.at("RANK_TITLE").get<RankTitle>()); |
| 437 | 444 | x.set_sex(j.at("SEX").get<Sex>()); |
| @@ -460,40 +467,68 @@ namespace quicktype { | ||
| 460 | 467 | |
| 461 | 468 | inline void from_json(const json & j, FluffyTopLevel& x) { |
| 462 | 469 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 470 | + if (j.find("ADVENTURERCOUNT") != j.end() && !j.at("ADVENTURERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 463 | 471 | x.set_adventurercount(j.at("ADVENTURERCOUNT").get<int64_t>()); |
| 472 | + if (j.find("AGENTCOUNT") != j.end() && !j.at("AGENTCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 464 | 473 | x.set_agentcount(j.at("AGENTCOUNT").get<int64_t>()); |
| 474 | + if (j.find("ATROXCOUNT") != j.end() && !j.at("ATROXCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 465 | 475 | x.set_atroxcount(j.at("ATROXCOUNT").get<int64_t>()); |
| 466 | 476 | x.set_avglvl(j.at("AVGLVL").get<double>()); |
| 477 | + if (j.find("BTCOUNT") != j.end() && !j.at("BTCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 467 | 478 | x.set_btcount(j.at("BTCOUNT").get<int64_t>()); |
| 468 | 479 | x.set_description(j.at("DESCRIPTION").get<std::string>()); |
| 480 | + if (j.find("DOCTORCOUNT") != j.end() && !j.at("DOCTORCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 469 | 481 | x.set_doctorcount(j.at("DOCTORCOUNT").get<int64_t>()); |
| 482 | + if (j.find("ENFCOUNT") != j.end() && !j.at("ENFCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 470 | 483 | x.set_enfcount(j.at("ENFCOUNT").get<int64_t>()); |
| 484 | + if (j.find("ENGINEEERCOUNT") != j.end() && !j.at("ENGINEEERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 471 | 485 | x.set_engineeercount(j.at("ENGINEEERCOUNT").get<int64_t>()); |
| 486 | + if (j.find("FEMALECOUNT") != j.end() && !j.at("FEMALECOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 472 | 487 | x.set_femalecount(j.at("FEMALECOUNT").get<int64_t>()); |
| 488 | + if (j.find("FIXERCOUNT") != j.end() && !j.at("FIXERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 473 | 489 | x.set_fixercount(j.at("FIXERCOUNT").get<int64_t>()); |
| 474 | 490 | x.set_governingname(j.at("GOVERNINGNAME").get<std::string>()); |
| 475 | 491 | x.set_history(j.at("HISTORY").get<std::string>()); |
| 492 | + if (j.find("KEEPERCOUNT") != j.end() && !j.at("KEEPERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 476 | 493 | x.set_keepercount(j.at("KEEPERCOUNT").get<int64_t>()); |
| 494 | + if (j.find("MACOUNT") != j.end() && !j.at("MACOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 477 | 495 | x.set_macount(j.at("MACOUNT").get<int64_t>()); |
| 496 | + if (j.find("MALECOUNT") != j.end() && !j.at("MALECOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 478 | 497 | x.set_malecount(j.at("MALECOUNT").get<int64_t>()); |
| 498 | + if (j.find("MAXLVL") != j.end() && !j.at("MAXLVL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 479 | 499 | x.set_maxlvl(j.at("MAXLVL").get<int64_t>()); |
| 500 | + if (j.find("METACOUNT") != j.end() && !j.at("METACOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 480 | 501 | x.set_metacount(j.at("METACOUNT").get<int64_t>()); |
| 502 | + if (j.find("MINLVL") != j.end() && !j.at("MINLVL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 481 | 503 | x.set_minlvl(j.at("MINLVL").get<int64_t>()); |
| 504 | + if (j.find("MONSTERCOUNT") != j.end() && !j.at("MONSTERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 482 | 505 | x.set_monstercount(j.at("MONSTERCOUNT").get<int64_t>()); |
| 483 | 506 | x.set_name(j.at("NAME").get<std::string>()); |
| 507 | + if (j.find("NANOCOUNT") != j.end() && !j.at("NANOCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 484 | 508 | x.set_nanocount(j.at("NANOCOUNT").get<int64_t>()); |
| 509 | + if (j.find("NANORACECOUNT") != j.end() && !j.at("NANORACECOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 485 | 510 | x.set_nanoracecount(j.at("NANORACECOUNT").get<int64_t>()); |
| 511 | + if (j.find("NEUTERCOUNT") != j.end() && !j.at("NEUTERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 486 | 512 | x.set_neutercount(j.at("NEUTERCOUNT").get<int64_t>()); |
| 513 | + if (j.find("NUMMEMBERS") != j.end() && !j.at("NUMMEMBERS").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 487 | 514 | x.set_nummembers(j.at("NUMMEMBERS").get<int64_t>()); |
| 488 | 515 | x.set_objective(j.at("OBJECTIVE").get<std::string>()); |
| 516 | + if (j.find("OPIFEXCOUNT") != j.end() && !j.at("OPIFEXCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 489 | 517 | x.set_opifexcount(j.at("OPIFEXCOUNT").get<int64_t>()); |
| 518 | + if (j.find("ORG_DIMENSION") != j.end() && !j.at("ORG_DIMENSION").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 490 | 519 | x.set_org_dimension(j.at("ORG_DIMENSION").get<int64_t>()); |
| 520 | + if (j.find("ORG_INSTANCE") != j.end() && !j.at("ORG_INSTANCE").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 491 | 521 | x.set_org_instance(j.at("ORG_INSTANCE").get<int64_t>()); |
| 522 | + if (j.find("SHADECOUNT") != j.end() && !j.at("SHADECOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 492 | 523 | x.set_shadecount(j.at("SHADECOUNT").get<int64_t>()); |
| 524 | + if (j.find("SIDE") != j.end() && !j.at("SIDE").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 493 | 525 | x.set_side(j.at("SIDE").get<int64_t>()); |
| 494 | 526 | x.set_side_name(j.at("SIDE_NAME").get<std::string>()); |
| 527 | + if (j.find("SOLIDERCOUNT") != j.end() && !j.at("SOLIDERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 495 | 528 | x.set_solidercount(j.at("SOLIDERCOUNT").get<int64_t>()); |
| 529 | + if (j.find("SOLITUSCOUNT") != j.end() && !j.at("SOLITUSCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 496 | 530 | x.set_solituscount(j.at("SOLITUSCOUNT").get<int64_t>()); |
| 531 | + if (j.find("TRADERCOUNT") != j.end() && !j.at("TRADERCOUNT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 497 | 532 | x.set_tradercount(j.at("TRADERCOUNT").get<int64_t>()); |
| 498 | 533 | } |
Test case
1 generated file · +5 −0test/inputs/json/priority/coin-pairs.json
Mcplusplusdefault / quicktype.hpp+5 −0
| @@ -109,10 +109,14 @@ namespace quicktype { | ||
| 109 | 109 | |
| 110 | 110 | inline void from_json(const json & j, Pair& x) { |
| 111 | 111 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 112 | + if (j.find("decimal_places") != j.end() && !j.at("decimal_places").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 112 | 113 | x.set_decimal_places(j.at("decimal_places").get<int64_t>()); |
| 113 | 114 | x.set_fee(j.at("fee").get<double>()); |
| 115 | + if (j.find("hidden") != j.end() && !j.at("hidden").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 114 | 116 | x.set_hidden(j.at("hidden").get<int64_t>()); |
| 117 | + if (j.find("max_amount") != j.end() && !j.at("max_amount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 115 | 118 | x.set_max_amount(j.at("max_amount").get<int64_t>()); |
| 119 | + if (j.find("max_price") != j.end() && !j.at("max_price").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 116 | 120 | x.set_max_price(j.at("max_price").get<int64_t>()); |
| 117 | 121 | x.set_min_amount(j.at("min_amount").get<double>()); |
| 118 | 122 | x.set_min_price(j.at("min_price").get<double>()); |
| @@ -134,6 +138,7 @@ namespace quicktype { | ||
| 134 | 138 | inline void from_json(const json & j, TopLevel& x) { |
| 135 | 139 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 136 | 140 | x.set_pairs(j.at("pairs").get<std::map<std::string, Pair>>()); |
| 141 | + if (j.find("server_time") != j.end() && !j.at("server_time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 137 | 142 | x.set_server_time(j.at("server_time").get<int64_t>()); |
| 138 | 143 | } |
Test case
3 generated files · +18 −0test/inputs/json/priority/combinations1.json
Mcpluspluscode-format-with-struct--67c848c66185 / quicktype.hpp+6 −0
| @@ -775,6 +775,7 @@ namespace quicktype { | ||
| 775 | 775 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 776 | 776 | x.caulis = get_untyped(j, "caulis"); |
| 777 | 777 | x.chalcus = get_untyped(j, "chalcus"); |
| 778 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 778 | 779 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 779 | 780 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 780 | 781 | x.enteradenological = get_untyped(j, "enteradenological"); |
| @@ -828,6 +829,7 @@ namespace quicktype { | ||
| 828 | 829 | inline void from_json(const json & j, CimeliaClass& x) { |
| 829 | 830 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 830 | 831 | x.catharticalness = j.at("catharticalness").get<double>(); |
| 832 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 831 | 833 | x.chirotherium = j.at("Chirotherium").get<int64_t>(); |
| 832 | 834 | x.disdiapason = j.at("disdiapason").get<std::string>(); |
| 833 | 835 | x.homocerc = j.at("homocerc").get<bool>(); |
| @@ -848,6 +850,7 @@ namespace quicktype { | ||
| 848 | 850 | x.amidosulphonal = get_untyped(j, "amidosulphonal"); |
| 849 | 851 | x.benny = get_untyped(j, "Benny"); |
| 850 | 852 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 853 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 851 | 854 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 852 | 855 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 853 | 856 | x.ensnare = get_untyped(j, "ensnare"); |
| @@ -1244,6 +1247,7 @@ namespace quicktype { | ||
| 1244 | 1247 | x.autobiographic = get_untyped(j, "autobiographic"); |
| 1245 | 1248 | x.berat = get_untyped(j, "berat"); |
| 1246 | 1249 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1250 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1247 | 1251 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1248 | 1252 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1249 | 1253 | x.disproportionably = get_untyped(j, "disproportionably"); |
| @@ -1300,6 +1304,7 @@ namespace quicktype { | ||
| 1300 | 1304 | x.assapan = j.at("assapan").get<double>(); |
| 1301 | 1305 | x.benefactorship = j.at("benefactorship").get<bool>(); |
| 1302 | 1306 | x.triseriatim = j.at("triseriatim").get<std::string>(); |
| 1307 | + if (j.find("tubbing") != j.end() && !j.at("tubbing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1303 | 1308 | x.tubbing = j.at("tubbing").get<int64_t>(); |
| 1304 | 1309 | x.untrimmed = get_untyped(j, "untrimmed"); |
| 1305 | 1310 | } |
| @@ -1319,6 +1324,7 @@ namespace quicktype { | ||
| 1319 | 1324 | x.cerograph = j.at("cerograph").get<std::vector<CerographElement>>(); |
| 1320 | 1325 | x.chemotherapeutics = j.at("chemotherapeutics").get<std::vector<ChemotherapeuticElement>>(); |
| 1321 | 1326 | x.cimelia = j.at("cimelia").get<std::vector<CimeliaElement>>(); |
| 1327 | + if (j.find("citrated") != j.end() && !j.at("citrated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1322 | 1328 | x.citrated = j.at("citrated").get<int64_t>(); |
| 1323 | 1329 | x.clinodome = j.at("clinodome").get<std::vector<Clinodome>>(); |
| 1324 | 1330 | x.coadjust = j.at("coadjust").get<std::vector<CoadjustElement>>(); |
Mcplusplusconst-style-east-const--0048a2a7a881 / quicktype.hpp+6 −0
| @@ -2015,6 +2015,7 @@ namespace quicktype { | ||
| 2015 | 2015 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2016 | 2016 | x.set_caulis(get_untyped(j, "caulis")); |
| 2017 | 2017 | x.set_chalcus(get_untyped(j, "chalcus")); |
| 2018 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2018 | 2019 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2019 | 2020 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2020 | 2021 | x.set_enteradenological(get_untyped(j, "enteradenological")); |
| @@ -2068,6 +2069,7 @@ namespace quicktype { | ||
| 2068 | 2069 | inline void from_json(json const & j, CimeliaClass& x) { |
| 2069 | 2070 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2070 | 2071 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2072 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2071 | 2073 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2072 | 2074 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2073 | 2075 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2088,6 +2090,7 @@ namespace quicktype { | ||
| 2088 | 2090 | x.set_amidosulphonal(get_untyped(j, "amidosulphonal")); |
| 2089 | 2091 | x.set_benny(get_untyped(j, "Benny")); |
| 2090 | 2092 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2093 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2091 | 2094 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2092 | 2095 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2093 | 2096 | x.set_ensnare(get_untyped(j, "ensnare")); |
| @@ -2484,6 +2487,7 @@ namespace quicktype { | ||
| 2484 | 2487 | x.set_autobiographic(get_untyped(j, "autobiographic")); |
| 2485 | 2488 | x.set_berat(get_untyped(j, "berat")); |
| 2486 | 2489 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2490 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2487 | 2491 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2488 | 2492 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2489 | 2493 | x.set_disproportionably(get_untyped(j, "disproportionably")); |
| @@ -2540,6 +2544,7 @@ namespace quicktype { | ||
| 2540 | 2544 | x.set_assapan(j.at("assapan").get<double>()); |
| 2541 | 2545 | x.set_benefactorship(j.at("benefactorship").get<bool>()); |
| 2542 | 2546 | x.set_triseriatim(j.at("triseriatim").get<std::string>()); |
| 2547 | + if (j.find("tubbing") != j.end() && !j.at("tubbing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2543 | 2548 | x.set_tubbing(j.at("tubbing").get<int64_t>()); |
| 2544 | 2549 | x.set_untrimmed(get_untyped(j, "untrimmed")); |
| 2545 | 2550 | } |
| @@ -2559,6 +2564,7 @@ namespace quicktype { | ||
| 2559 | 2564 | x.set_cerograph(j.at("cerograph").get<std::vector<CerographElement>>()); |
| 2560 | 2565 | x.set_chemotherapeutics(j.at("chemotherapeutics").get<std::vector<ChemotherapeuticElement>>()); |
| 2561 | 2566 | x.set_cimelia(j.at("cimelia").get<std::vector<CimeliaElement>>()); |
| 2567 | + if (j.find("citrated") != j.end() && !j.at("citrated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2562 | 2568 | x.set_citrated(j.at("citrated").get<int64_t>()); |
| 2563 | 2569 | x.set_clinodome(j.at("clinodome").get<std::vector<Clinodome>>()); |
| 2564 | 2570 | x.set_coadjust(j.at("coadjust").get<std::vector<CoadjustElement>>()); |
Mcplusplusdefault / quicktype.hpp+6 −0
| @@ -2015,6 +2015,7 @@ namespace quicktype { | ||
| 2015 | 2015 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2016 | 2016 | x.set_caulis(get_untyped(j, "caulis")); |
| 2017 | 2017 | x.set_chalcus(get_untyped(j, "chalcus")); |
| 2018 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2018 | 2019 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2019 | 2020 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2020 | 2021 | x.set_enteradenological(get_untyped(j, "enteradenological")); |
| @@ -2068,6 +2069,7 @@ namespace quicktype { | ||
| 2068 | 2069 | inline void from_json(const json & j, CimeliaClass& x) { |
| 2069 | 2070 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2070 | 2071 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2072 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2071 | 2073 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2072 | 2074 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2073 | 2075 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2088,6 +2090,7 @@ namespace quicktype { | ||
| 2088 | 2090 | x.set_amidosulphonal(get_untyped(j, "amidosulphonal")); |
| 2089 | 2091 | x.set_benny(get_untyped(j, "Benny")); |
| 2090 | 2092 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2093 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2091 | 2094 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2092 | 2095 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2093 | 2096 | x.set_ensnare(get_untyped(j, "ensnare")); |
| @@ -2484,6 +2487,7 @@ namespace quicktype { | ||
| 2484 | 2487 | x.set_autobiographic(get_untyped(j, "autobiographic")); |
| 2485 | 2488 | x.set_berat(get_untyped(j, "berat")); |
| 2486 | 2489 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2490 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2487 | 2491 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2488 | 2492 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2489 | 2493 | x.set_disproportionably(get_untyped(j, "disproportionably")); |
| @@ -2540,6 +2544,7 @@ namespace quicktype { | ||
| 2540 | 2544 | x.set_assapan(j.at("assapan").get<double>()); |
| 2541 | 2545 | x.set_benefactorship(j.at("benefactorship").get<bool>()); |
| 2542 | 2546 | x.set_triseriatim(j.at("triseriatim").get<std::string>()); |
| 2547 | + if (j.find("tubbing") != j.end() && !j.at("tubbing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2543 | 2548 | x.set_tubbing(j.at("tubbing").get<int64_t>()); |
| 2544 | 2549 | x.set_untrimmed(get_untyped(j, "untrimmed")); |
| 2545 | 2550 | } |
| @@ -2559,6 +2564,7 @@ namespace quicktype { | ||
| 2559 | 2564 | x.set_cerograph(j.at("cerograph").get<std::vector<CerographElement>>()); |
| 2560 | 2565 | x.set_chemotherapeutics(j.at("chemotherapeutics").get<std::vector<ChemotherapeuticElement>>()); |
| 2561 | 2566 | x.set_cimelia(j.at("cimelia").get<std::vector<CimeliaElement>>()); |
| 2567 | + if (j.find("citrated") != j.end() && !j.at("citrated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2562 | 2568 | x.set_citrated(j.at("citrated").get<int64_t>()); |
| 2563 | 2569 | x.set_clinodome(j.at("clinodome").get<std::vector<Clinodome>>()); |
| 2564 | 2570 | x.set_coadjust(j.at("coadjust").get<std::vector<CoadjustElement>>()); |
Test case
3 generated files · +192 −0test/inputs/json/priority/combinations2.json
Mcpluspluscode-format-with-struct--67c848c66185 / quicktype.hpp+64 −0
| @@ -719,6 +719,7 @@ namespace quicktype { | ||
| 719 | 719 | inline void from_json(const json & j, Rebecca& x) { |
| 720 | 720 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 721 | 721 | x.catharticalness = j.at("catharticalness").get<double>(); |
| 722 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 722 | 723 | x.chirotherium = j.at("Chirotherium").get<int64_t>(); |
| 723 | 724 | x.disdiapason = j.at("disdiapason").get<std::string>(); |
| 724 | 725 | x.homocerc = j.at("homocerc").get<bool>(); |
| @@ -736,30 +737,51 @@ namespace quicktype { | ||
| 736 | 737 | |
| 737 | 738 | inline void from_json(const json & j, Amphithyron& x) { |
| 738 | 739 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 740 | + if (j.find("akroasis") != j.end() && !j.at("akroasis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 739 | 741 | x.akroasis = get_stack_optional<int64_t>(j, "akroasis"); |
| 742 | + if (j.find("antiphonical") != j.end() && !j.at("antiphonical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 740 | 743 | x.antiphonical = get_stack_optional<int64_t>(j, "antiphonical"); |
| 744 | + if (j.find("basebred") != j.end() && !j.at("basebred").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 741 | 745 | x.basebred = get_stack_optional<int64_t>(j, "basebred"); |
| 742 | 746 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 747 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 743 | 748 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 749 | + if (j.find("conductometric") != j.end() && !j.at("conductometric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 744 | 750 | x.conductometric = get_stack_optional<int64_t>(j, "conductometric"); |
| 745 | 751 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 752 | + if (j.find("ensilation") != j.end() && !j.at("ensilation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 746 | 753 | x.ensilation = get_stack_optional<int64_t>(j, "ensilation"); |
| 754 | + if (j.find("eyebolt") != j.end() && !j.at("eyebolt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 747 | 755 | x.eyebolt = get_stack_optional<int64_t>(j, "eyebolt"); |
| 756 | + if (j.find("fistulated") != j.end() && !j.at("fistulated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 748 | 757 | x.fistulated = get_stack_optional<int64_t>(j, "fistulated"); |
| 758 | + if (j.find("heteropod") != j.end() && !j.at("heteropod").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 749 | 759 | x.heteropod = get_stack_optional<int64_t>(j, "heteropod"); |
| 750 | 760 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 761 | + if (j.find("Juniperus") != j.end() && !j.at("Juniperus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 751 | 762 | x.juniperus = get_stack_optional<int64_t>(j, "Juniperus"); |
| 763 | + if (j.find("labyrinthically") != j.end() && !j.at("labyrinthically").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 752 | 764 | x.labyrinthically = get_stack_optional<int64_t>(j, "labyrinthically"); |
| 765 | + if (j.find("martyrization") != j.end() && !j.at("martyrization").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 753 | 766 | x.martyrization = get_stack_optional<int64_t>(j, "martyrization"); |
| 767 | + if (j.find("mispolicy") != j.end() && !j.at("mispolicy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 754 | 768 | x.mispolicy = get_stack_optional<int64_t>(j, "mispolicy"); |
| 769 | + if (j.find("multipara") != j.end() && !j.at("multipara").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 755 | 770 | x.multipara = get_stack_optional<int64_t>(j, "multipara"); |
| 771 | + if (j.find("Nazirite") != j.end() && !j.at("Nazirite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 756 | 772 | x.nazirite = get_stack_optional<int64_t>(j, "Nazirite"); |
| 757 | 773 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 774 | + if (j.find("possessorial") != j.end() && !j.at("possessorial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 758 | 775 | x.possessorial = get_stack_optional<int64_t>(j, "possessorial"); |
| 776 | + if (j.find("shamed") != j.end() && !j.at("shamed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 759 | 777 | x.shamed = get_stack_optional<int64_t>(j, "shamed"); |
| 778 | + if (j.find("shelfworn") != j.end() && !j.at("shelfworn").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 760 | 779 | x.shelfworn = get_stack_optional<int64_t>(j, "shelfworn"); |
| 780 | + if (j.find("stagnum") != j.end() && !j.at("stagnum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 761 | 781 | x.stagnum = get_stack_optional<int64_t>(j, "stagnum"); |
| 782 | + if (j.find("Those") != j.end() && !j.at("Those").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 762 | 783 | x.those = get_stack_optional<int64_t>(j, "Those"); |
| 784 | + if (j.find("undecimal") != j.end() && !j.at("undecimal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 763 | 785 | x.undecimal = get_stack_optional<int64_t>(j, "undecimal"); |
| 764 | 786 | } |
| 765 | 787 | |
| @@ -938,30 +960,51 @@ namespace quicktype { | ||
| 938 | 960 | |
| 939 | 961 | inline void from_json(const json & j, DiscordiaClass& x) { |
| 940 | 962 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 963 | + if (j.find("Altaic") != j.end() && !j.at("Altaic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 941 | 964 | x.altaic = get_stack_optional<int64_t>(j, "Altaic"); |
| 965 | + if (j.find("amoristic") != j.end() && !j.at("amoristic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 942 | 966 | x.amoristic = get_stack_optional<int64_t>(j, "amoristic"); |
| 967 | + if (j.find("blennophthalmia") != j.end() && !j.at("blennophthalmia").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 943 | 968 | x.blennophthalmia = get_stack_optional<int64_t>(j, "blennophthalmia"); |
| 944 | 969 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 970 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 945 | 971 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 972 | + if (j.find("disciplinability") != j.end() && !j.at("disciplinability").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 946 | 973 | x.disciplinability = get_stack_optional<int64_t>(j, "disciplinability"); |
| 947 | 974 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 975 | + if (j.find("goofer") != j.end() && !j.at("goofer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 948 | 976 | x.goofer = get_stack_optional<int64_t>(j, "goofer"); |
| 949 | 977 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 978 | + if (j.find("laryngograph") != j.end() && !j.at("laryngograph").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 950 | 979 | x.laryngograph = get_stack_optional<int64_t>(j, "laryngograph"); |
| 980 | + if (j.find("leucitis") != j.end() && !j.at("leucitis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 951 | 981 | x.leucitis = get_stack_optional<int64_t>(j, "leucitis"); |
| 982 | + if (j.find("lymphocyst") != j.end() && !j.at("lymphocyst").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 952 | 983 | x.lymphocyst = get_stack_optional<int64_t>(j, "lymphocyst"); |
| 984 | + if (j.find("microcosmology") != j.end() && !j.at("microcosmology").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 953 | 985 | x.microcosmology = get_stack_optional<int64_t>(j, "microcosmology"); |
| 986 | + if (j.find("nauseation") != j.end() && !j.at("nauseation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 954 | 987 | x.nauseation = get_stack_optional<int64_t>(j, "nauseation"); |
| 955 | 988 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 989 | + if (j.find("Patarin") != j.end() && !j.at("Patarin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 956 | 990 | x.patarin = get_stack_optional<int64_t>(j, "Patarin"); |
| 991 | + if (j.find("preliberal") != j.end() && !j.at("preliberal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 957 | 992 | x.preliberal = get_stack_optional<int64_t>(j, "preliberal"); |
| 993 | + if (j.find("prettifier") != j.end() && !j.at("prettifier").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 958 | 994 | x.prettifier = get_stack_optional<int64_t>(j, "prettifier"); |
| 995 | + if (j.find("rangework") != j.end() && !j.at("rangework").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 959 | 996 | x.rangework = get_stack_optional<int64_t>(j, "rangework"); |
| 997 | + if (j.find("redient") != j.end() && !j.at("redient").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 960 | 998 | x.redient = get_stack_optional<int64_t>(j, "redient"); |
| 999 | + if (j.find("subfusiform") != j.end() && !j.at("subfusiform").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 961 | 1000 | x.subfusiform = get_stack_optional<int64_t>(j, "subfusiform"); |
| 1001 | + if (j.find("suicidical") != j.end() && !j.at("suicidical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 962 | 1002 | x.suicidical = get_stack_optional<int64_t>(j, "suicidical"); |
| 1003 | + if (j.find("swow") != j.end() && !j.at("swow").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 963 | 1004 | x.swow = get_stack_optional<int64_t>(j, "swow"); |
| 1005 | + if (j.find("wastrel") != j.end() && !j.at("wastrel").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 964 | 1006 | x.wastrel = get_stack_optional<int64_t>(j, "wastrel"); |
| 1007 | + if (j.find("wingle") != j.end() && !j.at("wingle").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 965 | 1008 | x.wingle = get_stack_optional<int64_t>(j, "wingle"); |
| 966 | 1009 | } |
| 967 | 1010 | |
| @@ -1044,30 +1087,51 @@ namespace quicktype { | ||
| 1044 | 1087 | |
| 1045 | 1088 | inline void from_json(const json & j, LaviniaClass& x) { |
| 1046 | 1089 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1090 | + if (j.find("agitable") != j.end() && !j.at("agitable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1047 | 1091 | x.agitable = get_stack_optional<int64_t>(j, "agitable"); |
| 1092 | + if (j.find("asininity") != j.end() && !j.at("asininity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1048 | 1093 | x.asininity = get_stack_optional<int64_t>(j, "asininity"); |
| 1094 | + if (j.find("benefiter") != j.end() && !j.at("benefiter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1049 | 1095 | x.benefiter = get_stack_optional<int64_t>(j, "benefiter"); |
| 1096 | + if (j.find("bronzelike") != j.end() && !j.at("bronzelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1050 | 1097 | x.bronzelike = get_stack_optional<int64_t>(j, "bronzelike"); |
| 1051 | 1098 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1099 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1052 | 1100 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1101 | + if (j.find("cholesteatomatous") != j.end() && !j.at("cholesteatomatous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1053 | 1102 | x.cholesteatomatous = get_stack_optional<int64_t>(j, "cholesteatomatous"); |
| 1103 | + if (j.find("deprivement") != j.end() && !j.at("deprivement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1054 | 1104 | x.deprivement = get_stack_optional<int64_t>(j, "deprivement"); |
| 1055 | 1105 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1106 | + if (j.find("flippantness") != j.end() && !j.at("flippantness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1056 | 1107 | x.flippantness = get_stack_optional<int64_t>(j, "flippantness"); |
| 1108 | + if (j.find("fogproof") != j.end() && !j.at("fogproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1057 | 1109 | x.fogproof = get_stack_optional<int64_t>(j, "fogproof"); |
| 1058 | 1110 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1111 | + if (j.find("merrymeeting") != j.end() && !j.at("merrymeeting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1059 | 1112 | x.merrymeeting = get_stack_optional<int64_t>(j, "merrymeeting"); |
| 1060 | 1113 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1114 | + if (j.find("overcareful") != j.end() && !j.at("overcareful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1061 | 1115 | x.overcareful = get_stack_optional<int64_t>(j, "overcareful"); |
| 1116 | + if (j.find("panaris") != j.end() && !j.at("panaris").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1062 | 1117 | x.panaris = get_stack_optional<int64_t>(j, "panaris"); |
| 1118 | + if (j.find("preacceptance") != j.end() && !j.at("preacceptance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1063 | 1119 | x.preacceptance = get_stack_optional<int64_t>(j, "preacceptance"); |
| 1120 | + if (j.find("quinoxaline") != j.end() && !j.at("quinoxaline").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1064 | 1121 | x.quinoxaline = get_stack_optional<int64_t>(j, "quinoxaline"); |
| 1122 | + if (j.find("sig") != j.end() && !j.at("sig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1065 | 1123 | x.sig = get_stack_optional<int64_t>(j, "sig"); |
| 1124 | + if (j.find("superconfusion") != j.end() && !j.at("superconfusion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1066 | 1125 | x.superconfusion = get_stack_optional<int64_t>(j, "superconfusion"); |
| 1126 | + if (j.find("Tacana") != j.end() && !j.at("Tacana").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1067 | 1127 | x.tacana = get_stack_optional<int64_t>(j, "Tacana"); |
| 1128 | + if (j.find("tillotter") != j.end() && !j.at("tillotter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1068 | 1129 | x.tillotter = get_stack_optional<int64_t>(j, "tillotter"); |
| 1130 | + if (j.find("tranquillize") != j.end() && !j.at("tranquillize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1069 | 1131 | x.tranquillize = get_stack_optional<int64_t>(j, "tranquillize"); |
| 1132 | + if (j.find("unquestionable") != j.end() && !j.at("unquestionable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1070 | 1133 | x.unquestionable = get_stack_optional<int64_t>(j, "unquestionable"); |
| 1134 | + if (j.find("uproute") != j.end() && !j.at("uproute").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1071 | 1135 | x.uproute = get_stack_optional<int64_t>(j, "uproute"); |
| 1072 | 1136 | } |
Mcplusplusconst-style-east-const--0048a2a7a881 / quicktype.hpp+64 −0
| @@ -1769,6 +1769,7 @@ namespace quicktype { | ||
| 1769 | 1769 | inline void from_json(json const & j, Rebecca& x) { |
| 1770 | 1770 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1771 | 1771 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 1772 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1772 | 1773 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 1773 | 1774 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 1774 | 1775 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -1786,30 +1787,51 @@ namespace quicktype { | ||
| 1786 | 1787 | |
| 1787 | 1788 | inline void from_json(json const & j, Amphithyron& x) { |
| 1788 | 1789 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1790 | + if (j.find("akroasis") != j.end() && !j.at("akroasis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1789 | 1791 | x.set_akroasis(get_stack_optional<int64_t>(j, "akroasis")); |
| 1792 | + if (j.find("antiphonical") != j.end() && !j.at("antiphonical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1790 | 1793 | x.set_antiphonical(get_stack_optional<int64_t>(j, "antiphonical")); |
| 1794 | + if (j.find("basebred") != j.end() && !j.at("basebred").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1791 | 1795 | x.set_basebred(get_stack_optional<int64_t>(j, "basebred")); |
| 1792 | 1796 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 1797 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1793 | 1798 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 1799 | + if (j.find("conductometric") != j.end() && !j.at("conductometric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1794 | 1800 | x.set_conductometric(get_stack_optional<int64_t>(j, "conductometric")); |
| 1795 | 1801 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 1802 | + if (j.find("ensilation") != j.end() && !j.at("ensilation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1796 | 1803 | x.set_ensilation(get_stack_optional<int64_t>(j, "ensilation")); |
| 1804 | + if (j.find("eyebolt") != j.end() && !j.at("eyebolt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1797 | 1805 | x.set_eyebolt(get_stack_optional<int64_t>(j, "eyebolt")); |
| 1806 | + if (j.find("fistulated") != j.end() && !j.at("fistulated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1798 | 1807 | x.set_fistulated(get_stack_optional<int64_t>(j, "fistulated")); |
| 1808 | + if (j.find("heteropod") != j.end() && !j.at("heteropod").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1799 | 1809 | x.set_heteropod(get_stack_optional<int64_t>(j, "heteropod")); |
| 1800 | 1810 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 1811 | + if (j.find("Juniperus") != j.end() && !j.at("Juniperus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1801 | 1812 | x.set_juniperus(get_stack_optional<int64_t>(j, "Juniperus")); |
| 1813 | + if (j.find("labyrinthically") != j.end() && !j.at("labyrinthically").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1802 | 1814 | x.set_labyrinthically(get_stack_optional<int64_t>(j, "labyrinthically")); |
| 1815 | + if (j.find("martyrization") != j.end() && !j.at("martyrization").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1803 | 1816 | x.set_martyrization(get_stack_optional<int64_t>(j, "martyrization")); |
| 1817 | + if (j.find("mispolicy") != j.end() && !j.at("mispolicy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1804 | 1818 | x.set_mispolicy(get_stack_optional<int64_t>(j, "mispolicy")); |
| 1819 | + if (j.find("multipara") != j.end() && !j.at("multipara").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1805 | 1820 | x.set_multipara(get_stack_optional<int64_t>(j, "multipara")); |
| 1821 | + if (j.find("Nazirite") != j.end() && !j.at("Nazirite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1806 | 1822 | x.set_nazirite(get_stack_optional<int64_t>(j, "Nazirite")); |
| 1807 | 1823 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 1824 | + if (j.find("possessorial") != j.end() && !j.at("possessorial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1808 | 1825 | x.set_possessorial(get_stack_optional<int64_t>(j, "possessorial")); |
| 1826 | + if (j.find("shamed") != j.end() && !j.at("shamed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1809 | 1827 | x.set_shamed(get_stack_optional<int64_t>(j, "shamed")); |
| 1828 | + if (j.find("shelfworn") != j.end() && !j.at("shelfworn").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1810 | 1829 | x.set_shelfworn(get_stack_optional<int64_t>(j, "shelfworn")); |
| 1830 | + if (j.find("stagnum") != j.end() && !j.at("stagnum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1811 | 1831 | x.set_stagnum(get_stack_optional<int64_t>(j, "stagnum")); |
| 1832 | + if (j.find("Those") != j.end() && !j.at("Those").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1812 | 1833 | x.set_those(get_stack_optional<int64_t>(j, "Those")); |
| 1834 | + if (j.find("undecimal") != j.end() && !j.at("undecimal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1813 | 1835 | x.set_undecimal(get_stack_optional<int64_t>(j, "undecimal")); |
| 1814 | 1836 | } |
| 1815 | 1837 | |
| @@ -1988,30 +2010,51 @@ namespace quicktype { | ||
| 1988 | 2010 | |
| 1989 | 2011 | inline void from_json(json const & j, DiscordiaClass& x) { |
| 1990 | 2012 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2013 | + if (j.find("Altaic") != j.end() && !j.at("Altaic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1991 | 2014 | x.set_altaic(get_stack_optional<int64_t>(j, "Altaic")); |
| 2015 | + if (j.find("amoristic") != j.end() && !j.at("amoristic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1992 | 2016 | x.set_amoristic(get_stack_optional<int64_t>(j, "amoristic")); |
| 2017 | + if (j.find("blennophthalmia") != j.end() && !j.at("blennophthalmia").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1993 | 2018 | x.set_blennophthalmia(get_stack_optional<int64_t>(j, "blennophthalmia")); |
| 1994 | 2019 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2020 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1995 | 2021 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2022 | + if (j.find("disciplinability") != j.end() && !j.at("disciplinability").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1996 | 2023 | x.set_disciplinability(get_stack_optional<int64_t>(j, "disciplinability")); |
| 1997 | 2024 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2025 | + if (j.find("goofer") != j.end() && !j.at("goofer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1998 | 2026 | x.set_goofer(get_stack_optional<int64_t>(j, "goofer")); |
| 1999 | 2027 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2028 | + if (j.find("laryngograph") != j.end() && !j.at("laryngograph").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2000 | 2029 | x.set_laryngograph(get_stack_optional<int64_t>(j, "laryngograph")); |
| 2030 | + if (j.find("leucitis") != j.end() && !j.at("leucitis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2001 | 2031 | x.set_leucitis(get_stack_optional<int64_t>(j, "leucitis")); |
| 2032 | + if (j.find("lymphocyst") != j.end() && !j.at("lymphocyst").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2002 | 2033 | x.set_lymphocyst(get_stack_optional<int64_t>(j, "lymphocyst")); |
| 2034 | + if (j.find("microcosmology") != j.end() && !j.at("microcosmology").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2003 | 2035 | x.set_microcosmology(get_stack_optional<int64_t>(j, "microcosmology")); |
| 2036 | + if (j.find("nauseation") != j.end() && !j.at("nauseation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2004 | 2037 | x.set_nauseation(get_stack_optional<int64_t>(j, "nauseation")); |
| 2005 | 2038 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2039 | + if (j.find("Patarin") != j.end() && !j.at("Patarin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2006 | 2040 | x.set_patarin(get_stack_optional<int64_t>(j, "Patarin")); |
| 2041 | + if (j.find("preliberal") != j.end() && !j.at("preliberal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2007 | 2042 | x.set_preliberal(get_stack_optional<int64_t>(j, "preliberal")); |
| 2043 | + if (j.find("prettifier") != j.end() && !j.at("prettifier").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2008 | 2044 | x.set_prettifier(get_stack_optional<int64_t>(j, "prettifier")); |
| 2045 | + if (j.find("rangework") != j.end() && !j.at("rangework").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2009 | 2046 | x.set_rangework(get_stack_optional<int64_t>(j, "rangework")); |
| 2047 | + if (j.find("redient") != j.end() && !j.at("redient").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2010 | 2048 | x.set_redient(get_stack_optional<int64_t>(j, "redient")); |
| 2049 | + if (j.find("subfusiform") != j.end() && !j.at("subfusiform").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2011 | 2050 | x.set_subfusiform(get_stack_optional<int64_t>(j, "subfusiform")); |
| 2051 | + if (j.find("suicidical") != j.end() && !j.at("suicidical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2012 | 2052 | x.set_suicidical(get_stack_optional<int64_t>(j, "suicidical")); |
| 2053 | + if (j.find("swow") != j.end() && !j.at("swow").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2013 | 2054 | x.set_swow(get_stack_optional<int64_t>(j, "swow")); |
| 2055 | + if (j.find("wastrel") != j.end() && !j.at("wastrel").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2014 | 2056 | x.set_wastrel(get_stack_optional<int64_t>(j, "wastrel")); |
| 2057 | + if (j.find("wingle") != j.end() && !j.at("wingle").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2015 | 2058 | x.set_wingle(get_stack_optional<int64_t>(j, "wingle")); |
| 2016 | 2059 | } |
| 2017 | 2060 | |
| @@ -2094,30 +2137,51 @@ namespace quicktype { | ||
| 2094 | 2137 | |
| 2095 | 2138 | inline void from_json(json const & j, LaviniaClass& x) { |
| 2096 | 2139 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2140 | + if (j.find("agitable") != j.end() && !j.at("agitable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2097 | 2141 | x.set_agitable(get_stack_optional<int64_t>(j, "agitable")); |
| 2142 | + if (j.find("asininity") != j.end() && !j.at("asininity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2098 | 2143 | x.set_asininity(get_stack_optional<int64_t>(j, "asininity")); |
| 2144 | + if (j.find("benefiter") != j.end() && !j.at("benefiter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2099 | 2145 | x.set_benefiter(get_stack_optional<int64_t>(j, "benefiter")); |
| 2146 | + if (j.find("bronzelike") != j.end() && !j.at("bronzelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2100 | 2147 | x.set_bronzelike(get_stack_optional<int64_t>(j, "bronzelike")); |
| 2101 | 2148 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2149 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2102 | 2150 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2151 | + if (j.find("cholesteatomatous") != j.end() && !j.at("cholesteatomatous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2103 | 2152 | x.set_cholesteatomatous(get_stack_optional<int64_t>(j, "cholesteatomatous")); |
| 2153 | + if (j.find("deprivement") != j.end() && !j.at("deprivement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2104 | 2154 | x.set_deprivement(get_stack_optional<int64_t>(j, "deprivement")); |
| 2105 | 2155 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2156 | + if (j.find("flippantness") != j.end() && !j.at("flippantness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2106 | 2157 | x.set_flippantness(get_stack_optional<int64_t>(j, "flippantness")); |
| 2158 | + if (j.find("fogproof") != j.end() && !j.at("fogproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2107 | 2159 | x.set_fogproof(get_stack_optional<int64_t>(j, "fogproof")); |
| 2108 | 2160 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2161 | + if (j.find("merrymeeting") != j.end() && !j.at("merrymeeting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2109 | 2162 | x.set_merrymeeting(get_stack_optional<int64_t>(j, "merrymeeting")); |
| 2110 | 2163 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2164 | + if (j.find("overcareful") != j.end() && !j.at("overcareful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2111 | 2165 | x.set_overcareful(get_stack_optional<int64_t>(j, "overcareful")); |
| 2166 | + if (j.find("panaris") != j.end() && !j.at("panaris").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2112 | 2167 | x.set_panaris(get_stack_optional<int64_t>(j, "panaris")); |
| 2168 | + if (j.find("preacceptance") != j.end() && !j.at("preacceptance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2113 | 2169 | x.set_preacceptance(get_stack_optional<int64_t>(j, "preacceptance")); |
| 2170 | + if (j.find("quinoxaline") != j.end() && !j.at("quinoxaline").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2114 | 2171 | x.set_quinoxaline(get_stack_optional<int64_t>(j, "quinoxaline")); |
| 2172 | + if (j.find("sig") != j.end() && !j.at("sig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2115 | 2173 | x.set_sig(get_stack_optional<int64_t>(j, "sig")); |
| 2174 | + if (j.find("superconfusion") != j.end() && !j.at("superconfusion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2116 | 2175 | x.set_superconfusion(get_stack_optional<int64_t>(j, "superconfusion")); |
| 2176 | + if (j.find("Tacana") != j.end() && !j.at("Tacana").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2117 | 2177 | x.set_tacana(get_stack_optional<int64_t>(j, "Tacana")); |
| 2178 | + if (j.find("tillotter") != j.end() && !j.at("tillotter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2118 | 2179 | x.set_tillotter(get_stack_optional<int64_t>(j, "tillotter")); |
| 2180 | + if (j.find("tranquillize") != j.end() && !j.at("tranquillize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2119 | 2181 | x.set_tranquillize(get_stack_optional<int64_t>(j, "tranquillize")); |
| 2182 | + if (j.find("unquestionable") != j.end() && !j.at("unquestionable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2120 | 2183 | x.set_unquestionable(get_stack_optional<int64_t>(j, "unquestionable")); |
| 2184 | + if (j.find("uproute") != j.end() && !j.at("uproute").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2121 | 2185 | x.set_uproute(get_stack_optional<int64_t>(j, "uproute")); |
| 2122 | 2186 | } |
Mcplusplusdefault / quicktype.hpp+64 −0
| @@ -1769,6 +1769,7 @@ namespace quicktype { | ||
| 1769 | 1769 | inline void from_json(const json & j, Rebecca& x) { |
| 1770 | 1770 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1771 | 1771 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 1772 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1772 | 1773 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 1773 | 1774 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 1774 | 1775 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -1786,30 +1787,51 @@ namespace quicktype { | ||
| 1786 | 1787 | |
| 1787 | 1788 | inline void from_json(const json & j, Amphithyron& x) { |
| 1788 | 1789 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1790 | + if (j.find("akroasis") != j.end() && !j.at("akroasis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1789 | 1791 | x.set_akroasis(get_stack_optional<int64_t>(j, "akroasis")); |
| 1792 | + if (j.find("antiphonical") != j.end() && !j.at("antiphonical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1790 | 1793 | x.set_antiphonical(get_stack_optional<int64_t>(j, "antiphonical")); |
| 1794 | + if (j.find("basebred") != j.end() && !j.at("basebred").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1791 | 1795 | x.set_basebred(get_stack_optional<int64_t>(j, "basebred")); |
| 1792 | 1796 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 1797 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1793 | 1798 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 1799 | + if (j.find("conductometric") != j.end() && !j.at("conductometric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1794 | 1800 | x.set_conductometric(get_stack_optional<int64_t>(j, "conductometric")); |
| 1795 | 1801 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 1802 | + if (j.find("ensilation") != j.end() && !j.at("ensilation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1796 | 1803 | x.set_ensilation(get_stack_optional<int64_t>(j, "ensilation")); |
| 1804 | + if (j.find("eyebolt") != j.end() && !j.at("eyebolt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1797 | 1805 | x.set_eyebolt(get_stack_optional<int64_t>(j, "eyebolt")); |
| 1806 | + if (j.find("fistulated") != j.end() && !j.at("fistulated").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1798 | 1807 | x.set_fistulated(get_stack_optional<int64_t>(j, "fistulated")); |
| 1808 | + if (j.find("heteropod") != j.end() && !j.at("heteropod").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1799 | 1809 | x.set_heteropod(get_stack_optional<int64_t>(j, "heteropod")); |
| 1800 | 1810 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 1811 | + if (j.find("Juniperus") != j.end() && !j.at("Juniperus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1801 | 1812 | x.set_juniperus(get_stack_optional<int64_t>(j, "Juniperus")); |
| 1813 | + if (j.find("labyrinthically") != j.end() && !j.at("labyrinthically").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1802 | 1814 | x.set_labyrinthically(get_stack_optional<int64_t>(j, "labyrinthically")); |
| 1815 | + if (j.find("martyrization") != j.end() && !j.at("martyrization").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1803 | 1816 | x.set_martyrization(get_stack_optional<int64_t>(j, "martyrization")); |
| 1817 | + if (j.find("mispolicy") != j.end() && !j.at("mispolicy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1804 | 1818 | x.set_mispolicy(get_stack_optional<int64_t>(j, "mispolicy")); |
| 1819 | + if (j.find("multipara") != j.end() && !j.at("multipara").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1805 | 1820 | x.set_multipara(get_stack_optional<int64_t>(j, "multipara")); |
| 1821 | + if (j.find("Nazirite") != j.end() && !j.at("Nazirite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1806 | 1822 | x.set_nazirite(get_stack_optional<int64_t>(j, "Nazirite")); |
| 1807 | 1823 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 1824 | + if (j.find("possessorial") != j.end() && !j.at("possessorial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1808 | 1825 | x.set_possessorial(get_stack_optional<int64_t>(j, "possessorial")); |
| 1826 | + if (j.find("shamed") != j.end() && !j.at("shamed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1809 | 1827 | x.set_shamed(get_stack_optional<int64_t>(j, "shamed")); |
| 1828 | + if (j.find("shelfworn") != j.end() && !j.at("shelfworn").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1810 | 1829 | x.set_shelfworn(get_stack_optional<int64_t>(j, "shelfworn")); |
| 1830 | + if (j.find("stagnum") != j.end() && !j.at("stagnum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1811 | 1831 | x.set_stagnum(get_stack_optional<int64_t>(j, "stagnum")); |
| 1832 | + if (j.find("Those") != j.end() && !j.at("Those").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1812 | 1833 | x.set_those(get_stack_optional<int64_t>(j, "Those")); |
| 1834 | + if (j.find("undecimal") != j.end() && !j.at("undecimal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1813 | 1835 | x.set_undecimal(get_stack_optional<int64_t>(j, "undecimal")); |
| 1814 | 1836 | } |
| 1815 | 1837 | |
| @@ -1988,30 +2010,51 @@ namespace quicktype { | ||
| 1988 | 2010 | |
| 1989 | 2011 | inline void from_json(const json & j, DiscordiaClass& x) { |
| 1990 | 2012 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2013 | + if (j.find("Altaic") != j.end() && !j.at("Altaic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1991 | 2014 | x.set_altaic(get_stack_optional<int64_t>(j, "Altaic")); |
| 2015 | + if (j.find("amoristic") != j.end() && !j.at("amoristic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1992 | 2016 | x.set_amoristic(get_stack_optional<int64_t>(j, "amoristic")); |
| 2017 | + if (j.find("blennophthalmia") != j.end() && !j.at("blennophthalmia").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1993 | 2018 | x.set_blennophthalmia(get_stack_optional<int64_t>(j, "blennophthalmia")); |
| 1994 | 2019 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2020 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1995 | 2021 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2022 | + if (j.find("disciplinability") != j.end() && !j.at("disciplinability").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1996 | 2023 | x.set_disciplinability(get_stack_optional<int64_t>(j, "disciplinability")); |
| 1997 | 2024 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2025 | + if (j.find("goofer") != j.end() && !j.at("goofer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1998 | 2026 | x.set_goofer(get_stack_optional<int64_t>(j, "goofer")); |
| 1999 | 2027 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2028 | + if (j.find("laryngograph") != j.end() && !j.at("laryngograph").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2000 | 2029 | x.set_laryngograph(get_stack_optional<int64_t>(j, "laryngograph")); |
| 2030 | + if (j.find("leucitis") != j.end() && !j.at("leucitis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2001 | 2031 | x.set_leucitis(get_stack_optional<int64_t>(j, "leucitis")); |
| 2032 | + if (j.find("lymphocyst") != j.end() && !j.at("lymphocyst").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2002 | 2033 | x.set_lymphocyst(get_stack_optional<int64_t>(j, "lymphocyst")); |
| 2034 | + if (j.find("microcosmology") != j.end() && !j.at("microcosmology").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2003 | 2035 | x.set_microcosmology(get_stack_optional<int64_t>(j, "microcosmology")); |
| 2036 | + if (j.find("nauseation") != j.end() && !j.at("nauseation").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2004 | 2037 | x.set_nauseation(get_stack_optional<int64_t>(j, "nauseation")); |
| 2005 | 2038 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2039 | + if (j.find("Patarin") != j.end() && !j.at("Patarin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2006 | 2040 | x.set_patarin(get_stack_optional<int64_t>(j, "Patarin")); |
| 2041 | + if (j.find("preliberal") != j.end() && !j.at("preliberal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2007 | 2042 | x.set_preliberal(get_stack_optional<int64_t>(j, "preliberal")); |
| 2043 | + if (j.find("prettifier") != j.end() && !j.at("prettifier").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2008 | 2044 | x.set_prettifier(get_stack_optional<int64_t>(j, "prettifier")); |
| 2045 | + if (j.find("rangework") != j.end() && !j.at("rangework").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2009 | 2046 | x.set_rangework(get_stack_optional<int64_t>(j, "rangework")); |
| 2047 | + if (j.find("redient") != j.end() && !j.at("redient").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2010 | 2048 | x.set_redient(get_stack_optional<int64_t>(j, "redient")); |
| 2049 | + if (j.find("subfusiform") != j.end() && !j.at("subfusiform").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2011 | 2050 | x.set_subfusiform(get_stack_optional<int64_t>(j, "subfusiform")); |
| 2051 | + if (j.find("suicidical") != j.end() && !j.at("suicidical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2012 | 2052 | x.set_suicidical(get_stack_optional<int64_t>(j, "suicidical")); |
| 2053 | + if (j.find("swow") != j.end() && !j.at("swow").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2013 | 2054 | x.set_swow(get_stack_optional<int64_t>(j, "swow")); |
| 2055 | + if (j.find("wastrel") != j.end() && !j.at("wastrel").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2014 | 2056 | x.set_wastrel(get_stack_optional<int64_t>(j, "wastrel")); |
| 2057 | + if (j.find("wingle") != j.end() && !j.at("wingle").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2015 | 2058 | x.set_wingle(get_stack_optional<int64_t>(j, "wingle")); |
| 2016 | 2059 | } |
| 2017 | 2060 | |
| @@ -2094,30 +2137,51 @@ namespace quicktype { | ||
| 2094 | 2137 | |
| 2095 | 2138 | inline void from_json(const json & j, LaviniaClass& x) { |
| 2096 | 2139 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2140 | + if (j.find("agitable") != j.end() && !j.at("agitable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2097 | 2141 | x.set_agitable(get_stack_optional<int64_t>(j, "agitable")); |
| 2142 | + if (j.find("asininity") != j.end() && !j.at("asininity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2098 | 2143 | x.set_asininity(get_stack_optional<int64_t>(j, "asininity")); |
| 2144 | + if (j.find("benefiter") != j.end() && !j.at("benefiter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2099 | 2145 | x.set_benefiter(get_stack_optional<int64_t>(j, "benefiter")); |
| 2146 | + if (j.find("bronzelike") != j.end() && !j.at("bronzelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2100 | 2147 | x.set_bronzelike(get_stack_optional<int64_t>(j, "bronzelike")); |
| 2101 | 2148 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2149 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2102 | 2150 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2151 | + if (j.find("cholesteatomatous") != j.end() && !j.at("cholesteatomatous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2103 | 2152 | x.set_cholesteatomatous(get_stack_optional<int64_t>(j, "cholesteatomatous")); |
| 2153 | + if (j.find("deprivement") != j.end() && !j.at("deprivement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2104 | 2154 | x.set_deprivement(get_stack_optional<int64_t>(j, "deprivement")); |
| 2105 | 2155 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2156 | + if (j.find("flippantness") != j.end() && !j.at("flippantness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2106 | 2157 | x.set_flippantness(get_stack_optional<int64_t>(j, "flippantness")); |
| 2158 | + if (j.find("fogproof") != j.end() && !j.at("fogproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2107 | 2159 | x.set_fogproof(get_stack_optional<int64_t>(j, "fogproof")); |
| 2108 | 2160 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2161 | + if (j.find("merrymeeting") != j.end() && !j.at("merrymeeting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2109 | 2162 | x.set_merrymeeting(get_stack_optional<int64_t>(j, "merrymeeting")); |
| 2110 | 2163 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2164 | + if (j.find("overcareful") != j.end() && !j.at("overcareful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2111 | 2165 | x.set_overcareful(get_stack_optional<int64_t>(j, "overcareful")); |
| 2166 | + if (j.find("panaris") != j.end() && !j.at("panaris").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2112 | 2167 | x.set_panaris(get_stack_optional<int64_t>(j, "panaris")); |
| 2168 | + if (j.find("preacceptance") != j.end() && !j.at("preacceptance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2113 | 2169 | x.set_preacceptance(get_stack_optional<int64_t>(j, "preacceptance")); |
| 2170 | + if (j.find("quinoxaline") != j.end() && !j.at("quinoxaline").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2114 | 2171 | x.set_quinoxaline(get_stack_optional<int64_t>(j, "quinoxaline")); |
| 2172 | + if (j.find("sig") != j.end() && !j.at("sig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2115 | 2173 | x.set_sig(get_stack_optional<int64_t>(j, "sig")); |
| 2174 | + if (j.find("superconfusion") != j.end() && !j.at("superconfusion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2116 | 2175 | x.set_superconfusion(get_stack_optional<int64_t>(j, "superconfusion")); |
| 2176 | + if (j.find("Tacana") != j.end() && !j.at("Tacana").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2117 | 2177 | x.set_tacana(get_stack_optional<int64_t>(j, "Tacana")); |
| 2178 | + if (j.find("tillotter") != j.end() && !j.at("tillotter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2118 | 2179 | x.set_tillotter(get_stack_optional<int64_t>(j, "tillotter")); |
| 2180 | + if (j.find("tranquillize") != j.end() && !j.at("tranquillize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2119 | 2181 | x.set_tranquillize(get_stack_optional<int64_t>(j, "tranquillize")); |
| 2182 | + if (j.find("unquestionable") != j.end() && !j.at("unquestionable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2120 | 2183 | x.set_unquestionable(get_stack_optional<int64_t>(j, "unquestionable")); |
| 2184 | + if (j.find("uproute") != j.end() && !j.at("uproute").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2121 | 2185 | x.set_uproute(get_stack_optional<int64_t>(j, "uproute")); |
| 2122 | 2186 | } |
Test case
3 generated files · +201 −0test/inputs/json/priority/combinations3.json
Mcpluspluscode-format-with-struct--67c848c66185 / quicktype.hpp+67 −0
| @@ -925,29 +925,50 @@ namespace quicktype { | ||
| 925 | 925 | inline void from_json(const json & j, LupusClass& x) { |
| 926 | 926 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 927 | 927 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 928 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 928 | 929 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 930 | + if (j.find("Chlorioninae") != j.end() && !j.at("Chlorioninae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 929 | 931 | x.chlorioninae = get_stack_optional<int64_t>(j, "Chlorioninae"); |
| 932 | + if (j.find("Corvinae") != j.end() && !j.at("Corvinae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 930 | 933 | x.corvinae = get_stack_optional<int64_t>(j, "Corvinae"); |
| 934 | + if (j.find("Crassina") != j.end() && !j.at("Crassina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 931 | 935 | x.crassina = get_stack_optional<int64_t>(j, "Crassina"); |
| 932 | 936 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 937 | + if (j.find("exiguity") != j.end() && !j.at("exiguity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 933 | 938 | x.exiguity = get_stack_optional<int64_t>(j, "exiguity"); |
| 939 | + if (j.find("farcist") != j.end() && !j.at("farcist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 934 | 940 | x.farcist = get_stack_optional<int64_t>(j, "farcist"); |
| 941 | + if (j.find("holographical") != j.end() && !j.at("holographical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 935 | 942 | x.holographical = get_stack_optional<int64_t>(j, "holographical"); |
| 936 | 943 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 944 | + if (j.find("ichthyophagan") != j.end() && !j.at("ichthyophagan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 937 | 945 | x.ichthyophagan = get_stack_optional<int64_t>(j, "ichthyophagan"); |
| 946 | + if (j.find("implacable") != j.end() && !j.at("implacable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 938 | 947 | x.implacable = get_stack_optional<int64_t>(j, "implacable"); |
| 939 | 948 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 949 | + if (j.find("outshiner") != j.end() && !j.at("outshiner").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 940 | 950 | x.outshiner = get_stack_optional<int64_t>(j, "outshiner"); |
| 951 | + if (j.find("overweather") != j.end() && !j.at("overweather").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 941 | 952 | x.overweather = get_stack_optional<int64_t>(j, "overweather"); |
| 953 | + if (j.find("protonegroid") != j.end() && !j.at("protonegroid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 942 | 954 | x.protonegroid = get_stack_optional<int64_t>(j, "protonegroid"); |
| 955 | + if (j.find("shallowish") != j.end() && !j.at("shallowish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 943 | 956 | x.shallowish = get_stack_optional<int64_t>(j, "shallowish"); |
| 957 | + if (j.find("snoke") != j.end() && !j.at("snoke").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 944 | 958 | x.snoke = get_stack_optional<int64_t>(j, "snoke"); |
| 959 | + if (j.find("snout") != j.end() && !j.at("snout").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 945 | 960 | x.snout = get_stack_optional<int64_t>(j, "snout"); |
| 961 | + if (j.find("surveillance") != j.end() && !j.at("surveillance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 946 | 962 | x.surveillance = get_stack_optional<int64_t>(j, "surveillance"); |
| 963 | + if (j.find("threshingtime") != j.end() && !j.at("threshingtime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 947 | 964 | x.threshingtime = get_stack_optional<int64_t>(j, "threshingtime"); |
| 965 | + if (j.find("Thysanocarpus") != j.end() && !j.at("Thysanocarpus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 948 | 966 | x.thysanocarpus = get_stack_optional<int64_t>(j, "Thysanocarpus"); |
| 967 | + if (j.find("unsignificantly") != j.end() && !j.at("unsignificantly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 949 | 968 | x.unsignificantly = get_stack_optional<int64_t>(j, "unsignificantly"); |
| 969 | + if (j.find("unsnap") != j.end() && !j.at("unsnap").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 950 | 970 | x.unsnap = get_stack_optional<int64_t>(j, "unsnap"); |
| 971 | + if (j.find("vendible") != j.end() && !j.at("vendible").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 951 | 972 | x.vendible = get_stack_optional<int64_t>(j, "vendible"); |
| 952 | 973 | } |
| 953 | 974 | |
| @@ -982,48 +1003,69 @@ namespace quicktype { | ||
| 982 | 1003 | |
| 983 | 1004 | inline void from_json(const json & j, Maslin& x) { |
| 984 | 1005 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1006 | + if (j.find("Alicant") != j.end() && !j.at("Alicant").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 985 | 1007 | x.alicant = get_stack_optional<int64_t>(j, "Alicant"); |
| 986 | 1008 | x.antiatonement = get_untyped(j, "antiatonement"); |
| 1009 | + if (j.find("anticorrosive") != j.end() && !j.at("anticorrosive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 987 | 1010 | x.anticorrosive = get_stack_optional<int64_t>(j, "anticorrosive"); |
| 988 | 1011 | x.aphidozer = get_untyped(j, "aphidozer"); |
| 989 | 1012 | x.bakuninist = get_untyped(j, "Bakuninist"); |
| 1013 | + if (j.find("be") != j.end() && !j.at("be").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 990 | 1014 | x.be = get_stack_optional<int64_t>(j, "be"); |
| 991 | 1015 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1016 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 992 | 1017 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1018 | + if (j.find("chub") != j.end() && !j.at("chub").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 993 | 1019 | x.chub = get_stack_optional<int64_t>(j, "chub"); |
| 1020 | + if (j.find("cuprosilicon") != j.end() && !j.at("cuprosilicon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 994 | 1021 | x.cuprosilicon = get_stack_optional<int64_t>(j, "cuprosilicon"); |
| 1022 | + if (j.find("curtailedly") != j.end() && !j.at("curtailedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 995 | 1023 | x.curtailedly = get_stack_optional<int64_t>(j, "curtailedly"); |
| 1024 | + if (j.find("dellenite") != j.end() && !j.at("dellenite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 996 | 1025 | x.dellenite = get_stack_optional<int64_t>(j, "dellenite"); |
| 1026 | + if (j.find("Dimitry") != j.end() && !j.at("Dimitry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 997 | 1027 | x.dimitry = get_stack_optional<int64_t>(j, "Dimitry"); |
| 998 | 1028 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 999 | 1029 | x.edifying = get_untyped(j, "edifying"); |
| 1030 | + if (j.find("ethmoiditis") != j.end() && !j.at("ethmoiditis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1000 | 1031 | x.ethmoiditis = get_stack_optional<int64_t>(j, "ethmoiditis"); |
| 1001 | 1032 | x.gastralgy = get_untyped(j, "gastralgy"); |
| 1033 | + if (j.find("goatherd") != j.end() && !j.at("goatherd").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1002 | 1034 | x.goatherd = get_stack_optional<int64_t>(j, "goatherd"); |
| 1035 | + if (j.find("hammerdress") != j.end() && !j.at("hammerdress").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1003 | 1036 | x.hammerdress = get_stack_optional<int64_t>(j, "hammerdress"); |
| 1004 | 1037 | x.hangfire = get_untyped(j, "hangfire"); |
| 1005 | 1038 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1039 | + if (j.find("lacunosity") != j.end() && !j.at("lacunosity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1006 | 1040 | x.lacunosity = get_stack_optional<int64_t>(j, "lacunosity"); |
| 1007 | 1041 | x.longiloquence = get_untyped(j, "longiloquence"); |
| 1042 | + if (j.find("mameliere") != j.end() && !j.at("mameliere").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1008 | 1043 | x.mameliere = get_stack_optional<int64_t>(j, "mameliere"); |
| 1009 | 1044 | x.motherless = get_untyped(j, "motherless"); |
| 1010 | 1045 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1011 | 1046 | x.noncorrodible = get_untyped(j, "noncorrodible"); |
| 1012 | 1047 | x.nonsensicality = get_untyped(j, "nonsensicality"); |
| 1048 | + if (j.find("oafishly") != j.end() && !j.at("oafishly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1013 | 1049 | x.oafishly = get_stack_optional<int64_t>(j, "oafishly"); |
| 1014 | 1050 | x.pfund = get_untyped(j, "pfund"); |
| 1015 | 1051 | x.preadvisory = get_untyped(j, "preadvisory"); |
| 1016 | 1052 | x.retroflexed = get_untyped(j, "retroflexed"); |
| 1053 | + if (j.find("saccharulmic") != j.end() && !j.at("saccharulmic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1017 | 1054 | x.saccharulmic = get_stack_optional<int64_t>(j, "saccharulmic"); |
| 1055 | + if (j.find("scowlful") != j.end() && !j.at("scowlful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1018 | 1056 | x.scowlful = get_stack_optional<int64_t>(j, "scowlful"); |
| 1019 | 1057 | x.secluded = get_untyped(j, "secluded"); |
| 1020 | 1058 | x.slackage = get_untyped(j, "slackage"); |
| 1059 | + if (j.find("sphaeridial") != j.end() && !j.at("sphaeridial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1021 | 1060 | x.sphaeridial = get_stack_optional<int64_t>(j, "sphaeridial"); |
| 1022 | 1061 | x.spondulics = get_untyped(j, "spondulics"); |
| 1062 | + if (j.find("subsecive") != j.end() && !j.at("subsecive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1023 | 1063 | x.subsecive = get_stack_optional<int64_t>(j, "subsecive"); |
| 1024 | 1064 | x.swellmobsman = get_untyped(j, "swellmobsman"); |
| 1065 | + if (j.find("trachyglossate") != j.end() && !j.at("trachyglossate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1025 | 1066 | x.trachyglossate = get_stack_optional<int64_t>(j, "trachyglossate"); |
| 1026 | 1067 | x.trialogue = get_untyped(j, "trialogue"); |
| 1068 | + if (j.find("unassuaged") != j.end() && !j.at("unassuaged").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1027 | 1069 | x.unassuaged = get_stack_optional<int64_t>(j, "unassuaged"); |
| 1028 | 1070 | x.ungross = get_untyped(j, "ungross"); |
| 1029 | 1071 | x.unjudiciously = get_untyped(j, "unjudiciously"); |
| @@ -1081,6 +1123,7 @@ namespace quicktype { | ||
| 1081 | 1123 | inline void from_json(const json & j, MonaziteClass& x) { |
| 1082 | 1124 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1083 | 1125 | x.catharticalness = j.at("catharticalness").get<double>(); |
| 1126 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1084 | 1127 | x.chirotherium = j.at("Chirotherium").get<int64_t>(); |
| 1085 | 1128 | x.disdiapason = j.at("disdiapason").get<std::string>(); |
| 1086 | 1129 | x.homocerc = j.at("homocerc").get<bool>(); |
| @@ -1101,6 +1144,7 @@ namespace quicktype { | ||
| 1101 | 1144 | x.blaspheme = get_untyped(j, "blaspheme"); |
| 1102 | 1145 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1103 | 1146 | x.celiosalpingectomy = get_untyped(j, "celiosalpingectomy"); |
| 1147 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1104 | 1148 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1105 | 1149 | x.consummativeness = get_untyped(j, "consummativeness"); |
| 1106 | 1150 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| @@ -1158,6 +1202,7 @@ namespace quicktype { | ||
| 1158 | 1202 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1159 | 1203 | x.estevin = j.at("estevin").get<std::string>(); |
| 1160 | 1204 | x.jolterhead = j.at("jolterhead").get<double>(); |
| 1205 | + if (j.find("sauternes") != j.end() && !j.at("sauternes").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1161 | 1206 | x.sauternes = j.at("sauternes").get<int64_t>(); |
| 1162 | 1207 | x.sparsely = j.at("sparsely").get<bool>(); |
| 1163 | 1208 | x.unrequested = get_untyped(j, "unrequested"); |
| @@ -1270,30 +1315,51 @@ namespace quicktype { | ||
| 1270 | 1315 | |
| 1271 | 1316 | inline void from_json(const json & j, PiaculumClass& x) { |
| 1272 | 1317 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1318 | + if (j.find("alada") != j.end() && !j.at("alada").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1273 | 1319 | x.alada = get_stack_optional<int64_t>(j, "alada"); |
| 1320 | + if (j.find("amphistomous") != j.end() && !j.at("amphistomous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1274 | 1321 | x.amphistomous = get_stack_optional<int64_t>(j, "amphistomous"); |
| 1322 | + if (j.find("boysenberry") != j.end() && !j.at("boysenberry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1275 | 1323 | x.boysenberry = get_stack_optional<int64_t>(j, "boysenberry"); |
| 1276 | 1324 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1325 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1277 | 1326 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1327 | + if (j.find("decardinalize") != j.end() && !j.at("decardinalize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1278 | 1328 | x.decardinalize = get_stack_optional<int64_t>(j, "decardinalize"); |
| 1329 | + if (j.find("discouragement") != j.end() && !j.at("discouragement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1279 | 1330 | x.discouragement = get_stack_optional<int64_t>(j, "discouragement"); |
| 1280 | 1331 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1332 | + if (j.find("doitrified") != j.end() && !j.at("doitrified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1281 | 1333 | x.doitrified = get_stack_optional<int64_t>(j, "doitrified"); |
| 1334 | + if (j.find("hexaspermous") != j.end() && !j.at("hexaspermous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1282 | 1335 | x.hexaspermous = get_stack_optional<int64_t>(j, "hexaspermous"); |
| 1283 | 1336 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1337 | + if (j.find("insinking") != j.end() && !j.at("insinking").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1284 | 1338 | x.insinking = get_stack_optional<int64_t>(j, "insinking"); |
| 1339 | + if (j.find("loathfulness") != j.end() && !j.at("loathfulness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1285 | 1340 | x.loathfulness = get_stack_optional<int64_t>(j, "loathfulness"); |
| 1341 | + if (j.find("miasmatical") != j.end() && !j.at("miasmatical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1286 | 1342 | x.miasmatical = get_stack_optional<int64_t>(j, "miasmatical"); |
| 1343 | + if (j.find("neurofibril") != j.end() && !j.at("neurofibril").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1287 | 1344 | x.neurofibril = get_stack_optional<int64_t>(j, "neurofibril"); |
| 1288 | 1345 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1346 | + if (j.find("phonendoscope") != j.end() && !j.at("phonendoscope").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1289 | 1347 | x.phonendoscope = get_stack_optional<int64_t>(j, "phonendoscope"); |
| 1348 | + if (j.find("pilferment") != j.end() && !j.at("pilferment").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1290 | 1349 | x.pilferment = get_stack_optional<int64_t>(j, "pilferment"); |
| 1350 | + if (j.find("predismissory") != j.end() && !j.at("predismissory").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1291 | 1351 | x.predismissory = get_stack_optional<int64_t>(j, "predismissory"); |
| 1352 | + if (j.find("preinscription") != j.end() && !j.at("preinscription").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1292 | 1353 | x.preinscription = get_stack_optional<int64_t>(j, "preinscription"); |
| 1354 | + if (j.find("quotative") != j.end() && !j.at("quotative").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1293 | 1355 | x.quotative = get_stack_optional<int64_t>(j, "quotative"); |
| 1356 | + if (j.find("sienna") != j.end() && !j.at("sienna").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1294 | 1357 | x.sienna = get_stack_optional<int64_t>(j, "sienna"); |
| 1358 | + if (j.find("thorax") != j.end() && !j.at("thorax").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1295 | 1359 | x.thorax = get_stack_optional<int64_t>(j, "thorax"); |
| 1360 | + if (j.find("yachting") != j.end() && !j.at("yachting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1296 | 1361 | x.yachting = get_stack_optional<int64_t>(j, "yachting"); |
| 1362 | + if (j.find("Zipper") != j.end() && !j.at("Zipper").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1297 | 1363 | x.zipper = get_stack_optional<int64_t>(j, "Zipper"); |
| 1298 | 1364 | } |
| 1299 | 1365 | |
| @@ -1330,6 +1396,7 @@ namespace quicktype { | ||
| 1330 | 1396 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1331 | 1397 | x.carbonarism = get_untyped(j, "Carbonarism"); |
| 1332 | 1398 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1399 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1333 | 1400 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1334 | 1401 | x.cineolic = get_untyped(j, "cineolic"); |
| 1335 | 1402 | x.cobbly = get_untyped(j, "cobbly"); |
Mcplusplusconst-style-east-const--0048a2a7a881 / quicktype.hpp+67 −0
| @@ -2367,29 +2367,50 @@ namespace quicktype { | ||
| 2367 | 2367 | inline void from_json(json const & j, LupusClass& x) { |
| 2368 | 2368 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2369 | 2369 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2370 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2370 | 2371 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2372 | + if (j.find("Chlorioninae") != j.end() && !j.at("Chlorioninae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2371 | 2373 | x.set_chlorioninae(get_stack_optional<int64_t>(j, "Chlorioninae")); |
| 2374 | + if (j.find("Corvinae") != j.end() && !j.at("Corvinae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2372 | 2375 | x.set_corvinae(get_stack_optional<int64_t>(j, "Corvinae")); |
| 2376 | + if (j.find("Crassina") != j.end() && !j.at("Crassina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2373 | 2377 | x.set_crassina(get_stack_optional<int64_t>(j, "Crassina")); |
| 2374 | 2378 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2379 | + if (j.find("exiguity") != j.end() && !j.at("exiguity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2375 | 2380 | x.set_exiguity(get_stack_optional<int64_t>(j, "exiguity")); |
| 2381 | + if (j.find("farcist") != j.end() && !j.at("farcist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2376 | 2382 | x.set_farcist(get_stack_optional<int64_t>(j, "farcist")); |
| 2383 | + if (j.find("holographical") != j.end() && !j.at("holographical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2377 | 2384 | x.set_holographical(get_stack_optional<int64_t>(j, "holographical")); |
| 2378 | 2385 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2386 | + if (j.find("ichthyophagan") != j.end() && !j.at("ichthyophagan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2379 | 2387 | x.set_ichthyophagan(get_stack_optional<int64_t>(j, "ichthyophagan")); |
| 2388 | + if (j.find("implacable") != j.end() && !j.at("implacable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2380 | 2389 | x.set_implacable(get_stack_optional<int64_t>(j, "implacable")); |
| 2381 | 2390 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2391 | + if (j.find("outshiner") != j.end() && !j.at("outshiner").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2382 | 2392 | x.set_outshiner(get_stack_optional<int64_t>(j, "outshiner")); |
| 2393 | + if (j.find("overweather") != j.end() && !j.at("overweather").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2383 | 2394 | x.set_overweather(get_stack_optional<int64_t>(j, "overweather")); |
| 2395 | + if (j.find("protonegroid") != j.end() && !j.at("protonegroid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2384 | 2396 | x.set_protonegroid(get_stack_optional<int64_t>(j, "protonegroid")); |
| 2397 | + if (j.find("shallowish") != j.end() && !j.at("shallowish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2385 | 2398 | x.set_shallowish(get_stack_optional<int64_t>(j, "shallowish")); |
| 2399 | + if (j.find("snoke") != j.end() && !j.at("snoke").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2386 | 2400 | x.set_snoke(get_stack_optional<int64_t>(j, "snoke")); |
| 2401 | + if (j.find("snout") != j.end() && !j.at("snout").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2387 | 2402 | x.set_snout(get_stack_optional<int64_t>(j, "snout")); |
| 2403 | + if (j.find("surveillance") != j.end() && !j.at("surveillance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2388 | 2404 | x.set_surveillance(get_stack_optional<int64_t>(j, "surveillance")); |
| 2405 | + if (j.find("threshingtime") != j.end() && !j.at("threshingtime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2389 | 2406 | x.set_threshingtime(get_stack_optional<int64_t>(j, "threshingtime")); |
| 2407 | + if (j.find("Thysanocarpus") != j.end() && !j.at("Thysanocarpus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2390 | 2408 | x.set_thysanocarpus(get_stack_optional<int64_t>(j, "Thysanocarpus")); |
| 2409 | + if (j.find("unsignificantly") != j.end() && !j.at("unsignificantly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2391 | 2410 | x.set_unsignificantly(get_stack_optional<int64_t>(j, "unsignificantly")); |
| 2411 | + if (j.find("unsnap") != j.end() && !j.at("unsnap").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2392 | 2412 | x.set_unsnap(get_stack_optional<int64_t>(j, "unsnap")); |
| 2413 | + if (j.find("vendible") != j.end() && !j.at("vendible").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2393 | 2414 | x.set_vendible(get_stack_optional<int64_t>(j, "vendible")); |
| 2394 | 2415 | } |
| 2395 | 2416 | |
| @@ -2424,48 +2445,69 @@ namespace quicktype { | ||
| 2424 | 2445 | |
| 2425 | 2446 | inline void from_json(json const & j, Maslin& x) { |
| 2426 | 2447 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2448 | + if (j.find("Alicant") != j.end() && !j.at("Alicant").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2427 | 2449 | x.set_alicant(get_stack_optional<int64_t>(j, "Alicant")); |
| 2428 | 2450 | x.set_antiatonement(get_untyped(j, "antiatonement")); |
| 2451 | + if (j.find("anticorrosive") != j.end() && !j.at("anticorrosive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2429 | 2452 | x.set_anticorrosive(get_stack_optional<int64_t>(j, "anticorrosive")); |
| 2430 | 2453 | x.set_aphidozer(get_untyped(j, "aphidozer")); |
| 2431 | 2454 | x.set_bakuninist(get_untyped(j, "Bakuninist")); |
| 2455 | + if (j.find("be") != j.end() && !j.at("be").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2432 | 2456 | x.set_be(get_stack_optional<int64_t>(j, "be")); |
| 2433 | 2457 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2458 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2434 | 2459 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2460 | + if (j.find("chub") != j.end() && !j.at("chub").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2435 | 2461 | x.set_chub(get_stack_optional<int64_t>(j, "chub")); |
| 2462 | + if (j.find("cuprosilicon") != j.end() && !j.at("cuprosilicon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2436 | 2463 | x.set_cuprosilicon(get_stack_optional<int64_t>(j, "cuprosilicon")); |
| 2464 | + if (j.find("curtailedly") != j.end() && !j.at("curtailedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2437 | 2465 | x.set_curtailedly(get_stack_optional<int64_t>(j, "curtailedly")); |
| 2466 | + if (j.find("dellenite") != j.end() && !j.at("dellenite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2438 | 2467 | x.set_dellenite(get_stack_optional<int64_t>(j, "dellenite")); |
| 2468 | + if (j.find("Dimitry") != j.end() && !j.at("Dimitry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2439 | 2469 | x.set_dimitry(get_stack_optional<int64_t>(j, "Dimitry")); |
| 2440 | 2470 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2441 | 2471 | x.set_edifying(get_untyped(j, "edifying")); |
| 2472 | + if (j.find("ethmoiditis") != j.end() && !j.at("ethmoiditis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2442 | 2473 | x.set_ethmoiditis(get_stack_optional<int64_t>(j, "ethmoiditis")); |
| 2443 | 2474 | x.set_gastralgy(get_untyped(j, "gastralgy")); |
| 2475 | + if (j.find("goatherd") != j.end() && !j.at("goatherd").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2444 | 2476 | x.set_goatherd(get_stack_optional<int64_t>(j, "goatherd")); |
| 2477 | + if (j.find("hammerdress") != j.end() && !j.at("hammerdress").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2445 | 2478 | x.set_hammerdress(get_stack_optional<int64_t>(j, "hammerdress")); |
| 2446 | 2479 | x.set_hangfire(get_untyped(j, "hangfire")); |
| 2447 | 2480 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2481 | + if (j.find("lacunosity") != j.end() && !j.at("lacunosity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2448 | 2482 | x.set_lacunosity(get_stack_optional<int64_t>(j, "lacunosity")); |
| 2449 | 2483 | x.set_longiloquence(get_untyped(j, "longiloquence")); |
| 2484 | + if (j.find("mameliere") != j.end() && !j.at("mameliere").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2450 | 2485 | x.set_mameliere(get_stack_optional<int64_t>(j, "mameliere")); |
| 2451 | 2486 | x.set_motherless(get_untyped(j, "motherless")); |
| 2452 | 2487 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2453 | 2488 | x.set_noncorrodible(get_untyped(j, "noncorrodible")); |
| 2454 | 2489 | x.set_nonsensicality(get_untyped(j, "nonsensicality")); |
| 2490 | + if (j.find("oafishly") != j.end() && !j.at("oafishly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2455 | 2491 | x.set_oafishly(get_stack_optional<int64_t>(j, "oafishly")); |
| 2456 | 2492 | x.set_pfund(get_untyped(j, "pfund")); |
| 2457 | 2493 | x.set_preadvisory(get_untyped(j, "preadvisory")); |
| 2458 | 2494 | x.set_retroflexed(get_untyped(j, "retroflexed")); |
| 2495 | + if (j.find("saccharulmic") != j.end() && !j.at("saccharulmic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2459 | 2496 | x.set_saccharulmic(get_stack_optional<int64_t>(j, "saccharulmic")); |
| 2497 | + if (j.find("scowlful") != j.end() && !j.at("scowlful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2460 | 2498 | x.set_scowlful(get_stack_optional<int64_t>(j, "scowlful")); |
| 2461 | 2499 | x.set_secluded(get_untyped(j, "secluded")); |
| 2462 | 2500 | x.set_slackage(get_untyped(j, "slackage")); |
| 2501 | + if (j.find("sphaeridial") != j.end() && !j.at("sphaeridial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2463 | 2502 | x.set_sphaeridial(get_stack_optional<int64_t>(j, "sphaeridial")); |
| 2464 | 2503 | x.set_spondulics(get_untyped(j, "spondulics")); |
| 2504 | + if (j.find("subsecive") != j.end() && !j.at("subsecive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2465 | 2505 | x.set_subsecive(get_stack_optional<int64_t>(j, "subsecive")); |
| 2466 | 2506 | x.set_swellmobsman(get_untyped(j, "swellmobsman")); |
| 2507 | + if (j.find("trachyglossate") != j.end() && !j.at("trachyglossate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2467 | 2508 | x.set_trachyglossate(get_stack_optional<int64_t>(j, "trachyglossate")); |
| 2468 | 2509 | x.set_trialogue(get_untyped(j, "trialogue")); |
| 2510 | + if (j.find("unassuaged") != j.end() && !j.at("unassuaged").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2469 | 2511 | x.set_unassuaged(get_stack_optional<int64_t>(j, "unassuaged")); |
| 2470 | 2512 | x.set_ungross(get_untyped(j, "ungross")); |
| 2471 | 2513 | x.set_unjudiciously(get_untyped(j, "unjudiciously")); |
| @@ -2523,6 +2565,7 @@ namespace quicktype { | ||
| 2523 | 2565 | inline void from_json(json const & j, MonaziteClass& x) { |
| 2524 | 2566 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2525 | 2567 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2568 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2526 | 2569 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2527 | 2570 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2528 | 2571 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2543,6 +2586,7 @@ namespace quicktype { | ||
| 2543 | 2586 | x.set_blaspheme(get_untyped(j, "blaspheme")); |
| 2544 | 2587 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2545 | 2588 | x.set_celiosalpingectomy(get_untyped(j, "celiosalpingectomy")); |
| 2589 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2546 | 2590 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2547 | 2591 | x.set_consummativeness(get_untyped(j, "consummativeness")); |
| 2548 | 2592 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -2600,6 +2644,7 @@ namespace quicktype { | ||
| 2600 | 2644 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2601 | 2645 | x.set_estevin(j.at("estevin").get<std::string>()); |
| 2602 | 2646 | x.set_jolterhead(j.at("jolterhead").get<double>()); |
| 2647 | + if (j.find("sauternes") != j.end() && !j.at("sauternes").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2603 | 2648 | x.set_sauternes(j.at("sauternes").get<int64_t>()); |
| 2604 | 2649 | x.set_sparsely(j.at("sparsely").get<bool>()); |
| 2605 | 2650 | x.set_unrequested(get_untyped(j, "unrequested")); |
| @@ -2712,30 +2757,51 @@ namespace quicktype { | ||
| 2712 | 2757 | |
| 2713 | 2758 | inline void from_json(json const & j, PiaculumClass& x) { |
| 2714 | 2759 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2760 | + if (j.find("alada") != j.end() && !j.at("alada").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2715 | 2761 | x.set_alada(get_stack_optional<int64_t>(j, "alada")); |
| 2762 | + if (j.find("amphistomous") != j.end() && !j.at("amphistomous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2716 | 2763 | x.set_amphistomous(get_stack_optional<int64_t>(j, "amphistomous")); |
| 2764 | + if (j.find("boysenberry") != j.end() && !j.at("boysenberry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2717 | 2765 | x.set_boysenberry(get_stack_optional<int64_t>(j, "boysenberry")); |
| 2718 | 2766 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2767 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2719 | 2768 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2769 | + if (j.find("decardinalize") != j.end() && !j.at("decardinalize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2720 | 2770 | x.set_decardinalize(get_stack_optional<int64_t>(j, "decardinalize")); |
| 2771 | + if (j.find("discouragement") != j.end() && !j.at("discouragement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2721 | 2772 | x.set_discouragement(get_stack_optional<int64_t>(j, "discouragement")); |
| 2722 | 2773 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2774 | + if (j.find("doitrified") != j.end() && !j.at("doitrified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2723 | 2775 | x.set_doitrified(get_stack_optional<int64_t>(j, "doitrified")); |
| 2776 | + if (j.find("hexaspermous") != j.end() && !j.at("hexaspermous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2724 | 2777 | x.set_hexaspermous(get_stack_optional<int64_t>(j, "hexaspermous")); |
| 2725 | 2778 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2779 | + if (j.find("insinking") != j.end() && !j.at("insinking").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2726 | 2780 | x.set_insinking(get_stack_optional<int64_t>(j, "insinking")); |
| 2781 | + if (j.find("loathfulness") != j.end() && !j.at("loathfulness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2727 | 2782 | x.set_loathfulness(get_stack_optional<int64_t>(j, "loathfulness")); |
| 2783 | + if (j.find("miasmatical") != j.end() && !j.at("miasmatical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2728 | 2784 | x.set_miasmatical(get_stack_optional<int64_t>(j, "miasmatical")); |
| 2785 | + if (j.find("neurofibril") != j.end() && !j.at("neurofibril").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2729 | 2786 | x.set_neurofibril(get_stack_optional<int64_t>(j, "neurofibril")); |
| 2730 | 2787 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2788 | + if (j.find("phonendoscope") != j.end() && !j.at("phonendoscope").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2731 | 2789 | x.set_phonendoscope(get_stack_optional<int64_t>(j, "phonendoscope")); |
| 2790 | + if (j.find("pilferment") != j.end() && !j.at("pilferment").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2732 | 2791 | x.set_pilferment(get_stack_optional<int64_t>(j, "pilferment")); |
| 2792 | + if (j.find("predismissory") != j.end() && !j.at("predismissory").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2733 | 2793 | x.set_predismissory(get_stack_optional<int64_t>(j, "predismissory")); |
| 2794 | + if (j.find("preinscription") != j.end() && !j.at("preinscription").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2734 | 2795 | x.set_preinscription(get_stack_optional<int64_t>(j, "preinscription")); |
| 2796 | + if (j.find("quotative") != j.end() && !j.at("quotative").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2735 | 2797 | x.set_quotative(get_stack_optional<int64_t>(j, "quotative")); |
| 2798 | + if (j.find("sienna") != j.end() && !j.at("sienna").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2736 | 2799 | x.set_sienna(get_stack_optional<int64_t>(j, "sienna")); |
| 2800 | + if (j.find("thorax") != j.end() && !j.at("thorax").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2737 | 2801 | x.set_thorax(get_stack_optional<int64_t>(j, "thorax")); |
| 2802 | + if (j.find("yachting") != j.end() && !j.at("yachting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2738 | 2803 | x.set_yachting(get_stack_optional<int64_t>(j, "yachting")); |
| 2804 | + if (j.find("Zipper") != j.end() && !j.at("Zipper").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2739 | 2805 | x.set_zipper(get_stack_optional<int64_t>(j, "Zipper")); |
| 2740 | 2806 | } |
| 2741 | 2807 | |
| @@ -2772,6 +2838,7 @@ namespace quicktype { | ||
| 2772 | 2838 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2773 | 2839 | x.set_carbonarism(get_untyped(j, "Carbonarism")); |
| 2774 | 2840 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2841 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2775 | 2842 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2776 | 2843 | x.set_cineolic(get_untyped(j, "cineolic")); |
| 2777 | 2844 | x.set_cobbly(get_untyped(j, "cobbly")); |
Mcplusplusdefault / quicktype.hpp+67 −0
| @@ -2367,29 +2367,50 @@ namespace quicktype { | ||
| 2367 | 2367 | inline void from_json(const json & j, LupusClass& x) { |
| 2368 | 2368 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2369 | 2369 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2370 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2370 | 2371 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2372 | + if (j.find("Chlorioninae") != j.end() && !j.at("Chlorioninae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2371 | 2373 | x.set_chlorioninae(get_stack_optional<int64_t>(j, "Chlorioninae")); |
| 2374 | + if (j.find("Corvinae") != j.end() && !j.at("Corvinae").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2372 | 2375 | x.set_corvinae(get_stack_optional<int64_t>(j, "Corvinae")); |
| 2376 | + if (j.find("Crassina") != j.end() && !j.at("Crassina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2373 | 2377 | x.set_crassina(get_stack_optional<int64_t>(j, "Crassina")); |
| 2374 | 2378 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2379 | + if (j.find("exiguity") != j.end() && !j.at("exiguity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2375 | 2380 | x.set_exiguity(get_stack_optional<int64_t>(j, "exiguity")); |
| 2381 | + if (j.find("farcist") != j.end() && !j.at("farcist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2376 | 2382 | x.set_farcist(get_stack_optional<int64_t>(j, "farcist")); |
| 2383 | + if (j.find("holographical") != j.end() && !j.at("holographical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2377 | 2384 | x.set_holographical(get_stack_optional<int64_t>(j, "holographical")); |
| 2378 | 2385 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2386 | + if (j.find("ichthyophagan") != j.end() && !j.at("ichthyophagan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2379 | 2387 | x.set_ichthyophagan(get_stack_optional<int64_t>(j, "ichthyophagan")); |
| 2388 | + if (j.find("implacable") != j.end() && !j.at("implacable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2380 | 2389 | x.set_implacable(get_stack_optional<int64_t>(j, "implacable")); |
| 2381 | 2390 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2391 | + if (j.find("outshiner") != j.end() && !j.at("outshiner").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2382 | 2392 | x.set_outshiner(get_stack_optional<int64_t>(j, "outshiner")); |
| 2393 | + if (j.find("overweather") != j.end() && !j.at("overweather").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2383 | 2394 | x.set_overweather(get_stack_optional<int64_t>(j, "overweather")); |
| 2395 | + if (j.find("protonegroid") != j.end() && !j.at("protonegroid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2384 | 2396 | x.set_protonegroid(get_stack_optional<int64_t>(j, "protonegroid")); |
| 2397 | + if (j.find("shallowish") != j.end() && !j.at("shallowish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2385 | 2398 | x.set_shallowish(get_stack_optional<int64_t>(j, "shallowish")); |
| 2399 | + if (j.find("snoke") != j.end() && !j.at("snoke").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2386 | 2400 | x.set_snoke(get_stack_optional<int64_t>(j, "snoke")); |
| 2401 | + if (j.find("snout") != j.end() && !j.at("snout").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2387 | 2402 | x.set_snout(get_stack_optional<int64_t>(j, "snout")); |
| 2403 | + if (j.find("surveillance") != j.end() && !j.at("surveillance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2388 | 2404 | x.set_surveillance(get_stack_optional<int64_t>(j, "surveillance")); |
| 2405 | + if (j.find("threshingtime") != j.end() && !j.at("threshingtime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2389 | 2406 | x.set_threshingtime(get_stack_optional<int64_t>(j, "threshingtime")); |
| 2407 | + if (j.find("Thysanocarpus") != j.end() && !j.at("Thysanocarpus").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2390 | 2408 | x.set_thysanocarpus(get_stack_optional<int64_t>(j, "Thysanocarpus")); |
| 2409 | + if (j.find("unsignificantly") != j.end() && !j.at("unsignificantly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2391 | 2410 | x.set_unsignificantly(get_stack_optional<int64_t>(j, "unsignificantly")); |
| 2411 | + if (j.find("unsnap") != j.end() && !j.at("unsnap").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2392 | 2412 | x.set_unsnap(get_stack_optional<int64_t>(j, "unsnap")); |
| 2413 | + if (j.find("vendible") != j.end() && !j.at("vendible").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2393 | 2414 | x.set_vendible(get_stack_optional<int64_t>(j, "vendible")); |
| 2394 | 2415 | } |
| 2395 | 2416 | |
| @@ -2424,48 +2445,69 @@ namespace quicktype { | ||
| 2424 | 2445 | |
| 2425 | 2446 | inline void from_json(const json & j, Maslin& x) { |
| 2426 | 2447 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2448 | + if (j.find("Alicant") != j.end() && !j.at("Alicant").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2427 | 2449 | x.set_alicant(get_stack_optional<int64_t>(j, "Alicant")); |
| 2428 | 2450 | x.set_antiatonement(get_untyped(j, "antiatonement")); |
| 2451 | + if (j.find("anticorrosive") != j.end() && !j.at("anticorrosive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2429 | 2452 | x.set_anticorrosive(get_stack_optional<int64_t>(j, "anticorrosive")); |
| 2430 | 2453 | x.set_aphidozer(get_untyped(j, "aphidozer")); |
| 2431 | 2454 | x.set_bakuninist(get_untyped(j, "Bakuninist")); |
| 2455 | + if (j.find("be") != j.end() && !j.at("be").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2432 | 2456 | x.set_be(get_stack_optional<int64_t>(j, "be")); |
| 2433 | 2457 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2458 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2434 | 2459 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2460 | + if (j.find("chub") != j.end() && !j.at("chub").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2435 | 2461 | x.set_chub(get_stack_optional<int64_t>(j, "chub")); |
| 2462 | + if (j.find("cuprosilicon") != j.end() && !j.at("cuprosilicon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2436 | 2463 | x.set_cuprosilicon(get_stack_optional<int64_t>(j, "cuprosilicon")); |
| 2464 | + if (j.find("curtailedly") != j.end() && !j.at("curtailedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2437 | 2465 | x.set_curtailedly(get_stack_optional<int64_t>(j, "curtailedly")); |
| 2466 | + if (j.find("dellenite") != j.end() && !j.at("dellenite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2438 | 2467 | x.set_dellenite(get_stack_optional<int64_t>(j, "dellenite")); |
| 2468 | + if (j.find("Dimitry") != j.end() && !j.at("Dimitry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2439 | 2469 | x.set_dimitry(get_stack_optional<int64_t>(j, "Dimitry")); |
| 2440 | 2470 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2441 | 2471 | x.set_edifying(get_untyped(j, "edifying")); |
| 2472 | + if (j.find("ethmoiditis") != j.end() && !j.at("ethmoiditis").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2442 | 2473 | x.set_ethmoiditis(get_stack_optional<int64_t>(j, "ethmoiditis")); |
| 2443 | 2474 | x.set_gastralgy(get_untyped(j, "gastralgy")); |
| 2475 | + if (j.find("goatherd") != j.end() && !j.at("goatherd").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2444 | 2476 | x.set_goatherd(get_stack_optional<int64_t>(j, "goatherd")); |
| 2477 | + if (j.find("hammerdress") != j.end() && !j.at("hammerdress").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2445 | 2478 | x.set_hammerdress(get_stack_optional<int64_t>(j, "hammerdress")); |
| 2446 | 2479 | x.set_hangfire(get_untyped(j, "hangfire")); |
| 2447 | 2480 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2481 | + if (j.find("lacunosity") != j.end() && !j.at("lacunosity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2448 | 2482 | x.set_lacunosity(get_stack_optional<int64_t>(j, "lacunosity")); |
| 2449 | 2483 | x.set_longiloquence(get_untyped(j, "longiloquence")); |
| 2484 | + if (j.find("mameliere") != j.end() && !j.at("mameliere").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2450 | 2485 | x.set_mameliere(get_stack_optional<int64_t>(j, "mameliere")); |
| 2451 | 2486 | x.set_motherless(get_untyped(j, "motherless")); |
| 2452 | 2487 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2453 | 2488 | x.set_noncorrodible(get_untyped(j, "noncorrodible")); |
| 2454 | 2489 | x.set_nonsensicality(get_untyped(j, "nonsensicality")); |
| 2490 | + if (j.find("oafishly") != j.end() && !j.at("oafishly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2455 | 2491 | x.set_oafishly(get_stack_optional<int64_t>(j, "oafishly")); |
| 2456 | 2492 | x.set_pfund(get_untyped(j, "pfund")); |
| 2457 | 2493 | x.set_preadvisory(get_untyped(j, "preadvisory")); |
| 2458 | 2494 | x.set_retroflexed(get_untyped(j, "retroflexed")); |
| 2495 | + if (j.find("saccharulmic") != j.end() && !j.at("saccharulmic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2459 | 2496 | x.set_saccharulmic(get_stack_optional<int64_t>(j, "saccharulmic")); |
| 2497 | + if (j.find("scowlful") != j.end() && !j.at("scowlful").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2460 | 2498 | x.set_scowlful(get_stack_optional<int64_t>(j, "scowlful")); |
| 2461 | 2499 | x.set_secluded(get_untyped(j, "secluded")); |
| 2462 | 2500 | x.set_slackage(get_untyped(j, "slackage")); |
| 2501 | + if (j.find("sphaeridial") != j.end() && !j.at("sphaeridial").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2463 | 2502 | x.set_sphaeridial(get_stack_optional<int64_t>(j, "sphaeridial")); |
| 2464 | 2503 | x.set_spondulics(get_untyped(j, "spondulics")); |
| 2504 | + if (j.find("subsecive") != j.end() && !j.at("subsecive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2465 | 2505 | x.set_subsecive(get_stack_optional<int64_t>(j, "subsecive")); |
| 2466 | 2506 | x.set_swellmobsman(get_untyped(j, "swellmobsman")); |
| 2507 | + if (j.find("trachyglossate") != j.end() && !j.at("trachyglossate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2467 | 2508 | x.set_trachyglossate(get_stack_optional<int64_t>(j, "trachyglossate")); |
| 2468 | 2509 | x.set_trialogue(get_untyped(j, "trialogue")); |
| 2510 | + if (j.find("unassuaged") != j.end() && !j.at("unassuaged").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2469 | 2511 | x.set_unassuaged(get_stack_optional<int64_t>(j, "unassuaged")); |
| 2470 | 2512 | x.set_ungross(get_untyped(j, "ungross")); |
| 2471 | 2513 | x.set_unjudiciously(get_untyped(j, "unjudiciously")); |
| @@ -2523,6 +2565,7 @@ namespace quicktype { | ||
| 2523 | 2565 | inline void from_json(const json & j, MonaziteClass& x) { |
| 2524 | 2566 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2525 | 2567 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2568 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2526 | 2569 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2527 | 2570 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2528 | 2571 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2543,6 +2586,7 @@ namespace quicktype { | ||
| 2543 | 2586 | x.set_blaspheme(get_untyped(j, "blaspheme")); |
| 2544 | 2587 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2545 | 2588 | x.set_celiosalpingectomy(get_untyped(j, "celiosalpingectomy")); |
| 2589 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2546 | 2590 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2547 | 2591 | x.set_consummativeness(get_untyped(j, "consummativeness")); |
| 2548 | 2592 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -2600,6 +2644,7 @@ namespace quicktype { | ||
| 2600 | 2644 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2601 | 2645 | x.set_estevin(j.at("estevin").get<std::string>()); |
| 2602 | 2646 | x.set_jolterhead(j.at("jolterhead").get<double>()); |
| 2647 | + if (j.find("sauternes") != j.end() && !j.at("sauternes").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2603 | 2648 | x.set_sauternes(j.at("sauternes").get<int64_t>()); |
| 2604 | 2649 | x.set_sparsely(j.at("sparsely").get<bool>()); |
| 2605 | 2650 | x.set_unrequested(get_untyped(j, "unrequested")); |
| @@ -2712,30 +2757,51 @@ namespace quicktype { | ||
| 2712 | 2757 | |
| 2713 | 2758 | inline void from_json(const json & j, PiaculumClass& x) { |
| 2714 | 2759 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2760 | + if (j.find("alada") != j.end() && !j.at("alada").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2715 | 2761 | x.set_alada(get_stack_optional<int64_t>(j, "alada")); |
| 2762 | + if (j.find("amphistomous") != j.end() && !j.at("amphistomous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2716 | 2763 | x.set_amphistomous(get_stack_optional<int64_t>(j, "amphistomous")); |
| 2764 | + if (j.find("boysenberry") != j.end() && !j.at("boysenberry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2717 | 2765 | x.set_boysenberry(get_stack_optional<int64_t>(j, "boysenberry")); |
| 2718 | 2766 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2767 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2719 | 2768 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2769 | + if (j.find("decardinalize") != j.end() && !j.at("decardinalize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2720 | 2770 | x.set_decardinalize(get_stack_optional<int64_t>(j, "decardinalize")); |
| 2771 | + if (j.find("discouragement") != j.end() && !j.at("discouragement").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2721 | 2772 | x.set_discouragement(get_stack_optional<int64_t>(j, "discouragement")); |
| 2722 | 2773 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2774 | + if (j.find("doitrified") != j.end() && !j.at("doitrified").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2723 | 2775 | x.set_doitrified(get_stack_optional<int64_t>(j, "doitrified")); |
| 2776 | + if (j.find("hexaspermous") != j.end() && !j.at("hexaspermous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2724 | 2777 | x.set_hexaspermous(get_stack_optional<int64_t>(j, "hexaspermous")); |
| 2725 | 2778 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 2779 | + if (j.find("insinking") != j.end() && !j.at("insinking").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2726 | 2780 | x.set_insinking(get_stack_optional<int64_t>(j, "insinking")); |
| 2781 | + if (j.find("loathfulness") != j.end() && !j.at("loathfulness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2727 | 2782 | x.set_loathfulness(get_stack_optional<int64_t>(j, "loathfulness")); |
| 2783 | + if (j.find("miasmatical") != j.end() && !j.at("miasmatical").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2728 | 2784 | x.set_miasmatical(get_stack_optional<int64_t>(j, "miasmatical")); |
| 2785 | + if (j.find("neurofibril") != j.end() && !j.at("neurofibril").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2729 | 2786 | x.set_neurofibril(get_stack_optional<int64_t>(j, "neurofibril")); |
| 2730 | 2787 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 2788 | + if (j.find("phonendoscope") != j.end() && !j.at("phonendoscope").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2731 | 2789 | x.set_phonendoscope(get_stack_optional<int64_t>(j, "phonendoscope")); |
| 2790 | + if (j.find("pilferment") != j.end() && !j.at("pilferment").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2732 | 2791 | x.set_pilferment(get_stack_optional<int64_t>(j, "pilferment")); |
| 2792 | + if (j.find("predismissory") != j.end() && !j.at("predismissory").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2733 | 2793 | x.set_predismissory(get_stack_optional<int64_t>(j, "predismissory")); |
| 2794 | + if (j.find("preinscription") != j.end() && !j.at("preinscription").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2734 | 2795 | x.set_preinscription(get_stack_optional<int64_t>(j, "preinscription")); |
| 2796 | + if (j.find("quotative") != j.end() && !j.at("quotative").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2735 | 2797 | x.set_quotative(get_stack_optional<int64_t>(j, "quotative")); |
| 2798 | + if (j.find("sienna") != j.end() && !j.at("sienna").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2736 | 2799 | x.set_sienna(get_stack_optional<int64_t>(j, "sienna")); |
| 2800 | + if (j.find("thorax") != j.end() && !j.at("thorax").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2737 | 2801 | x.set_thorax(get_stack_optional<int64_t>(j, "thorax")); |
| 2802 | + if (j.find("yachting") != j.end() && !j.at("yachting").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2738 | 2803 | x.set_yachting(get_stack_optional<int64_t>(j, "yachting")); |
| 2804 | + if (j.find("Zipper") != j.end() && !j.at("Zipper").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2739 | 2805 | x.set_zipper(get_stack_optional<int64_t>(j, "Zipper")); |
| 2740 | 2806 | } |
| 2741 | 2807 | |
| @@ -2772,6 +2838,7 @@ namespace quicktype { | ||
| 2772 | 2838 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2773 | 2839 | x.set_carbonarism(get_untyped(j, "Carbonarism")); |
| 2774 | 2840 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2841 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2775 | 2842 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2776 | 2843 | x.set_cineolic(get_untyped(j, "cineolic")); |
| 2777 | 2844 | x.set_cobbly(get_untyped(j, "cobbly")); |
Test case
3 generated files · +201 −0test/inputs/json/priority/combinations4.json
Mcpluspluscode-format-with-struct--67c848c66185 / quicktype.hpp+67 −0
| @@ -1007,6 +1007,7 @@ namespace quicktype { | ||
| 1007 | 1007 | inline void from_json(const json & j, QuebrachineClass& x) { |
| 1008 | 1008 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1009 | 1009 | x.catharticalness = j.at("catharticalness").get<double>(); |
| 1010 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1010 | 1011 | x.chirotherium = j.at("Chirotherium").get<int64_t>(); |
| 1011 | 1012 | x.disdiapason = j.at("disdiapason").get<std::string>(); |
| 1012 | 1013 | x.homocerc = j.at("homocerc").get<bool>(); |
| @@ -1028,6 +1029,7 @@ namespace quicktype { | ||
| 1028 | 1029 | x.anabolin = get_untyped(j, "anabolin"); |
| 1029 | 1030 | x.brainy = get_untyped(j, "brainy"); |
| 1030 | 1031 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1032 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1031 | 1033 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1032 | 1034 | x.chrysamine = get_untyped(j, "chrysamine"); |
| 1033 | 1035 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| @@ -1230,6 +1232,7 @@ namespace quicktype { | ||
| 1230 | 1232 | x.bowgrace = get_untyped(j, "bowgrace"); |
| 1231 | 1233 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1232 | 1234 | x.centaurid = get_untyped(j, "Centaurid"); |
| 1235 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1233 | 1236 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1234 | 1237 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1235 | 1238 | x.flix = get_untyped(j, "flix"); |
| @@ -1380,30 +1383,51 @@ namespace quicktype { | ||
| 1380 | 1383 | |
| 1381 | 1384 | inline void from_json(const json & j, Staghunting& x) { |
| 1382 | 1385 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1386 | + if (j.find("calorimetric") != j.end() && !j.at("calorimetric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1383 | 1387 | x.calorimetric = get_stack_optional<int64_t>(j, "calorimetric"); |
| 1388 | + if (j.find("canid") != j.end() && !j.at("canid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1384 | 1389 | x.canid = get_stack_optional<int64_t>(j, "canid"); |
| 1385 | 1390 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1391 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1386 | 1392 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1387 | 1393 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1394 | + if (j.find("ditriglyphic") != j.end() && !j.at("ditriglyphic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1388 | 1395 | x.ditriglyphic = get_stack_optional<int64_t>(j, "ditriglyphic"); |
| 1396 | + if (j.find("floriferousness") != j.end() && !j.at("floriferousness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1389 | 1397 | x.floriferousness = get_stack_optional<int64_t>(j, "floriferousness"); |
| 1398 | + if (j.find("gamelike") != j.end() && !j.at("gamelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1390 | 1399 | x.gamelike = get_stack_optional<int64_t>(j, "gamelike"); |
| 1400 | + if (j.find("grig") != j.end() && !j.at("grig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1391 | 1401 | x.grig = get_stack_optional<int64_t>(j, "grig"); |
| 1392 | 1402 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1403 | + if (j.find("interloan") != j.end() && !j.at("interloan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1393 | 1404 | x.interloan = get_stack_optional<int64_t>(j, "interloan"); |
| 1405 | + if (j.find("lithotomy") != j.end() && !j.at("lithotomy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1394 | 1406 | x.lithotomy = get_stack_optional<int64_t>(j, "lithotomy"); |
| 1407 | + if (j.find("loric") != j.end() && !j.at("loric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1395 | 1408 | x.loric = get_stack_optional<int64_t>(j, "loric"); |
| 1409 | + if (j.find("membranocoriaceous") != j.end() && !j.at("membranocoriaceous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1396 | 1410 | x.membranocoriaceous = get_stack_optional<int64_t>(j, "membranocoriaceous"); |
| 1411 | + if (j.find("membranogenic") != j.end() && !j.at("membranogenic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1397 | 1412 | x.membranogenic = get_stack_optional<int64_t>(j, "membranogenic"); |
| 1398 | 1413 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1414 | + if (j.find("overtrump") != j.end() && !j.at("overtrump").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1399 | 1415 | x.overtrump = get_stack_optional<int64_t>(j, "overtrump"); |
| 1416 | + if (j.find("scotino") != j.end() && !j.at("scotino").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1400 | 1417 | x.scotino = get_stack_optional<int64_t>(j, "scotino"); |
| 1418 | + if (j.find("seasonable") != j.end() && !j.at("seasonable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1401 | 1419 | x.seasonable = get_stack_optional<int64_t>(j, "seasonable"); |
| 1420 | + if (j.find("sephen") != j.end() && !j.at("sephen").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1402 | 1421 | x.sephen = get_stack_optional<int64_t>(j, "sephen"); |
| 1422 | + if (j.find("stigmarioid") != j.end() && !j.at("stigmarioid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1403 | 1423 | x.stigmarioid = get_stack_optional<int64_t>(j, "stigmarioid"); |
| 1424 | + if (j.find("tired") != j.end() && !j.at("tired").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1404 | 1425 | x.tired = get_stack_optional<int64_t>(j, "tired"); |
| 1426 | + if (j.find("trifid") != j.end() && !j.at("trifid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1405 | 1427 | x.trifid = get_stack_optional<int64_t>(j, "trifid"); |
| 1428 | + if (j.find("undefeatedly") != j.end() && !j.at("undefeatedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1406 | 1429 | x.undefeatedly = get_stack_optional<int64_t>(j, "undefeatedly"); |
| 1430 | + if (j.find("ungirlish") != j.end() && !j.at("ungirlish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1407 | 1431 | x.ungirlish = get_stack_optional<int64_t>(j, "ungirlish"); |
| 1408 | 1432 | } |
| 1409 | 1433 | |
| @@ -1438,30 +1462,51 @@ namespace quicktype { | ||
| 1438 | 1462 | |
| 1439 | 1463 | inline void from_json(const json & j, StrenuosityClass& x) { |
| 1440 | 1464 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1465 | + if (j.find("bliss") != j.end() && !j.at("bliss").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1441 | 1466 | x.bliss = get_stack_optional<int64_t>(j, "bliss"); |
| 1467 | + if (j.find("buccate") != j.end() && !j.at("buccate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1442 | 1468 | x.buccate = get_stack_optional<int64_t>(j, "buccate"); |
| 1469 | + if (j.find("bulletproof") != j.end() && !j.at("bulletproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1443 | 1470 | x.bulletproof = get_stack_optional<int64_t>(j, "bulletproof"); |
| 1444 | 1471 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1472 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1445 | 1473 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1474 | + if (j.find("crumblingness") != j.end() && !j.at("crumblingness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1446 | 1475 | x.crumblingness = get_stack_optional<int64_t>(j, "crumblingness"); |
| 1447 | 1476 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1477 | + if (j.find("engagedly") != j.end() && !j.at("engagedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1448 | 1478 | x.engagedly = get_stack_optional<int64_t>(j, "engagedly"); |
| 1479 | + if (j.find("fightable") != j.end() && !j.at("fightable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1449 | 1480 | x.fightable = get_stack_optional<int64_t>(j, "fightable"); |
| 1481 | + if (j.find("hoariness") != j.end() && !j.at("hoariness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1450 | 1482 | x.hoariness = get_stack_optional<int64_t>(j, "hoariness"); |
| 1451 | 1483 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1484 | + if (j.find("hypopodium") != j.end() && !j.at("hypopodium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1452 | 1485 | x.hypopodium = get_stack_optional<int64_t>(j, "hypopodium"); |
| 1486 | + if (j.find("luxurist") != j.end() && !j.at("luxurist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1453 | 1487 | x.luxurist = get_stack_optional<int64_t>(j, "luxurist"); |
| 1488 | + if (j.find("mechanician") != j.end() && !j.at("mechanician").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1454 | 1489 | x.mechanician = get_stack_optional<int64_t>(j, "mechanician"); |
| 1455 | 1490 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1491 | + if (j.find("Onopordon") != j.end() && !j.at("Onopordon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1456 | 1492 | x.onopordon = get_stack_optional<int64_t>(j, "Onopordon"); |
| 1493 | + if (j.find("podgily") != j.end() && !j.at("podgily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1457 | 1494 | x.podgily = get_stack_optional<int64_t>(j, "podgily"); |
| 1495 | + if (j.find("reformableness") != j.end() && !j.at("reformableness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1458 | 1496 | x.reformableness = get_stack_optional<int64_t>(j, "reformableness"); |
| 1497 | + if (j.find("scatterbrains") != j.end() && !j.at("scatterbrains").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1459 | 1498 | x.scatterbrains = get_stack_optional<int64_t>(j, "scatterbrains"); |
| 1499 | + if (j.find("seminuria") != j.end() && !j.at("seminuria").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1460 | 1500 | x.seminuria = get_stack_optional<int64_t>(j, "seminuria"); |
| 1501 | + if (j.find("Sodomite") != j.end() && !j.at("Sodomite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1461 | 1502 | x.sodomite = get_stack_optional<int64_t>(j, "Sodomite"); |
| 1503 | + if (j.find("tramp") != j.end() && !j.at("tramp").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1462 | 1504 | x.tramp = get_stack_optional<int64_t>(j, "tramp"); |
| 1505 | + if (j.find("undueness") != j.end() && !j.at("undueness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1463 | 1506 | x.undueness = get_stack_optional<int64_t>(j, "undueness"); |
| 1507 | + if (j.find("worthily") != j.end() && !j.at("worthily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1464 | 1508 | x.worthily = get_stack_optional<int64_t>(j, "worthily"); |
| 1509 | + if (j.find("Yankeeist") != j.end() && !j.at("Yankeeist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1465 | 1510 | x.yankeeist = get_stack_optional<int64_t>(j, "Yankeeist"); |
| 1466 | 1511 | } |
| 1467 | 1512 | |
| @@ -1501,6 +1546,7 @@ namespace quicktype { | ||
| 1501 | 1546 | x.bungey = get_untyped(j, "bungey"); |
| 1502 | 1547 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1503 | 1548 | x.ceroxyle = get_untyped(j, "ceroxyle"); |
| 1549 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1504 | 1550 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1505 | 1551 | x.chorology = get_untyped(j, "chorology"); |
| 1506 | 1552 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| @@ -1554,30 +1600,51 @@ namespace quicktype { | ||
| 1554 | 1600 | |
| 1555 | 1601 | inline void from_json(const json & j, UnimpeachablyClass& x) { |
| 1556 | 1602 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1603 | + if (j.find("acerin") != j.end() && !j.at("acerin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1557 | 1604 | x.acerin = get_stack_optional<int64_t>(j, "acerin"); |
| 1605 | + if (j.find("Bobadil") != j.end() && !j.at("Bobadil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1558 | 1606 | x.bobadil = get_stack_optional<int64_t>(j, "Bobadil"); |
| 1559 | 1607 | x.catharticalness = get_stack_optional<double>(j, "catharticalness"); |
| 1608 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1560 | 1609 | x.chirotherium = get_stack_optional<int64_t>(j, "Chirotherium"); |
| 1610 | + if (j.find("chlorophylligenous") != j.end() && !j.at("chlorophylligenous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1561 | 1611 | x.chlorophylligenous = get_stack_optional<int64_t>(j, "chlorophylligenous"); |
| 1612 | + if (j.find("conversational") != j.end() && !j.at("conversational").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1562 | 1613 | x.conversational = get_stack_optional<int64_t>(j, "conversational"); |
| 1614 | + if (j.find("demiowl") != j.end() && !j.at("demiowl").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1563 | 1615 | x.demiowl = get_stack_optional<int64_t>(j, "demiowl"); |
| 1564 | 1616 | x.disdiapason = get_stack_optional<std::string>(j, "disdiapason"); |
| 1617 | + if (j.find("ectorhinal") != j.end() && !j.at("ectorhinal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1565 | 1618 | x.ectorhinal = get_stack_optional<int64_t>(j, "ectorhinal"); |
| 1619 | + if (j.find("gamblesomeness") != j.end() && !j.at("gamblesomeness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1566 | 1620 | x.gamblesomeness = get_stack_optional<int64_t>(j, "gamblesomeness"); |
| 1567 | 1621 | x.homocerc = get_stack_optional<bool>(j, "homocerc"); |
| 1622 | + if (j.find("irrorate") != j.end() && !j.at("irrorate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1568 | 1623 | x.irrorate = get_stack_optional<int64_t>(j, "irrorate"); |
| 1624 | + if (j.find("kindergartening") != j.end() && !j.at("kindergartening").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1569 | 1625 | x.kindergartening = get_stack_optional<int64_t>(j, "kindergartening"); |
| 1626 | + if (j.find("lateritic") != j.end() && !j.at("lateritic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1570 | 1627 | x.lateritic = get_stack_optional<int64_t>(j, "lateritic"); |
| 1628 | + if (j.find("mespil") != j.end() && !j.at("mespil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1571 | 1629 | x.mespil = get_stack_optional<int64_t>(j, "mespil"); |
| 1630 | + if (j.find("misconfiguration") != j.end() && !j.at("misconfiguration").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1572 | 1631 | x.misconfiguration = get_stack_optional<int64_t>(j, "misconfiguration"); |
| 1573 | 1632 | x.nonbookish = get_untyped(j, "nonbookish"); |
| 1633 | + if (j.find("planometry") != j.end() && !j.at("planometry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1574 | 1634 | x.planometry = get_stack_optional<int64_t>(j, "planometry"); |
| 1635 | + if (j.find("Quiina") != j.end() && !j.at("Quiina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1575 | 1636 | x.quiina = get_stack_optional<int64_t>(j, "Quiina"); |
| 1637 | + if (j.find("Robert") != j.end() && !j.at("Robert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1576 | 1638 | x.robert = get_stack_optional<int64_t>(j, "Robert"); |
| 1639 | + if (j.find("rot") != j.end() && !j.at("rot").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1577 | 1640 | x.rot = get_stack_optional<int64_t>(j, "rot"); |
| 1641 | + if (j.find("subcinctorium") != j.end() && !j.at("subcinctorium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1578 | 1642 | x.subcinctorium = get_stack_optional<int64_t>(j, "subcinctorium"); |
| 1643 | + if (j.find("tussocker") != j.end() && !j.at("tussocker").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1579 | 1644 | x.tussocker = get_stack_optional<int64_t>(j, "tussocker"); |
| 1645 | + if (j.find("ultraproud") != j.end() && !j.at("ultraproud").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1580 | 1646 | x.ultraproud = get_stack_optional<int64_t>(j, "ultraproud"); |
| 1647 | + if (j.find("unsuggestedness") != j.end() && !j.at("unsuggestedness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1581 | 1648 | x.unsuggestedness = get_stack_optional<int64_t>(j, "unsuggestedness"); |
| 1582 | 1649 | } |
Mcplusplusconst-style-east-const--0048a2a7a881 / quicktype.hpp+67 −0
| @@ -2661,6 +2661,7 @@ namespace quicktype { | ||
| 2661 | 2661 | inline void from_json(json const & j, QuebrachineClass& x) { |
| 2662 | 2662 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2663 | 2663 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2664 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2664 | 2665 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2665 | 2666 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2666 | 2667 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2682,6 +2683,7 @@ namespace quicktype { | ||
| 2682 | 2683 | x.set_anabolin(get_untyped(j, "anabolin")); |
| 2683 | 2684 | x.set_brainy(get_untyped(j, "brainy")); |
| 2684 | 2685 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2686 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2685 | 2687 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2686 | 2688 | x.set_chrysamine(get_untyped(j, "chrysamine")); |
| 2687 | 2689 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -2884,6 +2886,7 @@ namespace quicktype { | ||
| 2884 | 2886 | x.set_bowgrace(get_untyped(j, "bowgrace")); |
| 2885 | 2887 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2886 | 2888 | x.set_centaurid(get_untyped(j, "Centaurid")); |
| 2889 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2887 | 2890 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2888 | 2891 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2889 | 2892 | x.set_flix(get_untyped(j, "flix")); |
| @@ -3034,30 +3037,51 @@ namespace quicktype { | ||
| 3034 | 3037 | |
| 3035 | 3038 | inline void from_json(json const & j, Staghunting& x) { |
| 3036 | 3039 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3040 | + if (j.find("calorimetric") != j.end() && !j.at("calorimetric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3037 | 3041 | x.set_calorimetric(get_stack_optional<int64_t>(j, "calorimetric")); |
| 3042 | + if (j.find("canid") != j.end() && !j.at("canid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3038 | 3043 | x.set_canid(get_stack_optional<int64_t>(j, "canid")); |
| 3039 | 3044 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3045 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3040 | 3046 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3041 | 3047 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3048 | + if (j.find("ditriglyphic") != j.end() && !j.at("ditriglyphic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3042 | 3049 | x.set_ditriglyphic(get_stack_optional<int64_t>(j, "ditriglyphic")); |
| 3050 | + if (j.find("floriferousness") != j.end() && !j.at("floriferousness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3043 | 3051 | x.set_floriferousness(get_stack_optional<int64_t>(j, "floriferousness")); |
| 3052 | + if (j.find("gamelike") != j.end() && !j.at("gamelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3044 | 3053 | x.set_gamelike(get_stack_optional<int64_t>(j, "gamelike")); |
| 3054 | + if (j.find("grig") != j.end() && !j.at("grig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3045 | 3055 | x.set_grig(get_stack_optional<int64_t>(j, "grig")); |
| 3046 | 3056 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3057 | + if (j.find("interloan") != j.end() && !j.at("interloan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3047 | 3058 | x.set_interloan(get_stack_optional<int64_t>(j, "interloan")); |
| 3059 | + if (j.find("lithotomy") != j.end() && !j.at("lithotomy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3048 | 3060 | x.set_lithotomy(get_stack_optional<int64_t>(j, "lithotomy")); |
| 3061 | + if (j.find("loric") != j.end() && !j.at("loric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3049 | 3062 | x.set_loric(get_stack_optional<int64_t>(j, "loric")); |
| 3063 | + if (j.find("membranocoriaceous") != j.end() && !j.at("membranocoriaceous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3050 | 3064 | x.set_membranocoriaceous(get_stack_optional<int64_t>(j, "membranocoriaceous")); |
| 3065 | + if (j.find("membranogenic") != j.end() && !j.at("membranogenic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3051 | 3066 | x.set_membranogenic(get_stack_optional<int64_t>(j, "membranogenic")); |
| 3052 | 3067 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3068 | + if (j.find("overtrump") != j.end() && !j.at("overtrump").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3053 | 3069 | x.set_overtrump(get_stack_optional<int64_t>(j, "overtrump")); |
| 3070 | + if (j.find("scotino") != j.end() && !j.at("scotino").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3054 | 3071 | x.set_scotino(get_stack_optional<int64_t>(j, "scotino")); |
| 3072 | + if (j.find("seasonable") != j.end() && !j.at("seasonable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3055 | 3073 | x.set_seasonable(get_stack_optional<int64_t>(j, "seasonable")); |
| 3074 | + if (j.find("sephen") != j.end() && !j.at("sephen").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3056 | 3075 | x.set_sephen(get_stack_optional<int64_t>(j, "sephen")); |
| 3076 | + if (j.find("stigmarioid") != j.end() && !j.at("stigmarioid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3057 | 3077 | x.set_stigmarioid(get_stack_optional<int64_t>(j, "stigmarioid")); |
| 3078 | + if (j.find("tired") != j.end() && !j.at("tired").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3058 | 3079 | x.set_tired(get_stack_optional<int64_t>(j, "tired")); |
| 3080 | + if (j.find("trifid") != j.end() && !j.at("trifid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3059 | 3081 | x.set_trifid(get_stack_optional<int64_t>(j, "trifid")); |
| 3082 | + if (j.find("undefeatedly") != j.end() && !j.at("undefeatedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3060 | 3083 | x.set_undefeatedly(get_stack_optional<int64_t>(j, "undefeatedly")); |
| 3084 | + if (j.find("ungirlish") != j.end() && !j.at("ungirlish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3061 | 3085 | x.set_ungirlish(get_stack_optional<int64_t>(j, "ungirlish")); |
| 3062 | 3086 | } |
| 3063 | 3087 | |
| @@ -3092,30 +3116,51 @@ namespace quicktype { | ||
| 3092 | 3116 | |
| 3093 | 3117 | inline void from_json(json const & j, StrenuosityClass& x) { |
| 3094 | 3118 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3119 | + if (j.find("bliss") != j.end() && !j.at("bliss").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3095 | 3120 | x.set_bliss(get_stack_optional<int64_t>(j, "bliss")); |
| 3121 | + if (j.find("buccate") != j.end() && !j.at("buccate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3096 | 3122 | x.set_buccate(get_stack_optional<int64_t>(j, "buccate")); |
| 3123 | + if (j.find("bulletproof") != j.end() && !j.at("bulletproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3097 | 3124 | x.set_bulletproof(get_stack_optional<int64_t>(j, "bulletproof")); |
| 3098 | 3125 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3126 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3099 | 3127 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3128 | + if (j.find("crumblingness") != j.end() && !j.at("crumblingness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3100 | 3129 | x.set_crumblingness(get_stack_optional<int64_t>(j, "crumblingness")); |
| 3101 | 3130 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3131 | + if (j.find("engagedly") != j.end() && !j.at("engagedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3102 | 3132 | x.set_engagedly(get_stack_optional<int64_t>(j, "engagedly")); |
| 3133 | + if (j.find("fightable") != j.end() && !j.at("fightable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3103 | 3134 | x.set_fightable(get_stack_optional<int64_t>(j, "fightable")); |
| 3135 | + if (j.find("hoariness") != j.end() && !j.at("hoariness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3104 | 3136 | x.set_hoariness(get_stack_optional<int64_t>(j, "hoariness")); |
| 3105 | 3137 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3138 | + if (j.find("hypopodium") != j.end() && !j.at("hypopodium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3106 | 3139 | x.set_hypopodium(get_stack_optional<int64_t>(j, "hypopodium")); |
| 3140 | + if (j.find("luxurist") != j.end() && !j.at("luxurist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3107 | 3141 | x.set_luxurist(get_stack_optional<int64_t>(j, "luxurist")); |
| 3142 | + if (j.find("mechanician") != j.end() && !j.at("mechanician").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3108 | 3143 | x.set_mechanician(get_stack_optional<int64_t>(j, "mechanician")); |
| 3109 | 3144 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3145 | + if (j.find("Onopordon") != j.end() && !j.at("Onopordon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3110 | 3146 | x.set_onopordon(get_stack_optional<int64_t>(j, "Onopordon")); |
| 3147 | + if (j.find("podgily") != j.end() && !j.at("podgily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3111 | 3148 | x.set_podgily(get_stack_optional<int64_t>(j, "podgily")); |
| 3149 | + if (j.find("reformableness") != j.end() && !j.at("reformableness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3112 | 3150 | x.set_reformableness(get_stack_optional<int64_t>(j, "reformableness")); |
| 3151 | + if (j.find("scatterbrains") != j.end() && !j.at("scatterbrains").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3113 | 3152 | x.set_scatterbrains(get_stack_optional<int64_t>(j, "scatterbrains")); |
| 3153 | + if (j.find("seminuria") != j.end() && !j.at("seminuria").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3114 | 3154 | x.set_seminuria(get_stack_optional<int64_t>(j, "seminuria")); |
| 3155 | + if (j.find("Sodomite") != j.end() && !j.at("Sodomite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3115 | 3156 | x.set_sodomite(get_stack_optional<int64_t>(j, "Sodomite")); |
| 3157 | + if (j.find("tramp") != j.end() && !j.at("tramp").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3116 | 3158 | x.set_tramp(get_stack_optional<int64_t>(j, "tramp")); |
| 3159 | + if (j.find("undueness") != j.end() && !j.at("undueness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3117 | 3160 | x.set_undueness(get_stack_optional<int64_t>(j, "undueness")); |
| 3161 | + if (j.find("worthily") != j.end() && !j.at("worthily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3118 | 3162 | x.set_worthily(get_stack_optional<int64_t>(j, "worthily")); |
| 3163 | + if (j.find("Yankeeist") != j.end() && !j.at("Yankeeist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3119 | 3164 | x.set_yankeeist(get_stack_optional<int64_t>(j, "Yankeeist")); |
| 3120 | 3165 | } |
| 3121 | 3166 | |
| @@ -3155,6 +3200,7 @@ namespace quicktype { | ||
| 3155 | 3200 | x.set_bungey(get_untyped(j, "bungey")); |
| 3156 | 3201 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3157 | 3202 | x.set_ceroxyle(get_untyped(j, "ceroxyle")); |
| 3203 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3158 | 3204 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3159 | 3205 | x.set_chorology(get_untyped(j, "chorology")); |
| 3160 | 3206 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -3208,30 +3254,51 @@ namespace quicktype { | ||
| 3208 | 3254 | |
| 3209 | 3255 | inline void from_json(json const & j, UnimpeachablyClass& x) { |
| 3210 | 3256 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3257 | + if (j.find("acerin") != j.end() && !j.at("acerin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3211 | 3258 | x.set_acerin(get_stack_optional<int64_t>(j, "acerin")); |
| 3259 | + if (j.find("Bobadil") != j.end() && !j.at("Bobadil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3212 | 3260 | x.set_bobadil(get_stack_optional<int64_t>(j, "Bobadil")); |
| 3213 | 3261 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3262 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3214 | 3263 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3264 | + if (j.find("chlorophylligenous") != j.end() && !j.at("chlorophylligenous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3215 | 3265 | x.set_chlorophylligenous(get_stack_optional<int64_t>(j, "chlorophylligenous")); |
| 3266 | + if (j.find("conversational") != j.end() && !j.at("conversational").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3216 | 3267 | x.set_conversational(get_stack_optional<int64_t>(j, "conversational")); |
| 3268 | + if (j.find("demiowl") != j.end() && !j.at("demiowl").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3217 | 3269 | x.set_demiowl(get_stack_optional<int64_t>(j, "demiowl")); |
| 3218 | 3270 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3271 | + if (j.find("ectorhinal") != j.end() && !j.at("ectorhinal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3219 | 3272 | x.set_ectorhinal(get_stack_optional<int64_t>(j, "ectorhinal")); |
| 3273 | + if (j.find("gamblesomeness") != j.end() && !j.at("gamblesomeness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3220 | 3274 | x.set_gamblesomeness(get_stack_optional<int64_t>(j, "gamblesomeness")); |
| 3221 | 3275 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3276 | + if (j.find("irrorate") != j.end() && !j.at("irrorate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3222 | 3277 | x.set_irrorate(get_stack_optional<int64_t>(j, "irrorate")); |
| 3278 | + if (j.find("kindergartening") != j.end() && !j.at("kindergartening").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3223 | 3279 | x.set_kindergartening(get_stack_optional<int64_t>(j, "kindergartening")); |
| 3280 | + if (j.find("lateritic") != j.end() && !j.at("lateritic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3224 | 3281 | x.set_lateritic(get_stack_optional<int64_t>(j, "lateritic")); |
| 3282 | + if (j.find("mespil") != j.end() && !j.at("mespil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3225 | 3283 | x.set_mespil(get_stack_optional<int64_t>(j, "mespil")); |
| 3284 | + if (j.find("misconfiguration") != j.end() && !j.at("misconfiguration").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3226 | 3285 | x.set_misconfiguration(get_stack_optional<int64_t>(j, "misconfiguration")); |
| 3227 | 3286 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3287 | + if (j.find("planometry") != j.end() && !j.at("planometry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3228 | 3288 | x.set_planometry(get_stack_optional<int64_t>(j, "planometry")); |
| 3289 | + if (j.find("Quiina") != j.end() && !j.at("Quiina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3229 | 3290 | x.set_quiina(get_stack_optional<int64_t>(j, "Quiina")); |
| 3291 | + if (j.find("Robert") != j.end() && !j.at("Robert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3230 | 3292 | x.set_robert(get_stack_optional<int64_t>(j, "Robert")); |
| 3293 | + if (j.find("rot") != j.end() && !j.at("rot").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3231 | 3294 | x.set_rot(get_stack_optional<int64_t>(j, "rot")); |
| 3295 | + if (j.find("subcinctorium") != j.end() && !j.at("subcinctorium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3232 | 3296 | x.set_subcinctorium(get_stack_optional<int64_t>(j, "subcinctorium")); |
| 3297 | + if (j.find("tussocker") != j.end() && !j.at("tussocker").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3233 | 3298 | x.set_tussocker(get_stack_optional<int64_t>(j, "tussocker")); |
| 3299 | + if (j.find("ultraproud") != j.end() && !j.at("ultraproud").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3234 | 3300 | x.set_ultraproud(get_stack_optional<int64_t>(j, "ultraproud")); |
| 3301 | + if (j.find("unsuggestedness") != j.end() && !j.at("unsuggestedness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3235 | 3302 | x.set_unsuggestedness(get_stack_optional<int64_t>(j, "unsuggestedness")); |
| 3236 | 3303 | } |
Mcplusplusdefault / quicktype.hpp+67 −0
| @@ -2661,6 +2661,7 @@ namespace quicktype { | ||
| 2661 | 2661 | inline void from_json(const json & j, QuebrachineClass& x) { |
| 2662 | 2662 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2663 | 2663 | x.set_catharticalness(j.at("catharticalness").get<double>()); |
| 2664 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2664 | 2665 | x.set_chirotherium(j.at("Chirotherium").get<int64_t>()); |
| 2665 | 2666 | x.set_disdiapason(j.at("disdiapason").get<std::string>()); |
| 2666 | 2667 | x.set_homocerc(j.at("homocerc").get<bool>()); |
| @@ -2682,6 +2683,7 @@ namespace quicktype { | ||
| 2682 | 2683 | x.set_anabolin(get_untyped(j, "anabolin")); |
| 2683 | 2684 | x.set_brainy(get_untyped(j, "brainy")); |
| 2684 | 2685 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2686 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2685 | 2687 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2686 | 2688 | x.set_chrysamine(get_untyped(j, "chrysamine")); |
| 2687 | 2689 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -2884,6 +2886,7 @@ namespace quicktype { | ||
| 2884 | 2886 | x.set_bowgrace(get_untyped(j, "bowgrace")); |
| 2885 | 2887 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 2886 | 2888 | x.set_centaurid(get_untyped(j, "Centaurid")); |
| 2889 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2887 | 2890 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 2888 | 2891 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 2889 | 2892 | x.set_flix(get_untyped(j, "flix")); |
| @@ -3034,30 +3037,51 @@ namespace quicktype { | ||
| 3034 | 3037 | |
| 3035 | 3038 | inline void from_json(const json & j, Staghunting& x) { |
| 3036 | 3039 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3040 | + if (j.find("calorimetric") != j.end() && !j.at("calorimetric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3037 | 3041 | x.set_calorimetric(get_stack_optional<int64_t>(j, "calorimetric")); |
| 3042 | + if (j.find("canid") != j.end() && !j.at("canid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3038 | 3043 | x.set_canid(get_stack_optional<int64_t>(j, "canid")); |
| 3039 | 3044 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3045 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3040 | 3046 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3041 | 3047 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3048 | + if (j.find("ditriglyphic") != j.end() && !j.at("ditriglyphic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3042 | 3049 | x.set_ditriglyphic(get_stack_optional<int64_t>(j, "ditriglyphic")); |
| 3050 | + if (j.find("floriferousness") != j.end() && !j.at("floriferousness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3043 | 3051 | x.set_floriferousness(get_stack_optional<int64_t>(j, "floriferousness")); |
| 3052 | + if (j.find("gamelike") != j.end() && !j.at("gamelike").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3044 | 3053 | x.set_gamelike(get_stack_optional<int64_t>(j, "gamelike")); |
| 3054 | + if (j.find("grig") != j.end() && !j.at("grig").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3045 | 3055 | x.set_grig(get_stack_optional<int64_t>(j, "grig")); |
| 3046 | 3056 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3057 | + if (j.find("interloan") != j.end() && !j.at("interloan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3047 | 3058 | x.set_interloan(get_stack_optional<int64_t>(j, "interloan")); |
| 3059 | + if (j.find("lithotomy") != j.end() && !j.at("lithotomy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3048 | 3060 | x.set_lithotomy(get_stack_optional<int64_t>(j, "lithotomy")); |
| 3061 | + if (j.find("loric") != j.end() && !j.at("loric").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3049 | 3062 | x.set_loric(get_stack_optional<int64_t>(j, "loric")); |
| 3063 | + if (j.find("membranocoriaceous") != j.end() && !j.at("membranocoriaceous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3050 | 3064 | x.set_membranocoriaceous(get_stack_optional<int64_t>(j, "membranocoriaceous")); |
| 3065 | + if (j.find("membranogenic") != j.end() && !j.at("membranogenic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3051 | 3066 | x.set_membranogenic(get_stack_optional<int64_t>(j, "membranogenic")); |
| 3052 | 3067 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3068 | + if (j.find("overtrump") != j.end() && !j.at("overtrump").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3053 | 3069 | x.set_overtrump(get_stack_optional<int64_t>(j, "overtrump")); |
| 3070 | + if (j.find("scotino") != j.end() && !j.at("scotino").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3054 | 3071 | x.set_scotino(get_stack_optional<int64_t>(j, "scotino")); |
| 3072 | + if (j.find("seasonable") != j.end() && !j.at("seasonable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3055 | 3073 | x.set_seasonable(get_stack_optional<int64_t>(j, "seasonable")); |
| 3074 | + if (j.find("sephen") != j.end() && !j.at("sephen").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3056 | 3075 | x.set_sephen(get_stack_optional<int64_t>(j, "sephen")); |
| 3076 | + if (j.find("stigmarioid") != j.end() && !j.at("stigmarioid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3057 | 3077 | x.set_stigmarioid(get_stack_optional<int64_t>(j, "stigmarioid")); |
| 3078 | + if (j.find("tired") != j.end() && !j.at("tired").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3058 | 3079 | x.set_tired(get_stack_optional<int64_t>(j, "tired")); |
| 3080 | + if (j.find("trifid") != j.end() && !j.at("trifid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3059 | 3081 | x.set_trifid(get_stack_optional<int64_t>(j, "trifid")); |
| 3082 | + if (j.find("undefeatedly") != j.end() && !j.at("undefeatedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3060 | 3083 | x.set_undefeatedly(get_stack_optional<int64_t>(j, "undefeatedly")); |
| 3084 | + if (j.find("ungirlish") != j.end() && !j.at("ungirlish").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3061 | 3085 | x.set_ungirlish(get_stack_optional<int64_t>(j, "ungirlish")); |
| 3062 | 3086 | } |
| 3063 | 3087 | |
| @@ -3092,30 +3116,51 @@ namespace quicktype { | ||
| 3092 | 3116 | |
| 3093 | 3117 | inline void from_json(const json & j, StrenuosityClass& x) { |
| 3094 | 3118 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3119 | + if (j.find("bliss") != j.end() && !j.at("bliss").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3095 | 3120 | x.set_bliss(get_stack_optional<int64_t>(j, "bliss")); |
| 3121 | + if (j.find("buccate") != j.end() && !j.at("buccate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3096 | 3122 | x.set_buccate(get_stack_optional<int64_t>(j, "buccate")); |
| 3123 | + if (j.find("bulletproof") != j.end() && !j.at("bulletproof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3097 | 3124 | x.set_bulletproof(get_stack_optional<int64_t>(j, "bulletproof")); |
| 3098 | 3125 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3126 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3099 | 3127 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3128 | + if (j.find("crumblingness") != j.end() && !j.at("crumblingness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3100 | 3129 | x.set_crumblingness(get_stack_optional<int64_t>(j, "crumblingness")); |
| 3101 | 3130 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3131 | + if (j.find("engagedly") != j.end() && !j.at("engagedly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3102 | 3132 | x.set_engagedly(get_stack_optional<int64_t>(j, "engagedly")); |
| 3133 | + if (j.find("fightable") != j.end() && !j.at("fightable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3103 | 3134 | x.set_fightable(get_stack_optional<int64_t>(j, "fightable")); |
| 3135 | + if (j.find("hoariness") != j.end() && !j.at("hoariness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3104 | 3136 | x.set_hoariness(get_stack_optional<int64_t>(j, "hoariness")); |
| 3105 | 3137 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3138 | + if (j.find("hypopodium") != j.end() && !j.at("hypopodium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3106 | 3139 | x.set_hypopodium(get_stack_optional<int64_t>(j, "hypopodium")); |
| 3140 | + if (j.find("luxurist") != j.end() && !j.at("luxurist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3107 | 3141 | x.set_luxurist(get_stack_optional<int64_t>(j, "luxurist")); |
| 3142 | + if (j.find("mechanician") != j.end() && !j.at("mechanician").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3108 | 3143 | x.set_mechanician(get_stack_optional<int64_t>(j, "mechanician")); |
| 3109 | 3144 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3145 | + if (j.find("Onopordon") != j.end() && !j.at("Onopordon").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3110 | 3146 | x.set_onopordon(get_stack_optional<int64_t>(j, "Onopordon")); |
| 3147 | + if (j.find("podgily") != j.end() && !j.at("podgily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3111 | 3148 | x.set_podgily(get_stack_optional<int64_t>(j, "podgily")); |
| 3149 | + if (j.find("reformableness") != j.end() && !j.at("reformableness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3112 | 3150 | x.set_reformableness(get_stack_optional<int64_t>(j, "reformableness")); |
| 3151 | + if (j.find("scatterbrains") != j.end() && !j.at("scatterbrains").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3113 | 3152 | x.set_scatterbrains(get_stack_optional<int64_t>(j, "scatterbrains")); |
| 3153 | + if (j.find("seminuria") != j.end() && !j.at("seminuria").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3114 | 3154 | x.set_seminuria(get_stack_optional<int64_t>(j, "seminuria")); |
| 3155 | + if (j.find("Sodomite") != j.end() && !j.at("Sodomite").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3115 | 3156 | x.set_sodomite(get_stack_optional<int64_t>(j, "Sodomite")); |
| 3157 | + if (j.find("tramp") != j.end() && !j.at("tramp").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3116 | 3158 | x.set_tramp(get_stack_optional<int64_t>(j, "tramp")); |
| 3159 | + if (j.find("undueness") != j.end() && !j.at("undueness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3117 | 3160 | x.set_undueness(get_stack_optional<int64_t>(j, "undueness")); |
| 3161 | + if (j.find("worthily") != j.end() && !j.at("worthily").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3118 | 3162 | x.set_worthily(get_stack_optional<int64_t>(j, "worthily")); |
| 3163 | + if (j.find("Yankeeist") != j.end() && !j.at("Yankeeist").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3119 | 3164 | x.set_yankeeist(get_stack_optional<int64_t>(j, "Yankeeist")); |
| 3120 | 3165 | } |
| 3121 | 3166 | |
| @@ -3155,6 +3200,7 @@ namespace quicktype { | ||
| 3155 | 3200 | x.set_bungey(get_untyped(j, "bungey")); |
| 3156 | 3201 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3157 | 3202 | x.set_ceroxyle(get_untyped(j, "ceroxyle")); |
| 3203 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3158 | 3204 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3159 | 3205 | x.set_chorology(get_untyped(j, "chorology")); |
| 3160 | 3206 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| @@ -3208,30 +3254,51 @@ namespace quicktype { | ||
| 3208 | 3254 | |
| 3209 | 3255 | inline void from_json(const json & j, UnimpeachablyClass& x) { |
| 3210 | 3256 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 3257 | + if (j.find("acerin") != j.end() && !j.at("acerin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3211 | 3258 | x.set_acerin(get_stack_optional<int64_t>(j, "acerin")); |
| 3259 | + if (j.find("Bobadil") != j.end() && !j.at("Bobadil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3212 | 3260 | x.set_bobadil(get_stack_optional<int64_t>(j, "Bobadil")); |
| 3213 | 3261 | x.set_catharticalness(get_stack_optional<double>(j, "catharticalness")); |
| 3262 | + if (j.find("Chirotherium") != j.end() && !j.at("Chirotherium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3214 | 3263 | x.set_chirotherium(get_stack_optional<int64_t>(j, "Chirotherium")); |
| 3264 | + if (j.find("chlorophylligenous") != j.end() && !j.at("chlorophylligenous").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3215 | 3265 | x.set_chlorophylligenous(get_stack_optional<int64_t>(j, "chlorophylligenous")); |
| 3266 | + if (j.find("conversational") != j.end() && !j.at("conversational").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3216 | 3267 | x.set_conversational(get_stack_optional<int64_t>(j, "conversational")); |
| 3268 | + if (j.find("demiowl") != j.end() && !j.at("demiowl").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3217 | 3269 | x.set_demiowl(get_stack_optional<int64_t>(j, "demiowl")); |
| 3218 | 3270 | x.set_disdiapason(get_stack_optional<std::string>(j, "disdiapason")); |
| 3271 | + if (j.find("ectorhinal") != j.end() && !j.at("ectorhinal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3219 | 3272 | x.set_ectorhinal(get_stack_optional<int64_t>(j, "ectorhinal")); |
| 3273 | + if (j.find("gamblesomeness") != j.end() && !j.at("gamblesomeness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3220 | 3274 | x.set_gamblesomeness(get_stack_optional<int64_t>(j, "gamblesomeness")); |
| 3221 | 3275 | x.set_homocerc(get_stack_optional<bool>(j, "homocerc")); |
| 3276 | + if (j.find("irrorate") != j.end() && !j.at("irrorate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3222 | 3277 | x.set_irrorate(get_stack_optional<int64_t>(j, "irrorate")); |
| 3278 | + if (j.find("kindergartening") != j.end() && !j.at("kindergartening").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3223 | 3279 | x.set_kindergartening(get_stack_optional<int64_t>(j, "kindergartening")); |
| 3280 | + if (j.find("lateritic") != j.end() && !j.at("lateritic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3224 | 3281 | x.set_lateritic(get_stack_optional<int64_t>(j, "lateritic")); |
| 3282 | + if (j.find("mespil") != j.end() && !j.at("mespil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3225 | 3283 | x.set_mespil(get_stack_optional<int64_t>(j, "mespil")); |
| 3284 | + if (j.find("misconfiguration") != j.end() && !j.at("misconfiguration").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3226 | 3285 | x.set_misconfiguration(get_stack_optional<int64_t>(j, "misconfiguration")); |
| 3227 | 3286 | x.set_nonbookish(get_untyped(j, "nonbookish")); |
| 3287 | + if (j.find("planometry") != j.end() && !j.at("planometry").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3228 | 3288 | x.set_planometry(get_stack_optional<int64_t>(j, "planometry")); |
| 3289 | + if (j.find("Quiina") != j.end() && !j.at("Quiina").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3229 | 3290 | x.set_quiina(get_stack_optional<int64_t>(j, "Quiina")); |
| 3291 | + if (j.find("Robert") != j.end() && !j.at("Robert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3230 | 3292 | x.set_robert(get_stack_optional<int64_t>(j, "Robert")); |
| 3293 | + if (j.find("rot") != j.end() && !j.at("rot").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3231 | 3294 | x.set_rot(get_stack_optional<int64_t>(j, "rot")); |
| 3295 | + if (j.find("subcinctorium") != j.end() && !j.at("subcinctorium").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3232 | 3296 | x.set_subcinctorium(get_stack_optional<int64_t>(j, "subcinctorium")); |
| 3297 | + if (j.find("tussocker") != j.end() && !j.at("tussocker").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3233 | 3298 | x.set_tussocker(get_stack_optional<int64_t>(j, "tussocker")); |
| 3299 | + if (j.find("ultraproud") != j.end() && !j.at("ultraproud").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3234 | 3300 | x.set_ultraproud(get_stack_optional<int64_t>(j, "ultraproud")); |
| 3301 | + if (j.find("unsuggestedness") != j.end() && !j.at("unsuggestedness").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 3235 | 3302 | x.set_unsuggestedness(get_stack_optional<int64_t>(j, "unsuggestedness")); |
| 3236 | 3303 | } |
Test case
1 generated file · +1 −0test/inputs/json/priority/direct-recursive.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -131,6 +131,7 @@ namespace quicktype { | ||
| 131 | 131 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 132 | 132 | x.set_also(get_heap_optional<TopLevel>(j, "also")); |
| 133 | 133 | x.set_bar(j.at("bar").get<bool>()); |
| 134 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 134 | 135 | x.set_foo(j.at("foo").get<int64_t>()); |
| 135 | 136 | x.set_moo(j.at("moo").get<double>()); |
| 136 | 137 | x.set_quux(j.at("quux").get<std::string>()); |
Test case
1 generated file · +8 −0test/inputs/json/priority/identifiers.json
Mcplusplusdefault / quicktype.hpp+8 −0
| @@ -190,6 +190,7 @@ namespace quicktype { | ||
| 190 | 190 | |
| 191 | 191 | inline void from_json(const json & j, TopLevelBla& x) { |
| 192 | 192 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 193 | + if (j.find("bar") != j.end() && !j.at("bar").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 193 | 194 | x.set_bar(j.at("bar").get<int64_t>()); |
| 194 | 195 | } |
| 195 | 196 | |
| @@ -200,6 +201,7 @@ namespace quicktype { | ||
| 200 | 201 | |
| 201 | 202 | inline void from_json(const json & j, Empty& x) { |
| 202 | 203 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 204 | + if (j.find("x") != j.end() && !j.at("x").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 203 | 205 | x.set_x(j.at("x").get<int64_t>()); |
| 204 | 206 | } |
| 205 | 207 | |
| @@ -222,7 +224,9 @@ namespace quicktype { | ||
| 222 | 224 | inline void from_json(const json & j, Foo& x) { |
| 223 | 225 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 224 | 226 | x.set_bla(j.at("bla").get<FooBla>()); |
| 227 | + if (j.find("_") != j.end() && !j.at("_").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 225 | 228 | x.set_empty(j.at("_").get<int64_t>()); |
| 229 | + if (j.find("__") != j.end() && !j.at("__").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 226 | 230 | x.set_foo(j.at("__").get<int64_t>()); |
| 227 | 231 | } |
| 228 | 232 | |
| @@ -235,7 +239,9 @@ namespace quicktype { | ||
| 235 | 239 | |
| 236 | 240 | inline void from_json(const json & j, ThisIsAToughOne& x) { |
| 237 | 241 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 242 | + if (j.find("\n\n\n") != j.end() && !j.at("\n\n\n").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 243 | x.set_empty(j.at("\n\n\n").get<int64_t>()); |
| 244 | + if (j.find("\"") != j.end() && !j.at("\"").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 245 | x.set_this_is_a_tough_one(j.at("\"").get<int64_t>()); |
| 240 | 246 | } |
| 241 | 247 | |
| @@ -247,6 +253,7 @@ namespace quicktype { | ||
| 247 | 253 | |
| 248 | 254 | inline void from_json(const json & j, EmptyClass& x) { |
| 249 | 255 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 256 | + if (j.find("y") != j.end() && !j.at("y").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 250 | 257 | x.set_y(j.at("y").get<int64_t>()); |
| 251 | 258 | } |
| 252 | 259 | |
| @@ -261,6 +268,7 @@ namespace quicktype { | ||
| 261 | 268 | x.set_empty(j.at("").get<Empty>()); |
| 262 | 269 | x.set_foo(j.at("foo").get<Foo>()); |
| 263 | 270 | x.set_this_is_a_tough_one(j.at("ThisIsA\U0001f61cTough\"\n\nOne").get<ThisIsAToughOne>()); |
| 271 | + if (j.find("!") != j.end() && !j.at("!").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 264 | 272 | x.set_top_level(j.at("!").get<int64_t>()); |
| 265 | 273 | x.set_top_level_empty(j.at("Empty").get<EmptyClass>()); |
| 266 | 274 | } |
Test case
1 generated file · +285 −0test/inputs/json/priority/keywords.json
Mcplusplusdefault / quicktype.hpp+285 −0
| @@ -6300,6 +6300,7 @@ namespace quicktype { | ||
| 6300 | 6300 | |
| 6301 | 6301 | inline void from_json(const json & j, Abstract& x) { |
| 6302 | 6302 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6303 | + if (j.find("abstract") != j.end() && !j.at("abstract").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6303 | 6304 | x.set_abstract(j.at("abstract").get<int64_t>()); |
| 6304 | 6305 | } |
| 6305 | 6306 | |
| @@ -6310,6 +6311,7 @@ namespace quicktype { | ||
| 6310 | 6311 | |
| 6311 | 6312 | inline void from_json(const json & j, Any& x) { |
| 6312 | 6313 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6314 | + if (j.find("Any") != j.end() && !j.at("Any").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6313 | 6315 | x.set_any(j.at("Any").get<int64_t>()); |
| 6314 | 6316 | } |
| 6315 | 6317 | |
| @@ -6320,6 +6322,7 @@ namespace quicktype { | ||
| 6320 | 6322 | |
| 6321 | 6323 | inline void from_json(const json & j, Array& x) { |
| 6322 | 6324 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6325 | + if (j.find("array") != j.end() && !j.at("array").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6323 | 6326 | x.set_array(j.at("array").get<int64_t>()); |
| 6324 | 6327 | } |
| 6325 | 6328 | |
| @@ -6330,6 +6333,7 @@ namespace quicktype { | ||
| 6330 | 6333 | |
| 6331 | 6334 | inline void from_json(const json & j, As& x) { |
| 6332 | 6335 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6336 | + if (j.find("as") != j.end() && !j.at("as").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6333 | 6337 | x.set_as(j.at("as").get<int64_t>()); |
| 6334 | 6338 | } |
| 6335 | 6339 | |
| @@ -6340,6 +6344,7 @@ namespace quicktype { | ||
| 6340 | 6344 | |
| 6341 | 6345 | inline void from_json(const json & j, Assert& x) { |
| 6342 | 6346 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6347 | + if (j.find("assert") != j.end() && !j.at("assert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6343 | 6348 | x.set_assert(j.at("assert").get<int64_t>()); |
| 6344 | 6349 | } |
| 6345 | 6350 | |
| @@ -6350,6 +6355,7 @@ namespace quicktype { | ||
| 6350 | 6355 | |
| 6351 | 6356 | inline void from_json(const json & j, Associatedtype& x) { |
| 6352 | 6357 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6358 | + if (j.find("associatedtype") != j.end() && !j.at("associatedtype").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6353 | 6359 | x.set_associatedtype(j.at("associatedtype").get<int64_t>()); |
| 6354 | 6360 | } |
| 6355 | 6361 | |
| @@ -6360,6 +6366,7 @@ namespace quicktype { | ||
| 6360 | 6366 | |
| 6361 | 6367 | inline void from_json(const json & j, Associativity& x) { |
| 6362 | 6368 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6369 | + if (j.find("associativity") != j.end() && !j.at("associativity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6363 | 6370 | x.set_associativity(j.at("associativity").get<int64_t>()); |
| 6364 | 6371 | } |
| 6365 | 6372 | |
| @@ -6370,6 +6377,7 @@ namespace quicktype { | ||
| 6370 | 6377 | |
| 6371 | 6378 | inline void from_json(const json & j, Async& x) { |
| 6372 | 6379 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6380 | + if (j.find("async") != j.end() && !j.at("async").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6373 | 6381 | x.set_async(j.at("async").get<int64_t>()); |
| 6374 | 6382 | } |
| 6375 | 6383 | |
| @@ -6380,6 +6388,7 @@ namespace quicktype { | ||
| 6380 | 6388 | |
| 6381 | 6389 | inline void from_json(const json & j, Atomic& x) { |
| 6382 | 6390 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6391 | + if (j.find("atomic") != j.end() && !j.at("atomic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6383 | 6392 | x.set_atomic(j.at("atomic").get<int64_t>()); |
| 6384 | 6393 | } |
| 6385 | 6394 | |
| @@ -6390,6 +6399,7 @@ namespace quicktype { | ||
| 6390 | 6399 | |
| 6391 | 6400 | inline void from_json(const json & j, Await& x) { |
| 6392 | 6401 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6402 | + if (j.find("await") != j.end() && !j.at("await").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6393 | 6403 | x.set_await(j.at("await").get<int64_t>()); |
| 6394 | 6404 | } |
| 6395 | 6405 | |
| @@ -6400,6 +6410,7 @@ namespace quicktype { | ||
| 6400 | 6410 | |
| 6401 | 6411 | inline void from_json(const json & j, Base& x) { |
| 6402 | 6412 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6413 | + if (j.find("base") != j.end() && !j.at("base").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6403 | 6414 | x.set_base(j.at("base").get<int64_t>()); |
| 6404 | 6415 | } |
| 6405 | 6416 | |
| @@ -6410,6 +6421,7 @@ namespace quicktype { | ||
| 6410 | 6421 | |
| 6411 | 6422 | inline void from_json(const json & j, Boolean& x) { |
| 6412 | 6423 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6424 | + if (j.find("boolean") != j.end() && !j.at("boolean").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6413 | 6425 | x.set_boolean(j.at("boolean").get<int64_t>()); |
| 6414 | 6426 | } |
| 6415 | 6427 | |
| @@ -6420,6 +6432,7 @@ namespace quicktype { | ||
| 6420 | 6432 | |
| 6421 | 6433 | inline void from_json(const json & j, Bycopy& x) { |
| 6422 | 6434 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6435 | + if (j.find("bycopy") != j.end() && !j.at("bycopy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6423 | 6436 | x.set_bycopy(j.at("bycopy").get<int64_t>()); |
| 6424 | 6437 | } |
| 6425 | 6438 | |
| @@ -6430,6 +6443,7 @@ namespace quicktype { | ||
| 6430 | 6443 | |
| 6431 | 6444 | inline void from_json(const json & j, Byref& x) { |
| 6432 | 6445 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6446 | + if (j.find("byref") != j.end() && !j.at("byref").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6433 | 6447 | x.set_byref(j.at("byref").get<int64_t>()); |
| 6434 | 6448 | } |
| 6435 | 6449 | |
| @@ -6440,6 +6454,7 @@ namespace quicktype { | ||
| 6440 | 6454 | |
| 6441 | 6455 | inline void from_json(const json & j, Byte& x) { |
| 6442 | 6456 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6457 | + if (j.find("byte") != j.end() && !j.at("byte").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6443 | 6458 | x.set_byte(j.at("byte").get<int64_t>()); |
| 6444 | 6459 | } |
| 6445 | 6460 | |
| @@ -6450,6 +6465,7 @@ namespace quicktype { | ||
| 6450 | 6465 | |
| 6451 | 6466 | inline void from_json(const json & j, Chan& x) { |
| 6452 | 6467 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6468 | + if (j.find("chan") != j.end() && !j.at("chan").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6453 | 6469 | x.set_chan(j.at("chan").get<int64_t>()); |
| 6454 | 6470 | } |
| 6455 | 6471 | |
| @@ -6460,6 +6476,7 @@ namespace quicktype { | ||
| 6460 | 6476 | |
| 6461 | 6477 | inline void from_json(const json & j, Checked& x) { |
| 6462 | 6478 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6479 | + if (j.find("checked") != j.end() && !j.at("checked").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6463 | 6480 | x.set_checked(j.at("checked").get<int64_t>()); |
| 6464 | 6481 | } |
| 6465 | 6482 | |
| @@ -6470,6 +6487,7 @@ namespace quicktype { | ||
| 6470 | 6487 | |
| 6471 | 6488 | inline void from_json(const json & j, Clone& x) { |
| 6472 | 6489 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6490 | + if (j.find("clone") != j.end() && !j.at("clone").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6473 | 6491 | x.set_clone(j.at("clone").get<int64_t>()); |
| 6474 | 6492 | } |
| 6475 | 6493 | |
| @@ -6480,6 +6498,7 @@ namespace quicktype { | ||
| 6480 | 6498 | |
| 6481 | 6499 | inline void from_json(const json & j, Complex& x) { |
| 6482 | 6500 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6501 | + if (j.find("_Complex") != j.end() && !j.at("_Complex").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6483 | 6502 | x.set_complex(j.at("_Complex").get<int64_t>()); |
| 6484 | 6503 | } |
| 6485 | 6504 | |
| @@ -6490,6 +6509,7 @@ namespace quicktype { | ||
| 6490 | 6509 | |
| 6491 | 6510 | inline void from_json(const json & j, Console& x) { |
| 6492 | 6511 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6512 | + if (j.find("console") != j.end() && !j.at("console").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6493 | 6513 | x.set_console(j.at("console").get<int64_t>()); |
| 6494 | 6514 | } |
| 6495 | 6515 | |
| @@ -6500,6 +6520,7 @@ namespace quicktype { | ||
| 6500 | 6520 | |
| 6501 | 6521 | inline void from_json(const json & j, Constructor& x) { |
| 6502 | 6522 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6523 | + if (j.find("constructor") != j.end() && !j.at("constructor").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6503 | 6524 | x.set_constructor(j.at("constructor").get<int64_t>()); |
| 6504 | 6525 | } |
| 6505 | 6526 | |
| @@ -6510,6 +6531,7 @@ namespace quicktype { | ||
| 6510 | 6531 | |
| 6511 | 6532 | inline void from_json(const json & j, Convenience& x) { |
| 6512 | 6533 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6534 | + if (j.find("convenience") != j.end() && !j.at("convenience").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6513 | 6535 | x.set_convenience(j.at("convenience").get<int64_t>()); |
| 6514 | 6536 | } |
| 6515 | 6537 | |
| @@ -6520,6 +6542,7 @@ namespace quicktype { | ||
| 6520 | 6542 | |
| 6521 | 6543 | inline void from_json(const json & j, Convert& x) { |
| 6522 | 6544 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6545 | + if (j.find("convert") != j.end() && !j.at("convert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6523 | 6546 | x.set_convert(j.at("convert").get<int64_t>()); |
| 6524 | 6547 | } |
| 6525 | 6548 | |
| @@ -6530,6 +6553,7 @@ namespace quicktype { | ||
| 6530 | 6553 | |
| 6531 | 6554 | inline void from_json(const json & j, Converter& x) { |
| 6532 | 6555 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6556 | + if (j.find("converter") != j.end() && !j.at("converter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6533 | 6557 | x.set_converter(j.at("converter").get<int64_t>()); |
| 6534 | 6558 | } |
| 6535 | 6559 | |
| @@ -6540,6 +6564,7 @@ namespace quicktype { | ||
| 6540 | 6564 | |
| 6541 | 6565 | inline void from_json(const json & j, Date& x) { |
| 6542 | 6566 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6567 | + if (j.find("date") != j.end() && !j.at("date").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6543 | 6568 | x.set_date(j.at("date").get<int64_t>()); |
| 6544 | 6569 | } |
| 6545 | 6570 | |
| @@ -6550,6 +6575,7 @@ namespace quicktype { | ||
| 6550 | 6575 | |
| 6551 | 6576 | inline void from_json(const json & j, DateParseHandling& x) { |
| 6552 | 6577 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6578 | + if (j.find("date_parse_handling") != j.end() && !j.at("date_parse_handling").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6553 | 6579 | x.set_date_parse_handling(j.at("date_parse_handling").get<int64_t>()); |
| 6554 | 6580 | } |
| 6555 | 6581 | |
| @@ -6560,6 +6586,7 @@ namespace quicktype { | ||
| 6560 | 6586 | |
| 6561 | 6587 | inline void from_json(const json & j, Debugger& x) { |
| 6562 | 6588 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6589 | + if (j.find("debugger") != j.end() && !j.at("debugger").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6563 | 6590 | x.set_debugger(j.at("debugger").get<int64_t>()); |
| 6564 | 6591 | } |
| 6565 | 6592 | |
| @@ -6570,6 +6597,7 @@ namespace quicktype { | ||
| 6570 | 6597 | |
| 6571 | 6598 | inline void from_json(const json & j, Decimal& x) { |
| 6572 | 6599 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6600 | + if (j.find("decimal") != j.end() && !j.at("decimal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6573 | 6601 | x.set_decimal(j.at("decimal").get<int64_t>()); |
| 6574 | 6602 | } |
| 6575 | 6603 | |
| @@ -6580,6 +6608,7 @@ namespace quicktype { | ||
| 6580 | 6608 | |
| 6581 | 6609 | inline void from_json(const json & j, Declare& x) { |
| 6582 | 6610 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6611 | + if (j.find("declare") != j.end() && !j.at("declare").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6583 | 6612 | x.set_declare(j.at("declare").get<int64_t>()); |
| 6584 | 6613 | } |
| 6585 | 6614 | |
| @@ -6590,6 +6619,7 @@ namespace quicktype { | ||
| 6590 | 6619 | |
| 6591 | 6620 | inline void from_json(const json & j, DecodeString& x) { |
| 6592 | 6621 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6622 | + if (j.find("decode_string") != j.end() && !j.at("decode_string").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6593 | 6623 | x.set_decode_string(j.at("decode_string").get<int64_t>()); |
| 6594 | 6624 | } |
| 6595 | 6625 | |
| @@ -6600,6 +6630,7 @@ namespace quicktype { | ||
| 6600 | 6630 | |
| 6601 | 6631 | inline void from_json(const json & j, Empty& x) { |
| 6602 | 6632 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6633 | + if (j.find("_") != j.end() && !j.at("_").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6603 | 6634 | x.set_empty(j.at("_").get<int64_t>()); |
| 6604 | 6635 | } |
| 6605 | 6636 | |
| @@ -6610,6 +6641,7 @@ namespace quicktype { | ||
| 6610 | 6641 | |
| 6611 | 6642 | inline void from_json(const json & j, Obj1Bool& x) { |
| 6612 | 6643 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6644 | + if (j.find("bool") != j.end() && !j.at("bool").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6613 | 6645 | x.set_bool_bool(j.at("bool").get<int64_t>()); |
| 6614 | 6646 | } |
| 6615 | 6647 | |
| @@ -6620,6 +6652,7 @@ namespace quicktype { | ||
| 6620 | 6652 | |
| 6621 | 6653 | inline void from_json(const json & j, Imaginery& x) { |
| 6622 | 6654 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6655 | + if (j.find("_Imaginery") != j.end() && !j.at("_Imaginery").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6623 | 6656 | x.set_imaginery(j.at("_Imaginery").get<int64_t>()); |
| 6624 | 6657 | } |
| 6625 | 6658 | |
| @@ -6630,6 +6663,7 @@ namespace quicktype { | ||
| 6630 | 6663 | |
| 6631 | 6664 | inline void from_json(const json & j, Alignas& x) { |
| 6632 | 6665 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6666 | + if (j.find("alignas") != j.end() && !j.at("alignas").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6633 | 6667 | x.set_alignas_alignas(j.at("alignas").get<int64_t>()); |
| 6634 | 6668 | } |
| 6635 | 6669 | |
| @@ -6640,6 +6674,7 @@ namespace quicktype { | ||
| 6640 | 6674 | |
| 6641 | 6675 | inline void from_json(const json & j, Alignof& x) { |
| 6642 | 6676 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6677 | + if (j.find("alignof") != j.end() && !j.at("alignof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6643 | 6678 | x.set_alignof_alignof(j.at("alignof").get<int64_t>()); |
| 6644 | 6679 | } |
| 6645 | 6680 | |
| @@ -6650,6 +6685,7 @@ namespace quicktype { | ||
| 6650 | 6685 | |
| 6651 | 6686 | inline void from_json(const json & j, And& x) { |
| 6652 | 6687 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6688 | + if (j.find("and") != j.end() && !j.at("and").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6653 | 6689 | x.set_and_and(j.at("and").get<int64_t>()); |
| 6654 | 6690 | } |
| 6655 | 6691 | |
| @@ -6660,6 +6696,7 @@ namespace quicktype { | ||
| 6660 | 6696 | |
| 6661 | 6697 | inline void from_json(const json & j, AndEq& x) { |
| 6662 | 6698 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6699 | + if (j.find("and_eq") != j.end() && !j.at("and_eq").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6663 | 6700 | x.set_and_eq_and_eq(j.at("and_eq").get<int64_t>()); |
| 6664 | 6701 | } |
| 6665 | 6702 | |
| @@ -6670,6 +6707,7 @@ namespace quicktype { | ||
| 6670 | 6707 | |
| 6671 | 6708 | inline void from_json(const json & j, AnyClass& x) { |
| 6672 | 6709 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6710 | + if (j.find("any") != j.end() && !j.at("any").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6673 | 6711 | x.set_any(j.at("any").get<int64_t>()); |
| 6674 | 6712 | } |
| 6675 | 6713 | |
| @@ -6680,6 +6718,7 @@ namespace quicktype { | ||
| 6680 | 6718 | |
| 6681 | 6719 | inline void from_json(const json & j, Asm& x) { |
| 6682 | 6720 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6721 | + if (j.find("asm") != j.end() && !j.at("asm").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6683 | 6722 | x.set_asm_asm(j.at("asm").get<int64_t>()); |
| 6684 | 6723 | } |
| 6685 | 6724 | |
| @@ -6690,6 +6729,7 @@ namespace quicktype { | ||
| 6690 | 6729 | |
| 6691 | 6730 | inline void from_json(const json & j, AtomicCancel& x) { |
| 6692 | 6731 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6732 | + if (j.find("atomic_cancel") != j.end() && !j.at("atomic_cancel").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6693 | 6733 | x.set_atomic_cancel_atomic_cancel(j.at("atomic_cancel").get<int64_t>()); |
| 6694 | 6734 | } |
| 6695 | 6735 | |
| @@ -6700,6 +6740,7 @@ namespace quicktype { | ||
| 6700 | 6740 | |
| 6701 | 6741 | inline void from_json(const json & j, AtomicCommit& x) { |
| 6702 | 6742 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6743 | + if (j.find("atomic_commit") != j.end() && !j.at("atomic_commit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6703 | 6744 | x.set_atomic_commit_atomic_commit(j.at("atomic_commit").get<int64_t>()); |
| 6704 | 6745 | } |
| 6705 | 6746 | |
| @@ -6710,6 +6751,7 @@ namespace quicktype { | ||
| 6710 | 6751 | |
| 6711 | 6752 | inline void from_json(const json & j, AtomicNoexcept& x) { |
| 6712 | 6753 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6754 | + if (j.find("atomic_noexcept") != j.end() && !j.at("atomic_noexcept").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6713 | 6755 | x.set_atomic_noexcept_atomic_noexcept(j.at("atomic_noexcept").get<int64_t>()); |
| 6714 | 6756 | } |
| 6715 | 6757 | |
| @@ -6720,6 +6762,7 @@ namespace quicktype { | ||
| 6720 | 6762 | |
| 6721 | 6763 | inline void from_json(const json & j, Auto& x) { |
| 6722 | 6764 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6765 | + if (j.find("auto") != j.end() && !j.at("auto").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6723 | 6766 | x.set_auto_auto(j.at("auto").get<int64_t>()); |
| 6724 | 6767 | } |
| 6725 | 6768 | |
| @@ -6730,6 +6773,7 @@ namespace quicktype { | ||
| 6730 | 6773 | |
| 6731 | 6774 | inline void from_json(const json & j, Bitand& x) { |
| 6732 | 6775 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6776 | + if (j.find("bitand") != j.end() && !j.at("bitand").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6733 | 6777 | x.set_bitand_bitand(j.at("bitand").get<int64_t>()); |
| 6734 | 6778 | } |
| 6735 | 6779 | |
| @@ -6740,6 +6784,7 @@ namespace quicktype { | ||
| 6740 | 6784 | |
| 6741 | 6785 | inline void from_json(const json & j, Bitor& x) { |
| 6742 | 6786 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6787 | + if (j.find("bitor") != j.end() && !j.at("bitor").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6743 | 6788 | x.set_bitor_bitor(j.at("bitor").get<int64_t>()); |
| 6744 | 6789 | } |
| 6745 | 6790 | |
| @@ -6750,6 +6795,7 @@ namespace quicktype { | ||
| 6750 | 6795 | |
| 6751 | 6796 | inline void from_json(const json & j, Bool& x) { |
| 6752 | 6797 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6798 | + if (j.find("BOOL") != j.end() && !j.at("BOOL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6753 | 6799 | x.set_bool_bool(j.at("BOOL").get<int64_t>()); |
| 6754 | 6800 | } |
| 6755 | 6801 | |
| @@ -6760,6 +6806,7 @@ namespace quicktype { | ||
| 6760 | 6806 | |
| 6761 | 6807 | inline void from_json(const json & j, Break& x) { |
| 6762 | 6808 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6809 | + if (j.find("break") != j.end() && !j.at("break").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6763 | 6810 | x.set_break_break(j.at("break").get<int64_t>()); |
| 6764 | 6811 | } |
| 6765 | 6812 | |
| @@ -6770,6 +6817,7 @@ namespace quicktype { | ||
| 6770 | 6817 | |
| 6771 | 6818 | inline void from_json(const json & j, Case& x) { |
| 6772 | 6819 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6820 | + if (j.find("case") != j.end() && !j.at("case").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6773 | 6821 | x.set_case_case(j.at("case").get<int64_t>()); |
| 6774 | 6822 | } |
| 6775 | 6823 | |
| @@ -6780,6 +6828,7 @@ namespace quicktype { | ||
| 6780 | 6828 | |
| 6781 | 6829 | inline void from_json(const json & j, Catch& x) { |
| 6782 | 6830 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6831 | + if (j.find("catch") != j.end() && !j.at("catch").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6783 | 6832 | x.set_catch_catch(j.at("catch").get<int64_t>()); |
| 6784 | 6833 | } |
| 6785 | 6834 | |
| @@ -6790,6 +6839,7 @@ namespace quicktype { | ||
| 6790 | 6839 | |
| 6791 | 6840 | inline void from_json(const json & j, Char& x) { |
| 6792 | 6841 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6842 | + if (j.find("char") != j.end() && !j.at("char").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6793 | 6843 | x.set_char_char(j.at("char").get<int64_t>()); |
| 6794 | 6844 | } |
| 6795 | 6845 | |
| @@ -6800,6 +6850,7 @@ namespace quicktype { | ||
| 6800 | 6850 | |
| 6801 | 6851 | inline void from_json(const json & j, Char16T& x) { |
| 6802 | 6852 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6853 | + if (j.find("char16_t") != j.end() && !j.at("char16_t").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6803 | 6854 | x.set_char16_t_char16_t(j.at("char16_t").get<int64_t>()); |
| 6804 | 6855 | } |
| 6805 | 6856 | |
| @@ -6810,6 +6861,7 @@ namespace quicktype { | ||
| 6810 | 6861 | |
| 6811 | 6862 | inline void from_json(const json & j, Char32T& x) { |
| 6812 | 6863 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6864 | + if (j.find("char32_t") != j.end() && !j.at("char32_t").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6813 | 6865 | x.set_char32_t_char32_t(j.at("char32_t").get<int64_t>()); |
| 6814 | 6866 | } |
| 6815 | 6867 | |
| @@ -6820,6 +6872,7 @@ namespace quicktype { | ||
| 6820 | 6872 | |
| 6821 | 6873 | inline void from_json(const json & j, Class& x) { |
| 6822 | 6874 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6875 | + if (j.find("Class") != j.end() && !j.at("Class").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6823 | 6876 | x.set_class_class(j.at("Class").get<int64_t>()); |
| 6824 | 6877 | } |
| 6825 | 6878 | |
| @@ -6830,6 +6883,7 @@ namespace quicktype { | ||
| 6830 | 6883 | |
| 6831 | 6884 | inline void from_json(const json & j, CoAwait& x) { |
| 6832 | 6885 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6886 | + if (j.find("co_await") != j.end() && !j.at("co_await").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6833 | 6887 | x.set_co_await_co_await(j.at("co_await").get<int64_t>()); |
| 6834 | 6888 | } |
| 6835 | 6889 | |
| @@ -6840,6 +6894,7 @@ namespace quicktype { | ||
| 6840 | 6894 | |
| 6841 | 6895 | inline void from_json(const json & j, CoReturn& x) { |
| 6842 | 6896 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6897 | + if (j.find("co_return") != j.end() && !j.at("co_return").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6843 | 6898 | x.set_co_return_co_return(j.at("co_return").get<int64_t>()); |
| 6844 | 6899 | } |
| 6845 | 6900 | |
| @@ -6850,6 +6905,7 @@ namespace quicktype { | ||
| 6850 | 6905 | |
| 6851 | 6906 | inline void from_json(const json & j, CoYield& x) { |
| 6852 | 6907 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6908 | + if (j.find("co_yield") != j.end() && !j.at("co_yield").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6853 | 6909 | x.set_co_yield_co_yield(j.at("co_yield").get<int64_t>()); |
| 6854 | 6910 | } |
| 6855 | 6911 | |
| @@ -6860,6 +6916,7 @@ namespace quicktype { | ||
| 6860 | 6916 | |
| 6861 | 6917 | inline void from_json(const json & j, Compl& x) { |
| 6862 | 6918 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6919 | + if (j.find("compl") != j.end() && !j.at("compl").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6863 | 6920 | x.set_compl_compl(j.at("compl").get<int64_t>()); |
| 6864 | 6921 | } |
| 6865 | 6922 | |
| @@ -6870,6 +6927,7 @@ namespace quicktype { | ||
| 6870 | 6927 | |
| 6871 | 6928 | inline void from_json(const json & j, Concept& x) { |
| 6872 | 6929 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6930 | + if (j.find("concept") != j.end() && !j.at("concept").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6873 | 6931 | x.set_concept_concept(j.at("concept").get<int64_t>()); |
| 6874 | 6932 | } |
| 6875 | 6933 | |
| @@ -6880,6 +6938,7 @@ namespace quicktype { | ||
| 6880 | 6938 | |
| 6881 | 6939 | inline void from_json(const json & j, Const& x) { |
| 6882 | 6940 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6941 | + if (j.find("const") != j.end() && !j.at("const").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6883 | 6942 | x.set_const_const(j.at("const").get<int64_t>()); |
| 6884 | 6943 | } |
| 6885 | 6944 | |
| @@ -6890,6 +6949,7 @@ namespace quicktype { | ||
| 6890 | 6949 | |
| 6891 | 6950 | inline void from_json(const json & j, ConstCast& x) { |
| 6892 | 6951 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6952 | + if (j.find("const_cast") != j.end() && !j.at("const_cast").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6893 | 6953 | x.set_const_cast_const_cast(j.at("const_cast").get<int64_t>()); |
| 6894 | 6954 | } |
| 6895 | 6955 | |
| @@ -6900,6 +6960,7 @@ namespace quicktype { | ||
| 6900 | 6960 | |
| 6901 | 6961 | inline void from_json(const json & j, Constexpr& x) { |
| 6902 | 6962 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6963 | + if (j.find("constexpr") != j.end() && !j.at("constexpr").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6903 | 6964 | x.set_constexpr_constexpr(j.at("constexpr").get<int64_t>()); |
| 6904 | 6965 | } |
| 6905 | 6966 | |
| @@ -6910,6 +6971,7 @@ namespace quicktype { | ||
| 6910 | 6971 | |
| 6911 | 6972 | inline void from_json(const json & j, Continue& x) { |
| 6912 | 6973 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6974 | + if (j.find("continue") != j.end() && !j.at("continue").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6913 | 6975 | x.set_continue_continue(j.at("continue").get<int64_t>()); |
| 6914 | 6976 | } |
| 6915 | 6977 | |
| @@ -6920,6 +6982,7 @@ namespace quicktype { | ||
| 6920 | 6982 | |
| 6921 | 6983 | inline void from_json(const json & j, Decltype& x) { |
| 6922 | 6984 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6985 | + if (j.find("decltype") != j.end() && !j.at("decltype").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6923 | 6986 | x.set_decltype_decltype(j.at("decltype").get<int64_t>()); |
| 6924 | 6987 | } |
| 6925 | 6988 | |
| @@ -6930,6 +6993,7 @@ namespace quicktype { | ||
| 6930 | 6993 | |
| 6931 | 6994 | inline void from_json(const json & j, BoolClass& x) { |
| 6932 | 6995 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 6996 | + if (j.find("_Bool") != j.end() && !j.at("_Bool").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6933 | 6997 | x.set_bool_bool(j.at("_Bool").get<int64_t>()); |
| 6934 | 6998 | } |
| 6935 | 6999 | |
| @@ -6940,6 +7004,7 @@ namespace quicktype { | ||
| 6940 | 7004 | |
| 6941 | 7005 | inline void from_json(const json & j, ClassClass& x) { |
| 6942 | 7006 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7007 | + if (j.find("class") != j.end() && !j.at("class").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6943 | 7008 | x.set_class_class(j.at("class").get<int64_t>()); |
| 6944 | 7009 | } |
| 6945 | 7010 | |
| @@ -6980,6 +7045,7 @@ namespace quicktype { | ||
| 6980 | 7045 | x.set_decimal(j.at("decimal").get<Decimal>()); |
| 6981 | 7046 | x.set_declare(j.at("declare").get<Declare>()); |
| 6982 | 7047 | x.set_decode_string(j.at("decode_string").get<DecodeString>()); |
| 7048 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 6983 | 7049 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 6984 | 7050 | x.set_empty(j.at("_").get<Empty>()); |
| 6985 | 7051 | x.set_fluffy_bool(j.at("bool").get<Obj1Bool>()); |
| @@ -7090,6 +7156,7 @@ namespace quicktype { | ||
| 7090 | 7156 | |
| 7091 | 7157 | inline void from_json(const json & j, Def& x) { |
| 7092 | 7158 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7159 | + if (j.find("def") != j.end() && !j.at("def").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7093 | 7160 | x.set_def(j.at("def").get<int64_t>()); |
| 7094 | 7161 | } |
| 7095 | 7162 | |
| @@ -7100,6 +7167,7 @@ namespace quicktype { | ||
| 7100 | 7167 | |
| 7101 | 7168 | inline void from_json(const json & j, Defer& x) { |
| 7102 | 7169 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7170 | + if (j.find("defer") != j.end() && !j.at("defer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7103 | 7171 | x.set_defer(j.at("defer").get<int64_t>()); |
| 7104 | 7172 | } |
| 7105 | 7173 | |
| @@ -7110,6 +7178,7 @@ namespace quicktype { | ||
| 7110 | 7178 | |
| 7111 | 7179 | inline void from_json(const json & j, Deinit& x) { |
| 7112 | 7180 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7181 | + if (j.find("deinit") != j.end() && !j.at("deinit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7113 | 7182 | x.set_deinit(j.at("deinit").get<int64_t>()); |
| 7114 | 7183 | } |
| 7115 | 7184 | |
| @@ -7120,6 +7189,7 @@ namespace quicktype { | ||
| 7120 | 7189 | |
| 7121 | 7190 | inline void from_json(const json & j, Del& x) { |
| 7122 | 7191 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7192 | + if (j.find("del") != j.end() && !j.at("del").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7123 | 7193 | x.set_del(j.at("del").get<int64_t>()); |
| 7124 | 7194 | } |
| 7125 | 7195 | |
| @@ -7130,6 +7200,7 @@ namespace quicktype { | ||
| 7130 | 7200 | |
| 7131 | 7201 | inline void from_json(const json & j, Delegate& x) { |
| 7132 | 7202 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7203 | + if (j.find("delegate") != j.end() && !j.at("delegate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7133 | 7204 | x.set_delegate(j.at("delegate").get<int64_t>()); |
| 7134 | 7205 | } |
| 7135 | 7206 | |
| @@ -7140,6 +7211,7 @@ namespace quicktype { | ||
| 7140 | 7211 | |
| 7141 | 7212 | inline void from_json(const json & j, Dict& x) { |
| 7142 | 7213 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7214 | + if (j.find("dict") != j.end() && !j.at("dict").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7143 | 7215 | x.set_dict(j.at("dict").get<int64_t>()); |
| 7144 | 7216 | } |
| 7145 | 7217 | |
| @@ -7150,6 +7222,7 @@ namespace quicktype { | ||
| 7150 | 7222 | |
| 7151 | 7223 | inline void from_json(const json & j, Dictionary& x) { |
| 7152 | 7224 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7225 | + if (j.find("dictionary") != j.end() && !j.at("dictionary").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7153 | 7226 | x.set_dictionary(j.at("dictionary").get<int64_t>()); |
| 7154 | 7227 | } |
| 7155 | 7228 | |
| @@ -7160,6 +7233,7 @@ namespace quicktype { | ||
| 7160 | 7233 | |
| 7161 | 7234 | inline void from_json(const json & j, DidSet& x) { |
| 7162 | 7235 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7236 | + if (j.find("didSet") != j.end() && !j.at("didSet").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7163 | 7237 | x.set_did_set(j.at("didSet").get<int64_t>()); |
| 7164 | 7238 | } |
| 7165 | 7239 | |
| @@ -7170,6 +7244,7 @@ namespace quicktype { | ||
| 7170 | 7244 | |
| 7171 | 7245 | inline void from_json(const json & j, Dynamic& x) { |
| 7172 | 7246 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7247 | + if (j.find("dynamic") != j.end() && !j.at("dynamic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7173 | 7248 | x.set_dynamic(j.at("dynamic").get<int64_t>()); |
| 7174 | 7249 | } |
| 7175 | 7250 | |
| @@ -7180,6 +7255,7 @@ namespace quicktype { | ||
| 7180 | 7255 | |
| 7181 | 7256 | inline void from_json(const json & j, Elif& x) { |
| 7182 | 7257 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7258 | + if (j.find("elif") != j.end() && !j.at("elif").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7183 | 7259 | x.set_elif(j.at("elif").get<int64_t>()); |
| 7184 | 7260 | } |
| 7185 | 7261 | |
| @@ -7190,6 +7266,7 @@ namespace quicktype { | ||
| 7190 | 7266 | |
| 7191 | 7267 | inline void from_json(const json & j, EncodeQuickType& x) { |
| 7192 | 7268 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7269 | + if (j.find("encode_quick_type") != j.end() && !j.at("encode_quick_type").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7193 | 7270 | x.set_encode_quick_type(j.at("encode_quick_type").get<int64_t>()); |
| 7194 | 7271 | } |
| 7195 | 7272 | |
| @@ -7200,6 +7277,7 @@ namespace quicktype { | ||
| 7200 | 7277 | |
| 7201 | 7278 | inline void from_json(const json & j, EqualityContract& x) { |
| 7202 | 7279 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7280 | + if (j.find("equalityContract") != j.end() && !j.at("equalityContract").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7203 | 7281 | x.set_equality_contract(j.at("equalityContract").get<int64_t>()); |
| 7204 | 7282 | } |
| 7205 | 7283 | |
| @@ -7210,6 +7288,7 @@ namespace quicktype { | ||
| 7210 | 7288 | |
| 7211 | 7289 | inline void from_json(const json & j, Event& x) { |
| 7212 | 7290 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7291 | + if (j.find("event") != j.end() && !j.at("event").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7213 | 7292 | x.set_event(j.at("event").get<int64_t>()); |
| 7214 | 7293 | } |
| 7215 | 7294 | |
| @@ -7220,6 +7299,7 @@ namespace quicktype { | ||
| 7220 | 7299 | |
| 7221 | 7300 | inline void from_json(const json & j, Except& x) { |
| 7222 | 7301 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7302 | + if (j.find("except") != j.end() && !j.at("except").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7223 | 7303 | x.set_except(j.at("except").get<int64_t>()); |
| 7224 | 7304 | } |
| 7225 | 7305 | |
| @@ -7230,6 +7310,7 @@ namespace quicktype { | ||
| 7230 | 7310 | |
| 7231 | 7311 | inline void from_json(const json & j, Exception& x) { |
| 7232 | 7312 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7313 | + if (j.find("exception") != j.end() && !j.at("exception").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7233 | 7314 | x.set_exception(j.at("exception").get<int64_t>()); |
| 7234 | 7315 | } |
| 7235 | 7316 | |
| @@ -7240,6 +7321,7 @@ namespace quicktype { | ||
| 7240 | 7321 | |
| 7241 | 7322 | inline void from_json(const json & j, Exposing& x) { |
| 7242 | 7323 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7324 | + if (j.find("exposing") != j.end() && !j.at("exposing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7243 | 7325 | x.set_exposing(j.at("exposing").get<int64_t>()); |
| 7244 | 7326 | } |
| 7245 | 7327 | |
| @@ -7250,6 +7332,7 @@ namespace quicktype { | ||
| 7250 | 7332 | |
| 7251 | 7333 | inline void from_json(const json & j, Extends& x) { |
| 7252 | 7334 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7335 | + if (j.find("extends") != j.end() && !j.at("extends").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7253 | 7336 | x.set_extends(j.at("extends").get<int64_t>()); |
| 7254 | 7337 | } |
| 7255 | 7338 | |
| @@ -7260,6 +7343,7 @@ namespace quicktype { | ||
| 7260 | 7343 | |
| 7261 | 7344 | inline void from_json(const json & j, Extension& x) { |
| 7262 | 7345 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7346 | + if (j.find("extension") != j.end() && !j.at("extension").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7263 | 7347 | x.set_extension(j.at("extension").get<int64_t>()); |
| 7264 | 7348 | } |
| 7265 | 7349 | |
| @@ -7270,6 +7354,7 @@ namespace quicktype { | ||
| 7270 | 7354 | |
| 7271 | 7355 | inline void from_json(const json & j, Fallthrough& x) { |
| 7272 | 7356 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7357 | + if (j.find("fallthrough") != j.end() && !j.at("fallthrough").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7273 | 7358 | x.set_fallthrough(j.at("fallthrough").get<int64_t>()); |
| 7274 | 7359 | } |
| 7275 | 7360 | |
| @@ -7280,6 +7365,7 @@ namespace quicktype { | ||
| 7280 | 7365 | |
| 7281 | 7366 | inline void from_json(const json & j, Fileprivate& x) { |
| 7282 | 7367 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7368 | + if (j.find("fileprivate") != j.end() && !j.at("fileprivate").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7283 | 7369 | x.set_fileprivate(j.at("fileprivate").get<int64_t>()); |
| 7284 | 7370 | } |
| 7285 | 7371 | |
| @@ -7290,6 +7376,7 @@ namespace quicktype { | ||
| 7290 | 7376 | |
| 7291 | 7377 | inline void from_json(const json & j, Finally& x) { |
| 7292 | 7378 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7379 | + if (j.find("finally") != j.end() && !j.at("finally").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7293 | 7380 | x.set_finally(j.at("finally").get<int64_t>()); |
| 7294 | 7381 | } |
| 7295 | 7382 | |
| @@ -7300,6 +7387,7 @@ namespace quicktype { | ||
| 7300 | 7387 | |
| 7301 | 7388 | inline void from_json(const json & j, Fixed& x) { |
| 7302 | 7389 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7390 | + if (j.find("fixed") != j.end() && !j.at("fixed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7303 | 7391 | x.set_fixed(j.at("fixed").get<int64_t>()); |
| 7304 | 7392 | } |
| 7305 | 7393 | |
| @@ -7310,6 +7398,7 @@ namespace quicktype { | ||
| 7310 | 7398 | |
| 7311 | 7399 | inline void from_json(const json & j, Foreach& x) { |
| 7312 | 7400 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7401 | + if (j.find("foreach") != j.end() && !j.at("foreach").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7313 | 7402 | x.set_foreach(j.at("foreach").get<int64_t>()); |
| 7314 | 7403 | } |
| 7315 | 7404 | |
| @@ -7320,6 +7409,7 @@ namespace quicktype { | ||
| 7320 | 7409 | |
| 7321 | 7410 | inline void from_json(const json & j, From& x) { |
| 7322 | 7411 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7412 | + if (j.find("from") != j.end() && !j.at("from").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7323 | 7413 | x.set_from(j.at("from").get<int64_t>()); |
| 7324 | 7414 | } |
| 7325 | 7415 | |
| @@ -7330,6 +7420,7 @@ namespace quicktype { | ||
| 7330 | 7420 | |
| 7331 | 7421 | inline void from_json(const json & j, FromJson& x) { |
| 7332 | 7422 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7423 | + if (j.find("from_json") != j.end() && !j.at("from_json").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7333 | 7424 | x.set_from_json(j.at("from_json").get<int64_t>()); |
| 7334 | 7425 | } |
| 7335 | 7426 | |
| @@ -7340,6 +7431,7 @@ namespace quicktype { | ||
| 7340 | 7431 | |
| 7341 | 7432 | inline void from_json(const json & j, Func& x) { |
| 7342 | 7433 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7434 | + if (j.find("func") != j.end() && !j.at("func").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7343 | 7435 | x.set_func(j.at("func").get<int64_t>()); |
| 7344 | 7436 | } |
| 7345 | 7437 | |
| @@ -7350,6 +7442,7 @@ namespace quicktype { | ||
| 7350 | 7442 | |
| 7351 | 7443 | inline void from_json(const json & j, Function& x) { |
| 7352 | 7444 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7445 | + if (j.find("function") != j.end() && !j.at("function").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7353 | 7446 | x.set_function(j.at("function").get<int64_t>()); |
| 7354 | 7447 | } |
| 7355 | 7448 | |
| @@ -7360,6 +7453,7 @@ namespace quicktype { | ||
| 7360 | 7453 | |
| 7361 | 7454 | inline void from_json(const json & j, Get& x) { |
| 7362 | 7455 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7456 | + if (j.find("get") != j.end() && !j.at("get").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7363 | 7457 | x.set_get(j.at("get").get<int64_t>()); |
| 7364 | 7458 | } |
| 7365 | 7459 | |
| @@ -7370,6 +7464,7 @@ namespace quicktype { | ||
| 7370 | 7464 | |
| 7371 | 7465 | inline void from_json(const json & j, Global& x) { |
| 7372 | 7466 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7467 | + if (j.find("global") != j.end() && !j.at("global").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7373 | 7468 | x.set_global(j.at("global").get<int64_t>()); |
| 7374 | 7469 | } |
| 7375 | 7470 | |
| @@ -7380,6 +7475,7 @@ namespace quicktype { | ||
| 7380 | 7475 | |
| 7381 | 7476 | inline void from_json(const json & j, Go& x) { |
| 7382 | 7477 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7478 | + if (j.find("go") != j.end() && !j.at("go").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7383 | 7479 | x.set_go(j.at("go").get<int64_t>()); |
| 7384 | 7480 | } |
| 7385 | 7481 | |
| @@ -7390,6 +7486,7 @@ namespace quicktype { | ||
| 7390 | 7486 | |
| 7391 | 7487 | inline void from_json(const json & j, Guard& x) { |
| 7392 | 7488 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7489 | + if (j.find("guard") != j.end() && !j.at("guard").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7393 | 7490 | x.set_guard(j.at("guard").get<int64_t>()); |
| 7394 | 7491 | } |
| 7395 | 7492 | |
| @@ -7400,6 +7497,7 @@ namespace quicktype { | ||
| 7400 | 7497 | |
| 7401 | 7498 | inline void from_json(const json & j, HasOwnProperty& x) { |
| 7402 | 7499 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7500 | + if (j.find("hasOwnProperty") != j.end() && !j.at("hasOwnProperty").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7403 | 7501 | x.set_has_own_property(j.at("hasOwnProperty").get<int64_t>()); |
| 7404 | 7502 | } |
| 7405 | 7503 | |
| @@ -7410,6 +7508,7 @@ namespace quicktype { | ||
| 7410 | 7508 | |
| 7411 | 7509 | inline void from_json(const json & j, Id& x) { |
| 7412 | 7510 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7511 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7413 | 7512 | x.set_id(j.at("id").get<int64_t>()); |
| 7414 | 7513 | } |
| 7415 | 7514 | |
| @@ -7420,6 +7519,7 @@ namespace quicktype { | ||
| 7420 | 7519 | |
| 7421 | 7520 | inline void from_json(const json & j, Imp& x) { |
| 7422 | 7521 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7522 | + if (j.find("IMP") != j.end() && !j.at("IMP").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7423 | 7523 | x.set_imp(j.at("IMP").get<int64_t>()); |
| 7424 | 7524 | } |
| 7425 | 7525 | |
| @@ -7430,6 +7530,7 @@ namespace quicktype { | ||
| 7430 | 7530 | |
| 7431 | 7531 | inline void from_json(const json & j, Implements& x) { |
| 7432 | 7532 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7533 | + if (j.find("implements") != j.end() && !j.at("implements").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7433 | 7534 | x.set_implements(j.at("implements").get<int64_t>()); |
| 7434 | 7535 | } |
| 7435 | 7536 | |
| @@ -7440,6 +7541,7 @@ namespace quicktype { | ||
| 7440 | 7541 | |
| 7441 | 7542 | inline void from_json(const json & j, Implicit& x) { |
| 7442 | 7543 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7544 | + if (j.find("implicit") != j.end() && !j.at("implicit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7443 | 7545 | x.set_implicit(j.at("implicit").get<int64_t>()); |
| 7444 | 7546 | } |
| 7445 | 7547 | |
| @@ -7450,6 +7552,7 @@ namespace quicktype { | ||
| 7450 | 7552 | |
| 7451 | 7553 | inline void from_json(const json & j, In& x) { |
| 7452 | 7554 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7555 | + if (j.find("in") != j.end() && !j.at("in").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7453 | 7556 | x.set_in(j.at("in").get<int64_t>()); |
| 7454 | 7557 | } |
| 7455 | 7558 | |
| @@ -7460,6 +7563,7 @@ namespace quicktype { | ||
| 7460 | 7563 | |
| 7461 | 7564 | inline void from_json(const json & j, Indirect& x) { |
| 7462 | 7565 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7566 | + if (j.find("indirect") != j.end() && !j.at("indirect").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7463 | 7567 | x.set_indirect(j.at("indirect").get<int64_t>()); |
| 7464 | 7568 | } |
| 7465 | 7569 | |
| @@ -7470,6 +7574,7 @@ namespace quicktype { | ||
| 7470 | 7574 | |
| 7471 | 7575 | inline void from_json(const json & j, Infix& x) { |
| 7472 | 7576 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7577 | + if (j.find("infix") != j.end() && !j.at("infix").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7473 | 7578 | x.set_infix(j.at("infix").get<int64_t>()); |
| 7474 | 7579 | } |
| 7475 | 7580 | |
| @@ -7480,6 +7585,7 @@ namespace quicktype { | ||
| 7480 | 7585 | |
| 7481 | 7586 | inline void from_json(const json & j, Init& x) { |
| 7482 | 7587 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7588 | + if (j.find("init") != j.end() && !j.at("init").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7483 | 7589 | x.set_init(j.at("init").get<int64_t>()); |
| 7484 | 7590 | } |
| 7485 | 7591 | |
| @@ -7490,6 +7596,7 @@ namespace quicktype { | ||
| 7490 | 7596 | |
| 7491 | 7597 | inline void from_json(const json & j, Inout& x) { |
| 7492 | 7598 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7599 | + if (j.find("inout") != j.end() && !j.at("inout").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7493 | 7600 | x.set_inout(j.at("inout").get<int64_t>()); |
| 7494 | 7601 | } |
| 7495 | 7602 | |
| @@ -7500,6 +7607,7 @@ namespace quicktype { | ||
| 7500 | 7607 | |
| 7501 | 7608 | inline void from_json(const json & j, Instanceof& x) { |
| 7502 | 7609 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7610 | + if (j.find("instanceof") != j.end() && !j.at("instanceof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7503 | 7611 | x.set_instanceof(j.at("instanceof").get<int64_t>()); |
| 7504 | 7612 | } |
| 7505 | 7613 | |
| @@ -7510,6 +7618,7 @@ namespace quicktype { | ||
| 7510 | 7618 | |
| 7511 | 7619 | inline void from_json(const json & j, Interface& x) { |
| 7512 | 7620 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7621 | + if (j.find("interface") != j.end() && !j.at("interface").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7513 | 7622 | x.set_interface(j.at("interface").get<int64_t>()); |
| 7514 | 7623 | } |
| 7515 | 7624 | |
| @@ -7520,6 +7629,7 @@ namespace quicktype { | ||
| 7520 | 7629 | |
| 7521 | 7630 | inline void from_json(const json & j, Internal& x) { |
| 7522 | 7631 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7632 | + if (j.find("internal") != j.end() && !j.at("internal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7523 | 7633 | x.set_internal(j.at("internal").get<int64_t>()); |
| 7524 | 7634 | } |
| 7525 | 7635 | |
| @@ -7530,6 +7640,7 @@ namespace quicktype { | ||
| 7530 | 7640 | |
| 7531 | 7641 | inline void from_json(const json & j, Default& x) { |
| 7532 | 7642 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7643 | + if (j.find("default") != j.end() && !j.at("default").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7533 | 7644 | x.set_default_default(j.at("default").get<int64_t>()); |
| 7534 | 7645 | } |
| 7535 | 7646 | |
| @@ -7540,6 +7651,7 @@ namespace quicktype { | ||
| 7540 | 7651 | |
| 7541 | 7652 | inline void from_json(const json & j, Delete& x) { |
| 7542 | 7653 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7654 | + if (j.find("delete") != j.end() && !j.at("delete").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7543 | 7655 | x.set_delete_delete(j.at("delete").get<int64_t>()); |
| 7544 | 7656 | } |
| 7545 | 7657 | |
| @@ -7550,6 +7662,7 @@ namespace quicktype { | ||
| 7550 | 7662 | |
| 7551 | 7663 | inline void from_json(const json & j, Do& x) { |
| 7552 | 7664 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7665 | + if (j.find("do") != j.end() && !j.at("do").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7553 | 7666 | x.set_do_do(j.at("do").get<int64_t>()); |
| 7554 | 7667 | } |
| 7555 | 7668 | |
| @@ -7560,6 +7673,7 @@ namespace quicktype { | ||
| 7560 | 7673 | |
| 7561 | 7674 | inline void from_json(const json & j, Double& x) { |
| 7562 | 7675 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7676 | + if (j.find("double") != j.end() && !j.at("double").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7563 | 7677 | x.set_double_double(j.at("double").get<int64_t>()); |
| 7564 | 7678 | } |
| 7565 | 7679 | |
| @@ -7570,6 +7684,7 @@ namespace quicktype { | ||
| 7570 | 7684 | |
| 7571 | 7685 | inline void from_json(const json & j, DynamicCast& x) { |
| 7572 | 7686 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7687 | + if (j.find("dynamic_cast") != j.end() && !j.at("dynamic_cast").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7573 | 7688 | x.set_dynamic_cast_dynamic_cast(j.at("dynamic_cast").get<int64_t>()); |
| 7574 | 7689 | } |
| 7575 | 7690 | |
| @@ -7580,6 +7695,7 @@ namespace quicktype { | ||
| 7580 | 7695 | |
| 7581 | 7696 | inline void from_json(const json & j, Else& x) { |
| 7582 | 7697 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7698 | + if (j.find("else") != j.end() && !j.at("else").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7583 | 7699 | x.set_else_else(j.at("else").get<int64_t>()); |
| 7584 | 7700 | } |
| 7585 | 7701 | |
| @@ -7590,6 +7706,7 @@ namespace quicktype { | ||
| 7590 | 7706 | |
| 7591 | 7707 | inline void from_json(const json & j, Enum& x) { |
| 7592 | 7708 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7709 | + if (j.find("enum") != j.end() && !j.at("enum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7593 | 7710 | x.set_enum_enum(j.at("enum").get<int64_t>()); |
| 7594 | 7711 | } |
| 7595 | 7712 | |
| @@ -7600,6 +7717,7 @@ namespace quicktype { | ||
| 7600 | 7717 | |
| 7601 | 7718 | inline void from_json(const json & j, Explicit& x) { |
| 7602 | 7719 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7720 | + if (j.find("explicit") != j.end() && !j.at("explicit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7603 | 7721 | x.set_explicit_explicit(j.at("explicit").get<int64_t>()); |
| 7604 | 7722 | } |
| 7605 | 7723 | |
| @@ -7610,6 +7728,7 @@ namespace quicktype { | ||
| 7610 | 7728 | |
| 7611 | 7729 | inline void from_json(const json & j, Export& x) { |
| 7612 | 7730 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7731 | + if (j.find("export") != j.end() && !j.at("export").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7613 | 7732 | x.set_export_export(j.at("export").get<int64_t>()); |
| 7614 | 7733 | } |
| 7615 | 7734 | |
| @@ -7620,6 +7739,7 @@ namespace quicktype { | ||
| 7620 | 7739 | |
| 7621 | 7740 | inline void from_json(const json & j, Extern& x) { |
| 7622 | 7741 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7742 | + if (j.find("extern") != j.end() && !j.at("extern").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7623 | 7743 | x.set_extern_extern(j.at("extern").get<int64_t>()); |
| 7624 | 7744 | } |
| 7625 | 7745 | |
| @@ -7630,6 +7750,7 @@ namespace quicktype { | ||
| 7630 | 7750 | |
| 7631 | 7751 | inline void from_json(const json & j, False& x) { |
| 7632 | 7752 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7753 | + if (j.find("False") != j.end() && !j.at("False").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7633 | 7754 | x.set_false_false(j.at("False").get<int64_t>()); |
| 7634 | 7755 | } |
| 7635 | 7756 | |
| @@ -7640,6 +7761,7 @@ namespace quicktype { | ||
| 7640 | 7761 | |
| 7641 | 7762 | inline void from_json(const json & j, Final& x) { |
| 7642 | 7763 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7764 | + if (j.find("final") != j.end() && !j.at("final").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7643 | 7765 | x.set_final_final(j.at("final").get<int64_t>()); |
| 7644 | 7766 | } |
| 7645 | 7767 | |
| @@ -7650,6 +7772,7 @@ namespace quicktype { | ||
| 7650 | 7772 | |
| 7651 | 7773 | inline void from_json(const json & j, Float& x) { |
| 7652 | 7774 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7775 | + if (j.find("float") != j.end() && !j.at("float").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7653 | 7776 | x.set_float_float(j.at("float").get<int64_t>()); |
| 7654 | 7777 | } |
| 7655 | 7778 | |
| @@ -7660,6 +7783,7 @@ namespace quicktype { | ||
| 7660 | 7783 | |
| 7661 | 7784 | inline void from_json(const json & j, For& x) { |
| 7662 | 7785 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7786 | + if (j.find("for") != j.end() && !j.at("for").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7663 | 7787 | x.set_for_for(j.at("for").get<int64_t>()); |
| 7664 | 7788 | } |
| 7665 | 7789 | |
| @@ -7670,6 +7794,7 @@ namespace quicktype { | ||
| 7670 | 7794 | |
| 7671 | 7795 | inline void from_json(const json & j, Friend& x) { |
| 7672 | 7796 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7797 | + if (j.find("friend") != j.end() && !j.at("friend").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7673 | 7798 | x.set_friend_friend(j.at("friend").get<int64_t>()); |
| 7674 | 7799 | } |
| 7675 | 7800 | |
| @@ -7680,6 +7805,7 @@ namespace quicktype { | ||
| 7680 | 7805 | |
| 7681 | 7806 | inline void from_json(const json & j, Goto& x) { |
| 7682 | 7807 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7808 | + if (j.find("goto") != j.end() && !j.at("goto").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7683 | 7809 | x.set_goto_goto(j.at("goto").get<int64_t>()); |
| 7684 | 7810 | } |
| 7685 | 7811 | |
| @@ -7690,6 +7816,7 @@ namespace quicktype { | ||
| 7690 | 7816 | |
| 7691 | 7817 | inline void from_json(const json & j, If& x) { |
| 7692 | 7818 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7819 | + if (j.find("if") != j.end() && !j.at("if").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7693 | 7820 | x.set_if_if(j.at("if").get<int64_t>()); |
| 7694 | 7821 | } |
| 7695 | 7822 | |
| @@ -7700,6 +7827,7 @@ namespace quicktype { | ||
| 7700 | 7827 | |
| 7701 | 7828 | inline void from_json(const json & j, Import& x) { |
| 7702 | 7829 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7830 | + if (j.find("import") != j.end() && !j.at("import").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7703 | 7831 | x.set_import_import(j.at("import").get<int64_t>()); |
| 7704 | 7832 | } |
| 7705 | 7833 | |
| @@ -7710,6 +7838,7 @@ namespace quicktype { | ||
| 7710 | 7838 | |
| 7711 | 7839 | inline void from_json(const json & j, Inline& x) { |
| 7712 | 7840 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7841 | + if (j.find("inline") != j.end() && !j.at("inline").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7713 | 7842 | x.set_inline_inline(j.at("inline").get<int64_t>()); |
| 7714 | 7843 | } |
| 7715 | 7844 | |
| @@ -7720,6 +7849,7 @@ namespace quicktype { | ||
| 7720 | 7849 | |
| 7721 | 7850 | inline void from_json(const json & j, Int& x) { |
| 7722 | 7851 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7852 | + if (j.find("int") != j.end() && !j.at("int").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7723 | 7853 | x.set_int_int(j.at("int").get<int64_t>()); |
| 7724 | 7854 | } |
| 7725 | 7855 | |
| @@ -7730,6 +7860,7 @@ namespace quicktype { | ||
| 7730 | 7860 | |
| 7731 | 7861 | inline void from_json(const json & j, FalseClass& x) { |
| 7732 | 7862 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 7863 | + if (j.find("false") != j.end() && !j.at("false").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7733 | 7864 | x.set_false_false(j.at("false").get<int64_t>()); |
| 7734 | 7865 | } |
| 7735 | 7866 | |
| @@ -7748,6 +7879,7 @@ namespace quicktype { | ||
| 7748 | 7879 | x.set_dict(j.at("dict").get<Dict>()); |
| 7749 | 7880 | x.set_dictionary(j.at("dictionary").get<Dictionary>()); |
| 7750 | 7881 | x.set_did_set(j.at("didSet").get<DidSet>()); |
| 7882 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7751 | 7883 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 7752 | 7884 | x.set_dynamic(j.at("dynamic").get<Dynamic>()); |
| 7753 | 7885 | x.set_elif(j.at("elif").get<Elif>()); |
| @@ -7880,6 +8012,7 @@ namespace quicktype { | ||
| 7880 | 8012 | |
| 7881 | 8013 | inline void from_json(const json & j, Is& x) { |
| 7882 | 8014 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8015 | + if (j.find("is") != j.end() && !j.at("is").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7883 | 8016 | x.set_is(j.at("is").get<int64_t>()); |
| 7884 | 8017 | } |
| 7885 | 8018 | |
| @@ -7890,6 +8023,7 @@ namespace quicktype { | ||
| 7890 | 8023 | |
| 7891 | 8024 | inline void from_json(const json & j, Iterable& x) { |
| 7892 | 8025 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8026 | + if (j.find("iterable") != j.end() && !j.at("iterable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7893 | 8027 | x.set_iterable(j.at("iterable").get<int64_t>()); |
| 7894 | 8028 | } |
| 7895 | 8029 | |
| @@ -7900,6 +8034,7 @@ namespace quicktype { | ||
| 7900 | 8034 | |
| 7901 | 8035 | inline void from_json(const json & j, Jdec& x) { |
| 7902 | 8036 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8037 | + if (j.find("jdec") != j.end() && !j.at("jdec").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7903 | 8038 | x.set_jdec(j.at("jdec").get<int64_t>()); |
| 7904 | 8039 | } |
| 7905 | 8040 | |
| @@ -7910,6 +8045,7 @@ namespace quicktype { | ||
| 7910 | 8045 | |
| 7911 | 8046 | inline void from_json(const json & j, Jenc& x) { |
| 7912 | 8047 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8048 | + if (j.find("jenc") != j.end() && !j.at("jenc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7913 | 8049 | x.set_jenc(j.at("jenc").get<int64_t>()); |
| 7914 | 8050 | } |
| 7915 | 8051 | |
| @@ -7920,6 +8056,7 @@ namespace quicktype { | ||
| 7920 | 8056 | |
| 7921 | 8057 | inline void from_json(const json & j, Jpipe& x) { |
| 7922 | 8058 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8059 | + if (j.find("jpipe") != j.end() && !j.at("jpipe").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7923 | 8060 | x.set_jpipe(j.at("jpipe").get<int64_t>()); |
| 7924 | 8061 | } |
| 7925 | 8062 | |
| @@ -7930,6 +8067,7 @@ namespace quicktype { | ||
| 7930 | 8067 | |
| 7931 | 8068 | inline void from_json(const json & j, Json& x) { |
| 7932 | 8069 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8070 | + if (j.find("json") != j.end() && !j.at("json").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7933 | 8071 | x.set_json(j.at("json").get<int64_t>()); |
| 7934 | 8072 | } |
| 7935 | 8073 | |
| @@ -7940,6 +8078,7 @@ namespace quicktype { | ||
| 7940 | 8078 | |
| 7941 | 8079 | inline void from_json(const json & j, JsonConverter& x) { |
| 7942 | 8080 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8081 | + if (j.find("json_converter") != j.end() && !j.at("json_converter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7943 | 8082 | x.set_json_converter(j.at("json_converter").get<int64_t>()); |
| 7944 | 8083 | } |
| 7945 | 8084 | |
| @@ -7950,6 +8089,7 @@ namespace quicktype { | ||
| 7950 | 8089 | |
| 7951 | 8090 | inline void from_json(const json & j, JsonSerializer& x) { |
| 7952 | 8091 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8092 | + if (j.find("json_serializer") != j.end() && !j.at("json_serializer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7953 | 8093 | x.set_json_serializer(j.at("json_serializer").get<int64_t>()); |
| 7954 | 8094 | } |
| 7955 | 8095 | |
| @@ -7960,6 +8100,7 @@ namespace quicktype { | ||
| 7960 | 8100 | |
| 7961 | 8101 | inline void from_json(const json & j, JsonToken& x) { |
| 7962 | 8102 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8103 | + if (j.find("json_token") != j.end() && !j.at("json_token").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7963 | 8104 | x.set_json_token(j.at("json_token").get<int64_t>()); |
| 7964 | 8105 | } |
| 7965 | 8106 | |
| @@ -7970,6 +8111,7 @@ namespace quicktype { | ||
| 7970 | 8111 | |
| 7971 | 8112 | inline void from_json(const json & j, JsonWriter& x) { |
| 7972 | 8113 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8114 | + if (j.find("json_writer") != j.end() && !j.at("json_writer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7973 | 8115 | x.set_json_writer(j.at("json_writer").get<int64_t>()); |
| 7974 | 8116 | } |
| 7975 | 8117 | |
| @@ -7980,6 +8122,7 @@ namespace quicktype { | ||
| 7980 | 8122 | |
| 7981 | 8123 | inline void from_json(const json & j, Lambda& x) { |
| 7982 | 8124 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8125 | + if (j.find("lambda") != j.end() && !j.at("lambda").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7983 | 8126 | x.set_lambda(j.at("lambda").get<int64_t>()); |
| 7984 | 8127 | } |
| 7985 | 8128 | |
| @@ -7990,6 +8133,7 @@ namespace quicktype { | ||
| 7990 | 8133 | |
| 7991 | 8134 | inline void from_json(const json & j, Lazy& x) { |
| 7992 | 8135 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8136 | + if (j.find("lazy") != j.end() && !j.at("lazy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 7993 | 8137 | x.set_lazy(j.at("lazy").get<int64_t>()); |
| 7994 | 8138 | } |
| 7995 | 8139 | |
| @@ -8000,6 +8144,7 @@ namespace quicktype { | ||
| 8000 | 8144 | |
| 8001 | 8145 | inline void from_json(const json & j, Left& x) { |
| 8002 | 8146 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8147 | + if (j.find("left") != j.end() && !j.at("left").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8003 | 8148 | x.set_left(j.at("left").get<int64_t>()); |
| 8004 | 8149 | } |
| 8005 | 8150 | |
| @@ -8010,6 +8155,7 @@ namespace quicktype { | ||
| 8010 | 8155 | |
| 8011 | 8156 | inline void from_json(const json & j, Let& x) { |
| 8012 | 8157 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8158 | + if (j.find("let") != j.end() && !j.at("let").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8013 | 8159 | x.set_let(j.at("let").get<int64_t>()); |
| 8014 | 8160 | } |
| 8015 | 8161 | |
| @@ -8020,6 +8166,7 @@ namespace quicktype { | ||
| 8020 | 8166 | |
| 8021 | 8167 | inline void from_json(const json & j, List& x) { |
| 8022 | 8168 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8169 | + if (j.find("list") != j.end() && !j.at("list").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8023 | 8170 | x.set_list(j.at("list").get<int64_t>()); |
| 8024 | 8171 | } |
| 8025 | 8172 | |
| @@ -8030,6 +8177,7 @@ namespace quicktype { | ||
| 8030 | 8177 | |
| 8031 | 8178 | inline void from_json(const json & j, Lock& x) { |
| 8032 | 8179 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8180 | + if (j.find("lock") != j.end() && !j.at("lock").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8033 | 8181 | x.set_lock(j.at("lock").get<int64_t>()); |
| 8034 | 8182 | } |
| 8035 | 8183 | |
| @@ -8040,6 +8188,7 @@ namespace quicktype { | ||
| 8040 | 8188 | |
| 8041 | 8189 | inline void from_json(const json & j, Map& x) { |
| 8042 | 8190 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8191 | + if (j.find("map") != j.end() && !j.at("map").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8043 | 8192 | x.set_map(j.at("map").get<int64_t>()); |
| 8044 | 8193 | } |
| 8045 | 8194 | |
| @@ -8050,6 +8199,7 @@ namespace quicktype { | ||
| 8050 | 8199 | |
| 8051 | 8200 | inline void from_json(const json & j, MetadataPropertyHandling& x) { |
| 8052 | 8201 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8202 | + if (j.find("metadata_property_handling") != j.end() && !j.at("metadata_property_handling").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8053 | 8203 | x.set_metadata_property_handling(j.at("metadata_property_handling").get<int64_t>()); |
| 8054 | 8204 | } |
| 8055 | 8205 | |
| @@ -8060,6 +8210,7 @@ namespace quicktype { | ||
| 8060 | 8210 | |
| 8061 | 8211 | inline void from_json(const json & j, Mutating& x) { |
| 8062 | 8212 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8213 | + if (j.find("mutating") != j.end() && !j.at("mutating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8063 | 8214 | x.set_mutating(j.at("mutating").get<int64_t>()); |
| 8064 | 8215 | } |
| 8065 | 8216 | |
| @@ -8070,6 +8221,7 @@ namespace quicktype { | ||
| 8070 | 8221 | |
| 8071 | 8222 | inline void from_json(const json & j, Native& x) { |
| 8072 | 8223 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8224 | + if (j.find("native") != j.end() && !j.at("native").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8073 | 8225 | x.set_native(j.at("native").get<int64_t>()); |
| 8074 | 8226 | } |
| 8075 | 8227 | |
| @@ -8080,6 +8232,7 @@ namespace quicktype { | ||
| 8080 | 8232 | |
| 8081 | 8233 | inline void from_json(const json & j, Newtonsoft& x) { |
| 8082 | 8234 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8235 | + if (j.find("newtonsoft") != j.end() && !j.at("newtonsoft").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8083 | 8236 | x.set_newtonsoft(j.at("newtonsoft").get<int64_t>()); |
| 8084 | 8237 | } |
| 8085 | 8238 | |
| @@ -8090,6 +8243,7 @@ namespace quicktype { | ||
| 8090 | 8243 | |
| 8091 | 8244 | inline void from_json(const json & j, Nil& x) { |
| 8092 | 8245 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8246 | + if (j.find("nil") != j.end() && !j.at("nil").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8093 | 8247 | x.set_nil(j.at("nil").get<int64_t>()); |
| 8094 | 8248 | } |
| 8095 | 8249 | |
| @@ -8100,6 +8254,7 @@ namespace quicktype { | ||
| 8100 | 8254 | |
| 8101 | 8255 | inline void from_json(const json & j, No& x) { |
| 8102 | 8256 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8257 | + if (j.find("NO") != j.end() && !j.at("NO").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8103 | 8258 | x.set_no(j.at("NO").get<int64_t>()); |
| 8104 | 8259 | } |
| 8105 | 8260 | |
| @@ -8110,6 +8265,7 @@ namespace quicktype { | ||
| 8110 | 8265 | |
| 8111 | 8266 | inline void from_json(const json & j, Nonatomic& x) { |
| 8112 | 8267 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8268 | + if (j.find("nonatomic") != j.end() && !j.at("nonatomic").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8113 | 8269 | x.set_nonatomic(j.at("nonatomic").get<int64_t>()); |
| 8114 | 8270 | } |
| 8115 | 8271 | |
| @@ -8120,6 +8276,7 @@ namespace quicktype { | ||
| 8120 | 8276 | |
| 8121 | 8277 | inline void from_json(const json & j, None& x) { |
| 8122 | 8278 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8279 | + if (j.find("None") != j.end() && !j.at("None").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8123 | 8280 | x.set_none(j.at("None").get<int64_t>()); |
| 8124 | 8281 | } |
| 8125 | 8282 | |
| @@ -8130,6 +8287,7 @@ namespace quicktype { | ||
| 8130 | 8287 | |
| 8131 | 8288 | inline void from_json(const json & j, Nonlocal& x) { |
| 8132 | 8289 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8290 | + if (j.find("nonlocal") != j.end() && !j.at("nonlocal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8133 | 8291 | x.set_nonlocal(j.at("nonlocal").get<int64_t>()); |
| 8134 | 8292 | } |
| 8135 | 8293 | |
| @@ -8140,6 +8298,7 @@ namespace quicktype { | ||
| 8140 | 8298 | |
| 8141 | 8299 | inline void from_json(const json & j, Nonmutating& x) { |
| 8142 | 8300 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8301 | + if (j.find("nonmutating") != j.end() && !j.at("nonmutating").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8143 | 8302 | x.set_nonmutating(j.at("nonmutating").get<int64_t>()); |
| 8144 | 8303 | } |
| 8145 | 8304 | |
| @@ -8150,6 +8309,7 @@ namespace quicktype { | ||
| 8150 | 8309 | |
| 8151 | 8310 | inline void from_json(const json & j, NsString& x) { |
| 8152 | 8311 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8312 | + if (j.find("NSString") != j.end() && !j.at("NSString").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8153 | 8313 | x.set_ns_string(j.at("NSString").get<int64_t>()); |
| 8154 | 8314 | } |
| 8155 | 8315 | |
| @@ -8160,6 +8320,7 @@ namespace quicktype { | ||
| 8160 | 8320 | |
| 8161 | 8321 | inline void from_json(const json & j, Null& x) { |
| 8162 | 8322 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8323 | + if (j.find("NULL") != j.end() && !j.at("NULL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8163 | 8324 | x.set_null(j.at("NULL").get<int64_t>()); |
| 8164 | 8325 | } |
| 8165 | 8326 | |
| @@ -8170,6 +8331,7 @@ namespace quicktype { | ||
| 8170 | 8331 | |
| 8171 | 8332 | inline void from_json(const json & j, Number& x) { |
| 8172 | 8333 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8334 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8173 | 8335 | x.set_number(j.at("number").get<int64_t>()); |
| 8174 | 8336 | } |
| 8175 | 8337 | |
| @@ -8180,6 +8342,7 @@ namespace quicktype { | ||
| 8180 | 8342 | |
| 8181 | 8343 | inline void from_json(const json & j, Long& x) { |
| 8182 | 8344 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8345 | + if (j.find("long") != j.end() && !j.at("long").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8183 | 8346 | x.set_long_long(j.at("long").get<int64_t>()); |
| 8184 | 8347 | } |
| 8185 | 8348 | |
| @@ -8190,6 +8353,7 @@ namespace quicktype { | ||
| 8190 | 8353 | |
| 8191 | 8354 | inline void from_json(const json & j, Module& x) { |
| 8192 | 8355 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8356 | + if (j.find("module") != j.end() && !j.at("module").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8193 | 8357 | x.set_module_module(j.at("module").get<int64_t>()); |
| 8194 | 8358 | } |
| 8195 | 8359 | |
| @@ -8200,6 +8364,7 @@ namespace quicktype { | ||
| 8200 | 8364 | |
| 8201 | 8365 | inline void from_json(const json & j, Mutable& x) { |
| 8202 | 8366 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8367 | + if (j.find("mutable") != j.end() && !j.at("mutable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8203 | 8368 | x.set_mutable_mutable(j.at("mutable").get<int64_t>()); |
| 8204 | 8369 | } |
| 8205 | 8370 | |
| @@ -8210,6 +8375,7 @@ namespace quicktype { | ||
| 8210 | 8375 | |
| 8211 | 8376 | inline void from_json(const json & j, Namespace& x) { |
| 8212 | 8377 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8378 | + if (j.find("namespace") != j.end() && !j.at("namespace").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8213 | 8379 | x.set_namespace_namespace(j.at("namespace").get<int64_t>()); |
| 8214 | 8380 | } |
| 8215 | 8381 | |
| @@ -8220,6 +8386,7 @@ namespace quicktype { | ||
| 8220 | 8386 | |
| 8221 | 8387 | inline void from_json(const json & j, New& x) { |
| 8222 | 8388 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8389 | + if (j.find("new") != j.end() && !j.at("new").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8223 | 8390 | x.set_new_new(j.at("new").get<int64_t>()); |
| 8224 | 8391 | } |
| 8225 | 8392 | |
| @@ -8230,6 +8397,7 @@ namespace quicktype { | ||
| 8230 | 8397 | |
| 8231 | 8398 | inline void from_json(const json & j, Noexcept& x) { |
| 8232 | 8399 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8400 | + if (j.find("noexcept") != j.end() && !j.at("noexcept").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8233 | 8401 | x.set_noexcept_noexcept(j.at("noexcept").get<int64_t>()); |
| 8234 | 8402 | } |
| 8235 | 8403 | |
| @@ -8240,6 +8408,7 @@ namespace quicktype { | ||
| 8240 | 8408 | |
| 8241 | 8409 | inline void from_json(const json & j, NoneClass& x) { |
| 8242 | 8410 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8411 | + if (j.find("none") != j.end() && !j.at("none").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8243 | 8412 | x.set_none(j.at("none").get<int64_t>()); |
| 8244 | 8413 | } |
| 8245 | 8414 | |
| @@ -8250,6 +8419,7 @@ namespace quicktype { | ||
| 8250 | 8419 | |
| 8251 | 8420 | inline void from_json(const json & j, Not& x) { |
| 8252 | 8421 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8422 | + if (j.find("not") != j.end() && !j.at("not").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8253 | 8423 | x.set_not_not(j.at("not").get<int64_t>()); |
| 8254 | 8424 | } |
| 8255 | 8425 | |
| @@ -8260,6 +8430,7 @@ namespace quicktype { | ||
| 8260 | 8430 | |
| 8261 | 8431 | inline void from_json(const json & j, NotEq& x) { |
| 8262 | 8432 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8433 | + if (j.find("not_eq") != j.end() && !j.at("not_eq").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8263 | 8434 | x.set_not_eq_not_eq(j.at("not_eq").get<int64_t>()); |
| 8264 | 8435 | } |
| 8265 | 8436 | |
| @@ -8270,6 +8441,7 @@ namespace quicktype { | ||
| 8270 | 8441 | |
| 8271 | 8442 | inline void from_json(const json & j, NullClass& x) { |
| 8272 | 8443 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8444 | + if (j.find("null") != j.end() && !j.at("null").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8273 | 8445 | x.set_null(j.at("null").get<int64_t>()); |
| 8274 | 8446 | } |
| 8275 | 8447 | |
| @@ -8280,6 +8452,7 @@ namespace quicktype { | ||
| 8280 | 8452 | |
| 8281 | 8453 | inline void from_json(const json & j, Nullptr& x) { |
| 8282 | 8454 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8455 | + if (j.find("nullptr") != j.end() && !j.at("nullptr").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8283 | 8456 | x.set_nullptr_nullptr(j.at("nullptr").get<int64_t>()); |
| 8284 | 8457 | } |
| 8285 | 8458 | |
| @@ -8290,6 +8463,7 @@ namespace quicktype { | ||
| 8290 | 8463 | |
| 8291 | 8464 | inline void from_json(const json & j, Operator& x) { |
| 8292 | 8465 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8466 | + if (j.find("operator") != j.end() && !j.at("operator").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8293 | 8467 | x.set_operator_operator(j.at("operator").get<int64_t>()); |
| 8294 | 8468 | } |
| 8295 | 8469 | |
| @@ -8300,6 +8474,7 @@ namespace quicktype { | ||
| 8300 | 8474 | |
| 8301 | 8475 | inline void from_json(const json & j, Or& x) { |
| 8302 | 8476 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8477 | + if (j.find("or") != j.end() && !j.at("or").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8303 | 8478 | x.set_or_or(j.at("or").get<int64_t>()); |
| 8304 | 8479 | } |
| 8305 | 8480 | |
| @@ -8310,6 +8485,7 @@ namespace quicktype { | ||
| 8310 | 8485 | |
| 8311 | 8486 | inline void from_json(const json & j, OrEq& x) { |
| 8312 | 8487 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8488 | + if (j.find("or_eq") != j.end() && !j.at("or_eq").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8313 | 8489 | x.set_or_eq_or_eq(j.at("or_eq").get<int64_t>()); |
| 8314 | 8490 | } |
| 8315 | 8491 | |
| @@ -8320,6 +8496,7 @@ namespace quicktype { | ||
| 8320 | 8496 | |
| 8321 | 8497 | inline void from_json(const json & j, Override& x) { |
| 8322 | 8498 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8499 | + if (j.find("override") != j.end() && !j.at("override").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8323 | 8500 | x.set_override_override(j.at("override").get<int64_t>()); |
| 8324 | 8501 | } |
| 8325 | 8502 | |
| @@ -8330,6 +8507,7 @@ namespace quicktype { | ||
| 8330 | 8507 | |
| 8331 | 8508 | inline void from_json(const json & j, Private& x) { |
| 8332 | 8509 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8510 | + if (j.find("private") != j.end() && !j.at("private").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8333 | 8511 | x.set_private_private(j.at("private").get<int64_t>()); |
| 8334 | 8512 | } |
| 8335 | 8513 | |
| @@ -8340,6 +8518,7 @@ namespace quicktype { | ||
| 8340 | 8518 | |
| 8341 | 8519 | inline void from_json(const json & j, Protected& x) { |
| 8342 | 8520 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8521 | + if (j.find("protected") != j.end() && !j.at("protected").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8343 | 8522 | x.set_protected_protected(j.at("protected").get<int64_t>()); |
| 8344 | 8523 | } |
| 8345 | 8524 | |
| @@ -8350,6 +8529,7 @@ namespace quicktype { | ||
| 8350 | 8529 | |
| 8351 | 8530 | inline void from_json(const json & j, ProtocolClass& x) { |
| 8352 | 8531 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8532 | + if (j.find("protocol") != j.end() && !j.at("protocol").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8353 | 8533 | x.set_protocol(j.at("protocol").get<int64_t>()); |
| 8354 | 8534 | } |
| 8355 | 8535 | |
| @@ -8360,6 +8540,7 @@ namespace quicktype { | ||
| 8360 | 8540 | |
| 8361 | 8541 | inline void from_json(const json & j, Object& x) { |
| 8362 | 8542 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8543 | + if (j.find("object") != j.end() && !j.at("object").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8363 | 8544 | x.set_object(j.at("object").get<int64_t>()); |
| 8364 | 8545 | } |
| 8365 | 8546 | |
| @@ -8370,6 +8551,7 @@ namespace quicktype { | ||
| 8370 | 8551 | |
| 8371 | 8552 | inline void from_json(const json & j, Of& x) { |
| 8372 | 8553 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8554 | + if (j.find("of") != j.end() && !j.at("of").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8373 | 8555 | x.set_of(j.at("of").get<int64_t>()); |
| 8374 | 8556 | } |
| 8375 | 8557 | |
| @@ -8380,6 +8562,7 @@ namespace quicktype { | ||
| 8380 | 8562 | |
| 8381 | 8563 | inline void from_json(const json & j, Oneway& x) { |
| 8382 | 8564 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8565 | + if (j.find("oneway") != j.end() && !j.at("oneway").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8383 | 8566 | x.set_oneway(j.at("oneway").get<int64_t>()); |
| 8384 | 8567 | } |
| 8385 | 8568 | |
| @@ -8390,6 +8573,7 @@ namespace quicktype { | ||
| 8390 | 8573 | |
| 8391 | 8574 | inline void from_json(const json & j, Open& x) { |
| 8392 | 8575 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8576 | + if (j.find("open") != j.end() && !j.at("open").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8393 | 8577 | x.set_open(j.at("open").get<int64_t>()); |
| 8394 | 8578 | } |
| 8395 | 8579 | |
| @@ -8400,6 +8584,7 @@ namespace quicktype { | ||
| 8400 | 8584 | |
| 8401 | 8585 | inline void from_json(const json & j, Optional& x) { |
| 8402 | 8586 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8587 | + if (j.find("optional") != j.end() && !j.at("optional").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8403 | 8588 | x.set_optional(j.at("optional").get<int64_t>()); |
| 8404 | 8589 | } |
| 8405 | 8590 | |
| @@ -8410,6 +8595,7 @@ namespace quicktype { | ||
| 8410 | 8595 | |
| 8411 | 8596 | inline void from_json(const json & j, Out& x) { |
| 8412 | 8597 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8598 | + if (j.find("out") != j.end() && !j.at("out").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8413 | 8599 | x.set_out(j.at("out").get<int64_t>()); |
| 8414 | 8600 | } |
| 8415 | 8601 | |
| @@ -8420,6 +8606,7 @@ namespace quicktype { | ||
| 8420 | 8606 | |
| 8421 | 8607 | inline void from_json(const json & j, Package& x) { |
| 8422 | 8608 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8609 | + if (j.find("package") != j.end() && !j.at("package").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8423 | 8610 | x.set_package(j.at("package").get<int64_t>()); |
| 8424 | 8611 | } |
| 8425 | 8612 | |
| @@ -8430,6 +8617,7 @@ namespace quicktype { | ||
| 8430 | 8617 | |
| 8431 | 8618 | inline void from_json(const json & j, Params& x) { |
| 8432 | 8619 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8620 | + if (j.find("params") != j.end() && !j.at("params").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8433 | 8621 | x.set_params(j.at("params").get<int64_t>()); |
| 8434 | 8622 | } |
| 8435 | 8623 | |
| @@ -8440,6 +8628,7 @@ namespace quicktype { | ||
| 8440 | 8628 | |
| 8441 | 8629 | inline void from_json(const json & j, Pass& x) { |
| 8442 | 8630 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8631 | + if (j.find("pass") != j.end() && !j.at("pass").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8443 | 8632 | x.set_pass(j.at("pass").get<int64_t>()); |
| 8444 | 8633 | } |
| 8445 | 8634 | |
| @@ -8450,6 +8639,7 @@ namespace quicktype { | ||
| 8450 | 8639 | |
| 8451 | 8640 | inline void from_json(const json & j, Port& x) { |
| 8452 | 8641 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8642 | + if (j.find("port") != j.end() && !j.at("port").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8453 | 8643 | x.set_port(j.at("port").get<int64_t>()); |
| 8454 | 8644 | } |
| 8455 | 8645 | |
| @@ -8460,6 +8650,7 @@ namespace quicktype { | ||
| 8460 | 8650 | |
| 8461 | 8651 | inline void from_json(const json & j, Postfix& x) { |
| 8462 | 8652 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8653 | + if (j.find("postfix") != j.end() && !j.at("postfix").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8463 | 8654 | x.set_postfix(j.at("postfix").get<int64_t>()); |
| 8464 | 8655 | } |
| 8465 | 8656 | |
| @@ -8470,6 +8661,7 @@ namespace quicktype { | ||
| 8470 | 8661 | |
| 8471 | 8662 | inline void from_json(const json & j, Precedence& x) { |
| 8472 | 8663 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8664 | + if (j.find("precedence") != j.end() && !j.at("precedence").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8473 | 8665 | x.set_precedence(j.at("precedence").get<int64_t>()); |
| 8474 | 8666 | } |
| 8475 | 8667 | |
| @@ -8480,6 +8672,7 @@ namespace quicktype { | ||
| 8480 | 8672 | |
| 8481 | 8673 | inline void from_json(const json & j, Prefix& x) { |
| 8482 | 8674 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8675 | + if (j.find("prefix") != j.end() && !j.at("prefix").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8483 | 8676 | x.set_prefix(j.at("prefix").get<int64_t>()); |
| 8484 | 8677 | } |
| 8485 | 8678 | |
| @@ -8490,6 +8683,7 @@ namespace quicktype { | ||
| 8490 | 8683 | |
| 8491 | 8684 | inline void from_json(const json & j, Print& x) { |
| 8492 | 8685 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8686 | + if (j.find("print") != j.end() && !j.at("print").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8493 | 8687 | x.set_print(j.at("print").get<int64_t>()); |
| 8494 | 8688 | } |
| 8495 | 8689 | |
| @@ -8500,6 +8694,7 @@ namespace quicktype { | ||
| 8500 | 8694 | |
| 8501 | 8695 | inline void from_json(const json & j, PrintMembers& x) { |
| 8502 | 8696 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8697 | + if (j.find("printMembers") != j.end() && !j.at("printMembers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8503 | 8698 | x.set_print_members(j.at("printMembers").get<int64_t>()); |
| 8504 | 8699 | } |
| 8505 | 8700 | |
| @@ -8510,6 +8705,7 @@ namespace quicktype { | ||
| 8510 | 8705 | |
| 8511 | 8706 | inline void from_json(const json & j, Printf& x) { |
| 8512 | 8707 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8708 | + if (j.find("printf") != j.end() && !j.at("printf").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8513 | 8709 | x.set_printf(j.at("printf").get<int64_t>()); |
| 8514 | 8710 | } |
| 8515 | 8711 | |
| @@ -8520,6 +8716,7 @@ namespace quicktype { | ||
| 8520 | 8716 | |
| 8521 | 8717 | inline void from_json(const json & j, Protocol& x) { |
| 8522 | 8718 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8719 | + if (j.find("Protocol") != j.end() && !j.at("Protocol").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8523 | 8720 | x.set_protocol(j.at("Protocol").get<int64_t>()); |
| 8524 | 8721 | } |
| 8525 | 8722 | |
| @@ -8530,6 +8727,7 @@ namespace quicktype { | ||
| 8530 | 8727 | |
| 8531 | 8728 | inline void from_json(const json & j, Obj3& x) { |
| 8532 | 8729 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8730 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8533 | 8731 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 8534 | 8732 | x.set_is(j.at("is").get<Is>()); |
| 8535 | 8733 | x.set_iterable(j.at("iterable").get<Iterable>()); |
| @@ -8670,6 +8868,7 @@ namespace quicktype { | ||
| 8670 | 8868 | |
| 8671 | 8869 | inline void from_json(const json & j, Public& x) { |
| 8672 | 8870 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8871 | + if (j.find("public") != j.end() && !j.at("public").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8673 | 8872 | x.set_public_public(j.at("public").get<int64_t>()); |
| 8674 | 8873 | } |
| 8675 | 8874 | |
| @@ -8680,6 +8879,7 @@ namespace quicktype { | ||
| 8680 | 8879 | |
| 8681 | 8880 | inline void from_json(const json & j, Register& x) { |
| 8682 | 8881 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8882 | + if (j.find("register") != j.end() && !j.at("register").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8683 | 8883 | x.set_register_register(j.at("register").get<int64_t>()); |
| 8684 | 8884 | } |
| 8685 | 8885 | |
| @@ -8690,6 +8890,7 @@ namespace quicktype { | ||
| 8690 | 8890 | |
| 8691 | 8891 | inline void from_json(const json & j, ReinterpretCast& x) { |
| 8692 | 8892 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8893 | + if (j.find("reinterpret_cast") != j.end() && !j.at("reinterpret_cast").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8693 | 8894 | x.set_reinterpret_cast_reinterpret_cast(j.at("reinterpret_cast").get<int64_t>()); |
| 8694 | 8895 | } |
| 8695 | 8896 | |
| @@ -8700,6 +8901,7 @@ namespace quicktype { | ||
| 8700 | 8901 | |
| 8701 | 8902 | inline void from_json(const json & j, Requires& x) { |
| 8702 | 8903 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8904 | + if (j.find("requires") != j.end() && !j.at("requires").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8703 | 8905 | x.set_requires_requires(j.at("requires").get<int64_t>()); |
| 8704 | 8906 | } |
| 8705 | 8907 | |
| @@ -8710,6 +8912,7 @@ namespace quicktype { | ||
| 8710 | 8912 | |
| 8711 | 8913 | inline void from_json(const json & j, Return& x) { |
| 8712 | 8914 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8915 | + if (j.find("return") != j.end() && !j.at("return").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8713 | 8916 | x.set_return_return(j.at("return").get<int64_t>()); |
| 8714 | 8917 | } |
| 8715 | 8918 | |
| @@ -8720,6 +8923,7 @@ namespace quicktype { | ||
| 8720 | 8923 | |
| 8721 | 8924 | inline void from_json(const json & j, SelfClass& x) { |
| 8722 | 8925 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8926 | + if (j.find("self") != j.end() && !j.at("self").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8723 | 8927 | x.set_self(j.at("self").get<int64_t>()); |
| 8724 | 8928 | } |
| 8725 | 8929 | |
| @@ -8730,6 +8934,7 @@ namespace quicktype { | ||
| 8730 | 8934 | |
| 8731 | 8935 | inline void from_json(const json & j, Short& x) { |
| 8732 | 8936 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8937 | + if (j.find("short") != j.end() && !j.at("short").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8733 | 8938 | x.set_short_short(j.at("short").get<int64_t>()); |
| 8734 | 8939 | } |
| 8735 | 8940 | |
| @@ -8740,6 +8945,7 @@ namespace quicktype { | ||
| 8740 | 8945 | |
| 8741 | 8946 | inline void from_json(const json & j, Signed& x) { |
| 8742 | 8947 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8948 | + if (j.find("signed") != j.end() && !j.at("signed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8743 | 8949 | x.set_signed_signed(j.at("signed").get<int64_t>()); |
| 8744 | 8950 | } |
| 8745 | 8951 | |
| @@ -8750,6 +8956,7 @@ namespace quicktype { | ||
| 8750 | 8956 | |
| 8751 | 8957 | inline void from_json(const json & j, Sizeof& x) { |
| 8752 | 8958 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8959 | + if (j.find("sizeof") != j.end() && !j.at("sizeof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8753 | 8960 | x.set_sizeof_sizeof(j.at("sizeof").get<int64_t>()); |
| 8754 | 8961 | } |
| 8755 | 8962 | |
| @@ -8760,6 +8967,7 @@ namespace quicktype { | ||
| 8760 | 8967 | |
| 8761 | 8968 | inline void from_json(const json & j, Static& x) { |
| 8762 | 8969 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8970 | + if (j.find("static") != j.end() && !j.at("static").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8763 | 8971 | x.set_static_static(j.at("static").get<int64_t>()); |
| 8764 | 8972 | } |
| 8765 | 8973 | |
| @@ -8770,6 +8978,7 @@ namespace quicktype { | ||
| 8770 | 8978 | |
| 8771 | 8979 | inline void from_json(const json & j, StaticAssert& x) { |
| 8772 | 8980 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8981 | + if (j.find("static_assert") != j.end() && !j.at("static_assert").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8773 | 8982 | x.set_static_assert_static_assert(j.at("static_assert").get<int64_t>()); |
| 8774 | 8983 | } |
| 8775 | 8984 | |
| @@ -8780,6 +8989,7 @@ namespace quicktype { | ||
| 8780 | 8989 | |
| 8781 | 8990 | inline void from_json(const json & j, StaticCast& x) { |
| 8782 | 8991 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 8992 | + if (j.find("static_cast") != j.end() && !j.at("static_cast").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8783 | 8993 | x.set_static_cast_static_cast(j.at("static_cast").get<int64_t>()); |
| 8784 | 8994 | } |
| 8785 | 8995 | |
| @@ -8790,6 +9000,7 @@ namespace quicktype { | ||
| 8790 | 9000 | |
| 8791 | 9001 | inline void from_json(const json & j, Struct& x) { |
| 8792 | 9002 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9003 | + if (j.find("struct") != j.end() && !j.at("struct").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8793 | 9004 | x.set_struct_struct(j.at("struct").get<int64_t>()); |
| 8794 | 9005 | } |
| 8795 | 9006 | |
| @@ -8800,6 +9011,7 @@ namespace quicktype { | ||
| 8800 | 9011 | |
| 8801 | 9012 | inline void from_json(const json & j, Switch& x) { |
| 8802 | 9013 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9014 | + if (j.find("switch") != j.end() && !j.at("switch").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8803 | 9015 | x.set_switch_switch(j.at("switch").get<int64_t>()); |
| 8804 | 9016 | } |
| 8805 | 9017 | |
| @@ -8810,6 +9022,7 @@ namespace quicktype { | ||
| 8810 | 9022 | |
| 8811 | 9023 | inline void from_json(const json & j, Synchronized& x) { |
| 8812 | 9024 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9025 | + if (j.find("synchronized") != j.end() && !j.at("synchronized").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8813 | 9026 | x.set_synchronized_synchronized(j.at("synchronized").get<int64_t>()); |
| 8814 | 9027 | } |
| 8815 | 9028 | |
| @@ -8820,6 +9033,7 @@ namespace quicktype { | ||
| 8820 | 9033 | |
| 8821 | 9034 | inline void from_json(const json & j, Template& x) { |
| 8822 | 9035 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9036 | + if (j.find("template") != j.end() && !j.at("template").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8823 | 9037 | x.set_template_template(j.at("template").get<int64_t>()); |
| 8824 | 9038 | } |
| 8825 | 9039 | |
| @@ -8830,6 +9044,7 @@ namespace quicktype { | ||
| 8830 | 9044 | |
| 8831 | 9045 | inline void from_json(const json & j, This& x) { |
| 8832 | 9046 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9047 | + if (j.find("this") != j.end() && !j.at("this").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8833 | 9048 | x.set_this_this(j.at("this").get<int64_t>()); |
| 8834 | 9049 | } |
| 8835 | 9050 | |
| @@ -8840,6 +9055,7 @@ namespace quicktype { | ||
| 8840 | 9055 | |
| 8841 | 9056 | inline void from_json(const json & j, ThreadLocal& x) { |
| 8842 | 9057 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9058 | + if (j.find("thread_local") != j.end() && !j.at("thread_local").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8843 | 9059 | x.set_thread_local_thread_local(j.at("thread_local").get<int64_t>()); |
| 8844 | 9060 | } |
| 8845 | 9061 | |
| @@ -8850,6 +9066,7 @@ namespace quicktype { | ||
| 8850 | 9066 | |
| 8851 | 9067 | inline void from_json(const json & j, Throw& x) { |
| 8852 | 9068 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9069 | + if (j.find("throw") != j.end() && !j.at("throw").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8853 | 9070 | x.set_throw_throw(j.at("throw").get<int64_t>()); |
| 8854 | 9071 | } |
| 8855 | 9072 | |
| @@ -8860,6 +9077,7 @@ namespace quicktype { | ||
| 8860 | 9077 | |
| 8861 | 9078 | inline void from_json(const json & j, True& x) { |
| 8862 | 9079 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9080 | + if (j.find("True") != j.end() && !j.at("True").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8863 | 9081 | x.set_true_true(j.at("True").get<int64_t>()); |
| 8864 | 9082 | } |
| 8865 | 9083 | |
| @@ -8870,6 +9088,7 @@ namespace quicktype { | ||
| 8870 | 9088 | |
| 8871 | 9089 | inline void from_json(const json & j, Try& x) { |
| 8872 | 9090 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9091 | + if (j.find("try") != j.end() && !j.at("try").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8873 | 9092 | x.set_try_try(j.at("try").get<int64_t>()); |
| 8874 | 9093 | } |
| 8875 | 9094 | |
| @@ -8880,6 +9099,7 @@ namespace quicktype { | ||
| 8880 | 9099 | |
| 8881 | 9100 | inline void from_json(const json & j, TypeClass& x) { |
| 8882 | 9101 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9102 | + if (j.find("type") != j.end() && !j.at("type").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8883 | 9103 | x.set_type(j.at("type").get<int64_t>()); |
| 8884 | 9104 | } |
| 8885 | 9105 | |
| @@ -8890,6 +9110,7 @@ namespace quicktype { | ||
| 8890 | 9110 | |
| 8891 | 9111 | inline void from_json(const json & j, Typedef& x) { |
| 8892 | 9112 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9113 | + if (j.find("typedef") != j.end() && !j.at("typedef").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8893 | 9114 | x.set_typedef_typedef(j.at("typedef").get<int64_t>()); |
| 8894 | 9115 | } |
| 8895 | 9116 | |
| @@ -8900,6 +9121,7 @@ namespace quicktype { | ||
| 8900 | 9121 | |
| 8901 | 9122 | inline void from_json(const json & j, Typeid& x) { |
| 8902 | 9123 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9124 | + if (j.find("typeid") != j.end() && !j.at("typeid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8903 | 9125 | x.set_typeid_typeid(j.at("typeid").get<int64_t>()); |
| 8904 | 9126 | } |
| 8905 | 9127 | |
| @@ -8910,6 +9132,7 @@ namespace quicktype { | ||
| 8910 | 9132 | |
| 8911 | 9133 | inline void from_json(const json & j, Typename& x) { |
| 8912 | 9134 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9135 | + if (j.find("typename") != j.end() && !j.at("typename").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8913 | 9136 | x.set_typename_typename(j.at("typename").get<int64_t>()); |
| 8914 | 9137 | } |
| 8915 | 9138 | |
| @@ -8920,6 +9143,7 @@ namespace quicktype { | ||
| 8920 | 9143 | |
| 8921 | 9144 | inline void from_json(const json & j, TrueClass& x) { |
| 8922 | 9145 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9146 | + if (j.find("true") != j.end() && !j.at("true").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8923 | 9147 | x.set_true_true(j.at("true").get<int64_t>()); |
| 8924 | 9148 | } |
| 8925 | 9149 | |
| @@ -8930,6 +9154,7 @@ namespace quicktype { | ||
| 8930 | 9154 | |
| 8931 | 9155 | inline void from_json(const json & j, Quicktype& x) { |
| 8932 | 9156 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9157 | + if (j.find("quicktype") != j.end() && !j.at("quicktype").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8933 | 9158 | x.set_quicktype(j.at("quicktype").get<int64_t>()); |
| 8934 | 9159 | } |
| 8935 | 9160 | |
| @@ -8940,6 +9165,7 @@ namespace quicktype { | ||
| 8940 | 9165 | |
| 8941 | 9166 | inline void from_json(const json & j, Raise& x) { |
| 8942 | 9167 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9168 | + if (j.find("raise") != j.end() && !j.at("raise").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8943 | 9169 | x.set_raise(j.at("raise").get<int64_t>()); |
| 8944 | 9170 | } |
| 8945 | 9171 | |
| @@ -8950,6 +9176,7 @@ namespace quicktype { | ||
| 8950 | 9176 | |
| 8951 | 9177 | inline void from_json(const json & j, Range& x) { |
| 8952 | 9178 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9179 | + if (j.find("range") != j.end() && !j.at("range").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8953 | 9180 | x.set_range(j.at("range").get<int64_t>()); |
| 8954 | 9181 | } |
| 8955 | 9182 | |
| @@ -8960,6 +9187,7 @@ namespace quicktype { | ||
| 8960 | 9187 | |
| 8961 | 9188 | inline void from_json(const json & j, Readonly& x) { |
| 8962 | 9189 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9190 | + if (j.find("readonly") != j.end() && !j.at("readonly").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8963 | 9191 | x.set_readonly(j.at("readonly").get<int64_t>()); |
| 8964 | 9192 | } |
| 8965 | 9193 | |
| @@ -8970,6 +9198,7 @@ namespace quicktype { | ||
| 8970 | 9198 | |
| 8971 | 9199 | inline void from_json(const json & j, Ref& x) { |
| 8972 | 9200 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9201 | + if (j.find("ref") != j.end() && !j.at("ref").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8973 | 9202 | x.set_ref(j.at("ref").get<int64_t>()); |
| 8974 | 9203 | } |
| 8975 | 9204 | |
| @@ -8980,6 +9209,7 @@ namespace quicktype { | ||
| 8980 | 9209 | |
| 8981 | 9210 | inline void from_json(const json & j, Repeat& x) { |
| 8982 | 9211 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9212 | + if (j.find("repeat") != j.end() && !j.at("repeat").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8983 | 9213 | x.set_repeat(j.at("repeat").get<int64_t>()); |
| 8984 | 9214 | } |
| 8985 | 9215 | |
| @@ -8990,6 +9220,7 @@ namespace quicktype { | ||
| 8990 | 9220 | |
| 8991 | 9221 | inline void from_json(const json & j, Require& x) { |
| 8992 | 9222 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9223 | + if (j.find("require") != j.end() && !j.at("require").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 8993 | 9224 | x.set_require(j.at("require").get<int64_t>()); |
| 8994 | 9225 | } |
| 8995 | 9226 | |
| @@ -9000,6 +9231,7 @@ namespace quicktype { | ||
| 9000 | 9231 | |
| 9001 | 9232 | inline void from_json(const json & j, Required& x) { |
| 9002 | 9233 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9234 | + if (j.find("required") != j.end() && !j.at("required").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9003 | 9235 | x.set_required(j.at("required").get<int64_t>()); |
| 9004 | 9236 | } |
| 9005 | 9237 | |
| @@ -9010,6 +9242,7 @@ namespace quicktype { | ||
| 9010 | 9242 | |
| 9011 | 9243 | inline void from_json(const json & j, Restrict& x) { |
| 9012 | 9244 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9245 | + if (j.find("restrict") != j.end() && !j.at("restrict").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9013 | 9246 | x.set_restrict(j.at("restrict").get<int64_t>()); |
| 9014 | 9247 | } |
| 9015 | 9248 | |
| @@ -9020,6 +9253,7 @@ namespace quicktype { | ||
| 9020 | 9253 | |
| 9021 | 9254 | inline void from_json(const json & j, Retain& x) { |
| 9022 | 9255 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9256 | + if (j.find("retain") != j.end() && !j.at("retain").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9023 | 9257 | x.set_retain(j.at("retain").get<int64_t>()); |
| 9024 | 9258 | } |
| 9025 | 9259 | |
| @@ -9030,6 +9264,7 @@ namespace quicktype { | ||
| 9030 | 9264 | |
| 9031 | 9265 | inline void from_json(const json & j, Rethrows& x) { |
| 9032 | 9266 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9267 | + if (j.find("rethrows") != j.end() && !j.at("rethrows").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9033 | 9268 | x.set_rethrows(j.at("rethrows").get<int64_t>()); |
| 9034 | 9269 | } |
| 9035 | 9270 | |
| @@ -9040,6 +9275,7 @@ namespace quicktype { | ||
| 9040 | 9275 | |
| 9041 | 9276 | inline void from_json(const json & j, Right& x) { |
| 9042 | 9277 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9278 | + if (j.find("right") != j.end() && !j.at("right").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9043 | 9279 | x.set_right(j.at("right").get<int64_t>()); |
| 9044 | 9280 | } |
| 9045 | 9281 | |
| @@ -9050,6 +9286,7 @@ namespace quicktype { | ||
| 9050 | 9286 | |
| 9051 | 9287 | inline void from_json(const json & j, Sbyte& x) { |
| 9052 | 9288 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9289 | + if (j.find("sbyte") != j.end() && !j.at("sbyte").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9053 | 9290 | x.set_sbyte(j.at("sbyte").get<int64_t>()); |
| 9054 | 9291 | } |
| 9055 | 9292 | |
| @@ -9060,6 +9297,7 @@ namespace quicktype { | ||
| 9060 | 9297 | |
| 9061 | 9298 | inline void from_json(const json & j, Sealed& x) { |
| 9062 | 9299 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9300 | + if (j.find("sealed") != j.end() && !j.at("sealed").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9063 | 9301 | x.set_sealed(j.at("sealed").get<int64_t>()); |
| 9064 | 9302 | } |
| 9065 | 9303 | |
| @@ -9070,6 +9308,7 @@ namespace quicktype { | ||
| 9070 | 9308 | |
| 9071 | 9309 | inline void from_json(const json & j, Sel& x) { |
| 9072 | 9310 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9311 | + if (j.find("SEL") != j.end() && !j.at("SEL").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9073 | 9312 | x.set_sel(j.at("SEL").get<int64_t>()); |
| 9074 | 9313 | } |
| 9075 | 9314 | |
| @@ -9080,6 +9319,7 @@ namespace quicktype { | ||
| 9080 | 9319 | |
| 9081 | 9320 | inline void from_json(const json & j, Select& x) { |
| 9082 | 9321 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9322 | + if (j.find("select") != j.end() && !j.at("select").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9083 | 9323 | x.set_select(j.at("select").get<int64_t>()); |
| 9084 | 9324 | } |
| 9085 | 9325 | |
| @@ -9090,6 +9330,7 @@ namespace quicktype { | ||
| 9090 | 9330 | |
| 9091 | 9331 | inline void from_json(const json & j, Self& x) { |
| 9092 | 9332 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9333 | + if (j.find("Self") != j.end() && !j.at("Self").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9093 | 9334 | x.set_self(j.at("Self").get<int64_t>()); |
| 9094 | 9335 | } |
| 9095 | 9336 | |
| @@ -9100,6 +9341,7 @@ namespace quicktype { | ||
| 9100 | 9341 | |
| 9101 | 9342 | inline void from_json(const json & j, Serialize& x) { |
| 9102 | 9343 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9344 | + if (j.find("serialize") != j.end() && !j.at("serialize").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9103 | 9345 | x.set_serialize(j.at("serialize").get<int64_t>()); |
| 9104 | 9346 | } |
| 9105 | 9347 | |
| @@ -9110,6 +9352,7 @@ namespace quicktype { | ||
| 9110 | 9352 | |
| 9111 | 9353 | inline void from_json(const json & j, Set& x) { |
| 9112 | 9354 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9355 | + if (j.find("set") != j.end() && !j.at("set").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9113 | 9356 | x.set_set(j.at("set").get<int64_t>()); |
| 9114 | 9357 | } |
| 9115 | 9358 | |
| @@ -9120,6 +9363,7 @@ namespace quicktype { | ||
| 9120 | 9363 | |
| 9121 | 9364 | inline void from_json(const json & j, Stackalloc& x) { |
| 9122 | 9365 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9366 | + if (j.find("stackalloc") != j.end() && !j.at("stackalloc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9123 | 9367 | x.set_stackalloc(j.at("stackalloc").get<int64_t>()); |
| 9124 | 9368 | } |
| 9125 | 9369 | |
| @@ -9130,6 +9374,7 @@ namespace quicktype { | ||
| 9130 | 9374 | |
| 9131 | 9375 | inline void from_json(const json & j, Strictfp& x) { |
| 9132 | 9376 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9377 | + if (j.find("strictfp") != j.end() && !j.at("strictfp").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9133 | 9378 | x.set_strictfp(j.at("strictfp").get<int64_t>()); |
| 9134 | 9379 | } |
| 9135 | 9380 | |
| @@ -9140,6 +9385,7 @@ namespace quicktype { | ||
| 9140 | 9385 | |
| 9141 | 9386 | inline void from_json(const json & j, String& x) { |
| 9142 | 9387 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9388 | + if (j.find("string") != j.end() && !j.at("string").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9143 | 9389 | x.set_string(j.at("string").get<int64_t>()); |
| 9144 | 9390 | } |
| 9145 | 9391 | |
| @@ -9150,6 +9396,7 @@ namespace quicktype { | ||
| 9150 | 9396 | |
| 9151 | 9397 | inline void from_json(const json & j, Subscript& x) { |
| 9152 | 9398 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9399 | + if (j.find("subscript") != j.end() && !j.at("subscript").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9153 | 9400 | x.set_subscript(j.at("subscript").get<int64_t>()); |
| 9154 | 9401 | } |
| 9155 | 9402 | |
| @@ -9160,6 +9407,7 @@ namespace quicktype { | ||
| 9160 | 9407 | |
| 9161 | 9408 | inline void from_json(const json & j, Super& x) { |
| 9162 | 9409 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9410 | + if (j.find("super") != j.end() && !j.at("super").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9163 | 9411 | x.set_super(j.at("super").get<int64_t>()); |
| 9164 | 9412 | } |
| 9165 | 9413 | |
| @@ -9170,6 +9418,7 @@ namespace quicktype { | ||
| 9170 | 9418 | |
| 9171 | 9419 | inline void from_json(const json & j, Symbol& x) { |
| 9172 | 9420 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9421 | + if (j.find("symbol") != j.end() && !j.at("symbol").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9173 | 9422 | x.set_symbol(j.at("symbol").get<int64_t>()); |
| 9174 | 9423 | } |
| 9175 | 9424 | |
| @@ -9180,6 +9429,7 @@ namespace quicktype { | ||
| 9180 | 9429 | |
| 9181 | 9430 | inline void from_json(const json & j, System& x) { |
| 9182 | 9431 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9432 | + if (j.find("system") != j.end() && !j.at("system").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9183 | 9433 | x.set_system(j.at("system").get<int64_t>()); |
| 9184 | 9434 | } |
| 9185 | 9435 | |
| @@ -9190,6 +9440,7 @@ namespace quicktype { | ||
| 9190 | 9440 | |
| 9191 | 9441 | inline void from_json(const json & j, Then& x) { |
| 9192 | 9442 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9443 | + if (j.find("then") != j.end() && !j.at("then").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9193 | 9444 | x.set_then(j.at("then").get<int64_t>()); |
| 9194 | 9445 | } |
| 9195 | 9446 | |
| @@ -9200,6 +9451,7 @@ namespace quicktype { | ||
| 9200 | 9451 | |
| 9201 | 9452 | inline void from_json(const json & j, Throws& x) { |
| 9202 | 9453 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9454 | + if (j.find("throws") != j.end() && !j.at("throws").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9203 | 9455 | x.set_throws(j.at("throws").get<int64_t>()); |
| 9204 | 9456 | } |
| 9205 | 9457 | |
| @@ -9210,6 +9462,7 @@ namespace quicktype { | ||
| 9210 | 9462 | |
| 9211 | 9463 | inline void from_json(const json & j, ToJson& x) { |
| 9212 | 9464 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9465 | + if (j.find("to_json") != j.end() && !j.at("to_json").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9213 | 9466 | x.set_to_json(j.at("to_json").get<int64_t>()); |
| 9214 | 9467 | } |
| 9215 | 9468 | |
| @@ -9220,6 +9473,7 @@ namespace quicktype { | ||
| 9220 | 9473 | |
| 9221 | 9474 | inline void from_json(const json & j, TopLevelClass& x) { |
| 9222 | 9475 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9476 | + if (j.find("top_level") != j.end() && !j.at("top_level").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9223 | 9477 | x.set_top_level(j.at("top_level").get<int64_t>()); |
| 9224 | 9478 | } |
| 9225 | 9479 | |
| @@ -9230,6 +9484,7 @@ namespace quicktype { | ||
| 9230 | 9484 | |
| 9231 | 9485 | inline void from_json(const json & j, Transient& x) { |
| 9232 | 9486 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9487 | + if (j.find("transient") != j.end() && !j.at("transient").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9233 | 9488 | x.set_transient(j.at("transient").get<int64_t>()); |
| 9234 | 9489 | } |
| 9235 | 9490 | |
| @@ -9240,6 +9495,7 @@ namespace quicktype { | ||
| 9240 | 9495 | |
| 9241 | 9496 | inline void from_json(const json & j, Type& x) { |
| 9242 | 9497 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9498 | + if (j.find("Type") != j.end() && !j.at("Type").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9243 | 9499 | x.set_type(j.at("Type").get<int64_t>()); |
| 9244 | 9500 | } |
| 9245 | 9501 | |
| @@ -9250,6 +9506,7 @@ namespace quicktype { | ||
| 9250 | 9506 | |
| 9251 | 9507 | inline void from_json(const json & j, Typealias& x) { |
| 9252 | 9508 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9509 | + if (j.find("typealias") != j.end() && !j.at("typealias").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9253 | 9510 | x.set_typealias(j.at("typealias").get<int64_t>()); |
| 9254 | 9511 | } |
| 9255 | 9512 | |
| @@ -9260,6 +9517,7 @@ namespace quicktype { | ||
| 9260 | 9517 | |
| 9261 | 9518 | inline void from_json(const json & j, Typeof& x) { |
| 9262 | 9519 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9520 | + if (j.find("typeof") != j.end() && !j.at("typeof").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9263 | 9521 | x.set_typeof(j.at("typeof").get<int64_t>()); |
| 9264 | 9522 | } |
| 9265 | 9523 | |
| @@ -9270,6 +9528,7 @@ namespace quicktype { | ||
| 9270 | 9528 | |
| 9271 | 9529 | inline void from_json(const json & j, Uint& x) { |
| 9272 | 9530 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9531 | + if (j.find("uint") != j.end() && !j.at("uint").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9273 | 9532 | x.set_uint(j.at("uint").get<int64_t>()); |
| 9274 | 9533 | } |
| 9275 | 9534 | |
| @@ -9280,6 +9539,7 @@ namespace quicktype { | ||
| 9280 | 9539 | |
| 9281 | 9540 | inline void from_json(const json & j, Ulong& x) { |
| 9282 | 9541 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9542 | + if (j.find("ulong") != j.end() && !j.at("ulong").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9283 | 9543 | x.set_ulong(j.at("ulong").get<int64_t>()); |
| 9284 | 9544 | } |
| 9285 | 9545 | |
| @@ -9290,6 +9550,7 @@ namespace quicktype { | ||
| 9290 | 9550 | |
| 9291 | 9551 | inline void from_json(const json & j, Unchecked& x) { |
| 9292 | 9552 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9553 | + if (j.find("unchecked") != j.end() && !j.at("unchecked").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9293 | 9554 | x.set_unchecked(j.at("unchecked").get<int64_t>()); |
| 9294 | 9555 | } |
| 9295 | 9556 | |
| @@ -9300,6 +9561,7 @@ namespace quicktype { | ||
| 9300 | 9561 | |
| 9301 | 9562 | inline void from_json(const json & j, Undefined& x) { |
| 9302 | 9563 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9564 | + if (j.find("undefined") != j.end() && !j.at("undefined").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9303 | 9565 | x.set_undefined(j.at("undefined").get<int64_t>()); |
| 9304 | 9566 | } |
| 9305 | 9567 | |
| @@ -9310,6 +9572,7 @@ namespace quicktype { | ||
| 9310 | 9572 | |
| 9311 | 9573 | inline void from_json(const json & j, Obj4& x) { |
| 9312 | 9574 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9575 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9313 | 9576 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 9314 | 9577 | x.set_obj4_public(j.at("public").get<Public>()); |
| 9315 | 9578 | x.set_obj4_register(j.at("register").get<Register>()); |
| @@ -9448,6 +9711,7 @@ namespace quicktype { | ||
| 9448 | 9711 | |
| 9449 | 9712 | inline void from_json(const json & j, Union& x) { |
| 9450 | 9713 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9714 | + if (j.find("union") != j.end() && !j.at("union").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9451 | 9715 | x.set_union_union(j.at("union").get<int64_t>()); |
| 9452 | 9716 | } |
| 9453 | 9717 | |
| @@ -9458,6 +9722,7 @@ namespace quicktype { | ||
| 9458 | 9722 | |
| 9459 | 9723 | inline void from_json(const json & j, Unsigned& x) { |
| 9460 | 9724 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9725 | + if (j.find("unsigned") != j.end() && !j.at("unsigned").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9461 | 9726 | x.set_unsigned_unsigned(j.at("unsigned").get<int64_t>()); |
| 9462 | 9727 | } |
| 9463 | 9728 | |
| @@ -9468,6 +9733,7 @@ namespace quicktype { | ||
| 9468 | 9733 | |
| 9469 | 9734 | inline void from_json(const json & j, Using& x) { |
| 9470 | 9735 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9736 | + if (j.find("using") != j.end() && !j.at("using").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9471 | 9737 | x.set_using_using(j.at("using").get<int64_t>()); |
| 9472 | 9738 | } |
| 9473 | 9739 | |
| @@ -9478,6 +9744,7 @@ namespace quicktype { | ||
| 9478 | 9744 | |
| 9479 | 9745 | inline void from_json(const json & j, Virtual& x) { |
| 9480 | 9746 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9747 | + if (j.find("virtual") != j.end() && !j.at("virtual").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9481 | 9748 | x.set_virtual_virtual(j.at("virtual").get<int64_t>()); |
| 9482 | 9749 | } |
| 9483 | 9750 | |
| @@ -9488,6 +9755,7 @@ namespace quicktype { | ||
| 9488 | 9755 | |
| 9489 | 9756 | inline void from_json(const json & j, Void& x) { |
| 9490 | 9757 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9758 | + if (j.find("void") != j.end() && !j.at("void").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9491 | 9759 | x.set_void_void(j.at("void").get<int64_t>()); |
| 9492 | 9760 | } |
| 9493 | 9761 | |
| @@ -9498,6 +9766,7 @@ namespace quicktype { | ||
| 9498 | 9766 | |
| 9499 | 9767 | inline void from_json(const json & j, Volatile& x) { |
| 9500 | 9768 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9769 | + if (j.find("volatile") != j.end() && !j.at("volatile").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9501 | 9770 | x.set_volatile_volatile(j.at("volatile").get<int64_t>()); |
| 9502 | 9771 | } |
| 9503 | 9772 | |
| @@ -9508,6 +9777,7 @@ namespace quicktype { | ||
| 9508 | 9777 | |
| 9509 | 9778 | inline void from_json(const json & j, WcharT& x) { |
| 9510 | 9779 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9780 | + if (j.find("wchar_t") != j.end() && !j.at("wchar_t").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9511 | 9781 | x.set_wchar_t_wchar_t(j.at("wchar_t").get<int64_t>()); |
| 9512 | 9782 | } |
| 9513 | 9783 | |
| @@ -9518,6 +9788,7 @@ namespace quicktype { | ||
| 9518 | 9788 | |
| 9519 | 9789 | inline void from_json(const json & j, While& x) { |
| 9520 | 9790 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9791 | + if (j.find("while") != j.end() && !j.at("while").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9521 | 9792 | x.set_while_while(j.at("while").get<int64_t>()); |
| 9522 | 9793 | } |
| 9523 | 9794 | |
| @@ -9528,6 +9799,7 @@ namespace quicktype { | ||
| 9528 | 9799 | |
| 9529 | 9800 | inline void from_json(const json & j, Xor& x) { |
| 9530 | 9801 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9802 | + if (j.find("xor") != j.end() && !j.at("xor").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9531 | 9803 | x.set_xor_xor(j.at("xor").get<int64_t>()); |
| 9532 | 9804 | } |
| 9533 | 9805 | |
| @@ -9538,6 +9810,7 @@ namespace quicktype { | ||
| 9538 | 9810 | |
| 9539 | 9811 | inline void from_json(const json & j, XorEq& x) { |
| 9540 | 9812 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9813 | + if (j.find("xor_eq") != j.end() && !j.at("xor_eq").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9541 | 9814 | x.set_xor_eq_xor_eq(j.at("xor_eq").get<int64_t>()); |
| 9542 | 9815 | } |
| 9543 | 9816 | |
| @@ -9548,6 +9821,7 @@ namespace quicktype { | ||
| 9548 | 9821 | |
| 9549 | 9822 | inline void from_json(const json & j, Unowned& x) { |
| 9550 | 9823 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9824 | + if (j.find("unowned") != j.end() && !j.at("unowned").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9551 | 9825 | x.set_unowned(j.at("unowned").get<int64_t>()); |
| 9552 | 9826 | } |
| 9553 | 9827 | |
| @@ -9558,6 +9832,7 @@ namespace quicktype { | ||
| 9558 | 9832 | |
| 9559 | 9833 | inline void from_json(const json & j, Unsafe& x) { |
| 9560 | 9834 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9835 | + if (j.find("unsafe") != j.end() && !j.at("unsafe").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9561 | 9836 | x.set_unsafe(j.at("unsafe").get<int64_t>()); |
| 9562 | 9837 | } |
| 9563 | 9838 | |
| @@ -9568,6 +9843,7 @@ namespace quicktype { | ||
| 9568 | 9843 | |
| 9569 | 9844 | inline void from_json(const json & j, Ushort& x) { |
| 9570 | 9845 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9846 | + if (j.find("ushort") != j.end() && !j.at("ushort").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9571 | 9847 | x.set_ushort(j.at("ushort").get<int64_t>()); |
| 9572 | 9848 | } |
| 9573 | 9849 | |
| @@ -9578,6 +9854,7 @@ namespace quicktype { | ||
| 9578 | 9854 | |
| 9579 | 9855 | inline void from_json(const json & j, Var& x) { |
| 9580 | 9856 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9857 | + if (j.find("var") != j.end() && !j.at("var").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9581 | 9858 | x.set_var(j.at("var").get<int64_t>()); |
| 9582 | 9859 | } |
| 9583 | 9860 | |
| @@ -9588,6 +9865,7 @@ namespace quicktype { | ||
| 9588 | 9865 | |
| 9589 | 9866 | inline void from_json(const json & j, Weak& x) { |
| 9590 | 9867 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9868 | + if (j.find("weak") != j.end() && !j.at("weak").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9591 | 9869 | x.set_weak(j.at("weak").get<int64_t>()); |
| 9592 | 9870 | } |
| 9593 | 9871 | |
| @@ -9598,6 +9876,7 @@ namespace quicktype { | ||
| 9598 | 9876 | |
| 9599 | 9877 | inline void from_json(const json & j, Where& x) { |
| 9600 | 9878 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9879 | + if (j.find("where") != j.end() && !j.at("where").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9601 | 9880 | x.set_where(j.at("where").get<int64_t>()); |
| 9602 | 9881 | } |
| 9603 | 9882 | |
| @@ -9608,6 +9887,7 @@ namespace quicktype { | ||
| 9608 | 9887 | |
| 9609 | 9888 | inline void from_json(const json & j, WillSet& x) { |
| 9610 | 9889 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9890 | + if (j.find("willSet") != j.end() && !j.at("willSet").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9611 | 9891 | x.set_will_set(j.at("willSet").get<int64_t>()); |
| 9612 | 9892 | } |
| 9613 | 9893 | |
| @@ -9618,6 +9898,7 @@ namespace quicktype { | ||
| 9618 | 9898 | |
| 9619 | 9899 | inline void from_json(const json & j, With& x) { |
| 9620 | 9900 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9901 | + if (j.find("with") != j.end() && !j.at("with").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9621 | 9902 | x.set_with(j.at("with").get<int64_t>()); |
| 9622 | 9903 | } |
| 9623 | 9904 | |
| @@ -9628,6 +9909,7 @@ namespace quicktype { | ||
| 9628 | 9909 | |
| 9629 | 9910 | inline void from_json(const json & j, Yes& x) { |
| 9630 | 9911 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9912 | + if (j.find("YES") != j.end() && !j.at("YES").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9631 | 9913 | x.set_yes(j.at("YES").get<int64_t>()); |
| 9632 | 9914 | } |
| 9633 | 9915 | |
| @@ -9638,6 +9920,7 @@ namespace quicktype { | ||
| 9638 | 9920 | |
| 9639 | 9921 | inline void from_json(const json & j, Yield& x) { |
| 9640 | 9922 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9923 | + if (j.find("yield") != j.end() && !j.at("yield").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9641 | 9924 | x.set_yield(j.at("yield").get<int64_t>()); |
| 9642 | 9925 | } |
| 9643 | 9926 | |
| @@ -9648,6 +9931,7 @@ namespace quicktype { | ||
| 9648 | 9931 | |
| 9649 | 9932 | inline void from_json(const json & j, Obj5& x) { |
| 9650 | 9933 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9934 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9651 | 9935 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 9652 | 9936 | x.set_obj5_union(j.at("union").get<Union>()); |
| 9653 | 9937 | x.set_obj5_unsigned(j.at("unsigned").get<Unsigned>()); |
| @@ -9698,6 +9982,7 @@ namespace quicktype { | ||
| 9698 | 9982 | |
| 9699 | 9983 | inline void from_json(const json & j, TopLevel& x) { |
| 9700 | 9984 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 9985 | + if (j.find("dummy") != j.end() && !j.at("dummy").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 9701 | 9986 | x.set_dummy(j.at("dummy").get<int64_t>()); |
| 9702 | 9987 | x.set_obj1(j.at("obj1").get<Obj1>()); |
| 9703 | 9988 | x.set_obj2(j.at("obj2").get<Obj2>()); |
Test case
1 generated file · +1 −0test/inputs/json/priority/list.json
Mcplusplusdefault / 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 | + if (j.find("data") != j.end() && !j.at("data").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 115 | 116 | x.set_data(j.at("data").get<int64_t>()); |
| 116 | 117 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
| 117 | 118 | } |
Test case
1 generated file · +1 −0test/inputs/json/priority/name-style.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -82,6 +82,7 @@ namespace quicktype { | ||
| 82 | 82 | |
| 83 | 83 | inline void from_json(const json & j, TopLevel& x) { |
| 84 | 84 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 85 | + if (j.find("anEasyOne") != j.end() && !j.at("anEasyOne").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 85 | 86 | x.set_an_easy_one(j.at("anEasyOne").get<int64_t>()); |
| 86 | 87 | x.set_is_mnist_letter(j.at("isMNISTLetter").get<bool>()); |
| 87 | 88 | x.set_json_string(j.at("JSONString").get<std::string>()); |
Test case
1 generated file · +118 −0test/inputs/json/priority/nbl-stats.json
Mcplusplusdefault / quicktype.hpp+118 −0
| @@ -1441,13 +1441,16 @@ namespace quicktype { | ||
| 1441 | 1441 | x.set_clock(j.at("clock").get<std::string>()); |
| 1442 | 1442 | x.set_competition_name(j.at("competitionName").get<std::string>()); |
| 1443 | 1443 | x.set_id(j.at("id").get<std::string>()); |
| 1444 | + if (j.find("period") != j.end() && !j.at("period").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1444 | 1445 | x.set_period(j.at("period").get<int64_t>()); |
| 1445 | 1446 | x.set_period_type(j.at("periodType").get<PerType>()); |
| 1446 | 1447 | x.set_team1(j.at("team1").get<Team>()); |
| 1447 | 1448 | x.set_team1_name(j.at("team1Name").get<std::string>()); |
| 1449 | + if (j.find("team1Score") != j.end() && !j.at("team1Score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1448 | 1450 | x.set_team1_score(j.at("team1Score").get<int64_t>()); |
| 1449 | 1451 | x.set_team2(j.at("team2").get<Team>()); |
| 1450 | 1452 | x.set_team2_name(j.at("team2Name").get<std::string>()); |
| 1453 | + if (j.find("team2Score") != j.end() && !j.at("team2Score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1451 | 1454 | x.set_team2_score(j.at("team2Score").get<int64_t>()); |
| 1452 | 1455 | } |
| 1453 | 1456 | |
| @@ -1478,19 +1481,27 @@ namespace quicktype { | ||
| 1478 | 1481 | x.set_international_family_name_initial(get_stack_optional<FamilyNameInitial>(j, "internationalFamilyNameInitial")); |
| 1479 | 1482 | x.set_international_first_name(get_stack_optional<std::string>(j, "internationalFirstName")); |
| 1480 | 1483 | x.set_international_first_name_initial(get_stack_optional<FirstNameInitial>(j, "internationalFirstNameInitial")); |
| 1484 | + if (j.find("lead") != j.end() && !j.at("lead").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1481 | 1485 | x.set_lead(j.at("lead").get<int64_t>()); |
| 1486 | + if (j.find("period") != j.end() && !j.at("period").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1482 | 1487 | x.set_period(j.at("period").get<int64_t>()); |
| 1483 | 1488 | x.set_period_type(j.at("periodType").get<PerType>()); |
| 1484 | 1489 | x.set_player(j.at("player").get<std::string>()); |
| 1490 | + if (j.find("pno") != j.end() && !j.at("pno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1485 | 1491 | x.set_pno(j.at("pno").get<int64_t>()); |
| 1486 | 1492 | x.set_qualifier(j.at("qualifier").get<std::string>()); |
| 1493 | + if (j.find("s1") != j.end() && !j.at("s1").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1487 | 1494 | x.set_s1(j.at("s1").get<int64_t>()); |
| 1495 | + if (j.find("s2") != j.end() && !j.at("s2").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1488 | 1496 | x.set_s2(j.at("s2").get<int64_t>()); |
| 1489 | 1497 | x.set_scoreboard_name(get_stack_optional<ScoreboardName>(j, "scoreboardName")); |
| 1498 | + if (j.find("scoring") != j.end() && !j.at("scoring").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1490 | 1499 | x.set_scoring(j.at("scoring").get<int64_t>()); |
| 1491 | 1500 | x.set_shirt_number(j.at("shirtNumber").get<std::string>()); |
| 1492 | 1501 | x.set_sub_type(j.at("subType").get<std::string>()); |
| 1502 | + if (j.find("success") != j.end() && !j.at("success").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1493 | 1503 | x.set_success(j.at("success").get<int64_t>()); |
| 1504 | + if (j.find("tno") != j.end() && !j.at("tno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1494 | 1505 | x.set_tno(j.at("tno").get<int64_t>()); |
| 1495 | 1506 | } |
| 1496 | 1507 | |
| @@ -1525,6 +1536,7 @@ namespace quicktype { | ||
| 1525 | 1536 | inline void from_json(const json & j, Time& x) { |
| 1526 | 1537 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1527 | 1538 | x.set_gt(j.at("gt").get<std::string>()); |
| 1539 | + if (j.find("per") != j.end() && !j.at("per").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1528 | 1540 | x.set_per(j.at("per").get<int64_t>()); |
| 1529 | 1541 | x.set_per_type(j.at("perType").get<PerType>()); |
| 1530 | 1542 | } |
| @@ -1548,15 +1560,19 @@ namespace quicktype { | ||
| 1548 | 1560 | x.set_international_first_name(get_stack_optional<std::string>(j, "internationalFirstName")); |
| 1549 | 1561 | x.set_international_first_name_initial(get_stack_optional<FirstNameInitial>(j, "internationalFirstNameInitial")); |
| 1550 | 1562 | x.set_name(get_stack_optional<std::string>(j, "name")); |
| 1563 | + if (j.find("per") != j.end() && !j.at("per").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1551 | 1564 | x.set_per(get_stack_optional<int64_t>(j, "per")); |
| 1552 | 1565 | x.set_per_type(get_stack_optional<PerType>(j, "perType")); |
| 1553 | 1566 | x.set_player(get_stack_optional<std::string>(j, "player")); |
| 1567 | + if (j.find("pno") != j.end() && !j.at("pno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1554 | 1568 | x.set_pno(j.at("pno").get<int64_t>()); |
| 1555 | 1569 | x.set_scoreboard_name(get_stack_optional<ScoreboardName>(j, "scoreboardName")); |
| 1556 | 1570 | x.set_shirt_number(j.at("shirtNumber").get<std::string>()); |
| 1557 | 1571 | x.set_summary(get_stack_optional<std::string>(j, "summary")); |
| 1558 | 1572 | x.set_times(get_stack_optional<std::vector<Time>>(j, "times")); |
| 1573 | + if (j.find("tno") != j.end() && !j.at("tno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1559 | 1574 | x.set_tno(j.at("tno").get<int64_t>()); |
| 1575 | + if (j.find("tot") != j.end() && !j.at("tot").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1560 | 1576 | x.set_tot(get_stack_optional<int64_t>(j, "tot")); |
| 1561 | 1577 | } |
| 1562 | 1578 | |
| @@ -1630,15 +1646,22 @@ namespace quicktype { | ||
| 1630 | 1646 | |
| 1631 | 1647 | inline void from_json(const json & j, Pl& x) { |
| 1632 | 1648 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1649 | + if (j.find("active") != j.end() && !j.at("active").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1633 | 1650 | x.set_active(j.at("active").get<int64_t>()); |
| 1651 | + if (j.find("captain") != j.end() && !j.at("captain").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1634 | 1652 | x.set_captain(get_stack_optional<int64_t>(j, "captain")); |
| 1635 | 1653 | x.set_comp(get_stack_optional<Comp>(j, "comp")); |
| 1654 | + if (j.find("eff_1") != j.end() && !j.at("eff_1").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1636 | 1655 | x.set_eff_1(j.at("eff_1").get<int64_t>()); |
| 1656 | + if (j.find("eff_2") != j.end() && !j.at("eff_2").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1637 | 1657 | x.set_eff_2(j.at("eff_2").get<int64_t>()); |
| 1638 | 1658 | x.set_eff_3(j.at("eff_3").get<double>()); |
| 1639 | 1659 | x.set_eff_4(j.at("eff_4").get<double>()); |
| 1660 | + if (j.find("eff_5") != j.end() && !j.at("eff_5").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1640 | 1661 | x.set_eff_5(j.at("eff_5").get<int64_t>()); |
| 1662 | + if (j.find("eff_6") != j.end() && !j.at("eff_6").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1641 | 1663 | x.set_eff_6(j.at("eff_6").get<int64_t>()); |
| 1664 | + if (j.find("eff_7") != j.end() && !j.at("eff_7").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1642 | 1665 | x.set_eff_7(j.at("eff_7").get<int64_t>()); |
| 1643 | 1666 | x.set_family_name(j.at("familyName").get<std::string>()); |
| 1644 | 1667 | x.set_family_name_initial(j.at("familyNameInitial").get<FamilyNameInitial>()); |
| @@ -1650,35 +1673,63 @@ namespace quicktype { | ||
| 1650 | 1673 | x.set_international_first_name_initial(j.at("internationalFirstNameInitial").get<FirstNameInitial>()); |
| 1651 | 1674 | x.set_name(j.at("name").get<std::string>()); |
| 1652 | 1675 | x.set_playing_position(j.at("playingPosition").get<std::string>()); |
| 1676 | + if (j.find("sAssists") != j.end() && !j.at("sAssists").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1653 | 1677 | x.set_s_assists(j.at("sAssists").get<int64_t>()); |
| 1678 | + if (j.find("sBlocks") != j.end() && !j.at("sBlocks").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1654 | 1679 | x.set_s_blocks(j.at("sBlocks").get<int64_t>()); |
| 1680 | + if (j.find("sBlocksReceived") != j.end() && !j.at("sBlocksReceived").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1655 | 1681 | x.set_s_blocks_received(j.at("sBlocksReceived").get<int64_t>()); |
| 1682 | + if (j.find("sFieldGoalsAttempted") != j.end() && !j.at("sFieldGoalsAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1656 | 1683 | x.set_s_field_goals_attempted(j.at("sFieldGoalsAttempted").get<int64_t>()); |
| 1684 | + if (j.find("sFieldGoalsMade") != j.end() && !j.at("sFieldGoalsMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1657 | 1685 | x.set_s_field_goals_made(j.at("sFieldGoalsMade").get<int64_t>()); |
| 1686 | + if (j.find("sFieldGoalsPercentage") != j.end() && !j.at("sFieldGoalsPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1658 | 1687 | x.set_s_field_goals_percentage(j.at("sFieldGoalsPercentage").get<int64_t>()); |
| 1688 | + if (j.find("sFoulsOn") != j.end() && !j.at("sFoulsOn").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1659 | 1689 | x.set_s_fouls_on(j.at("sFoulsOn").get<int64_t>()); |
| 1690 | + if (j.find("sFoulsPersonal") != j.end() && !j.at("sFoulsPersonal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1660 | 1691 | x.set_s_fouls_personal(j.at("sFoulsPersonal").get<int64_t>()); |
| 1692 | + if (j.find("sFreeThrowsAttempted") != j.end() && !j.at("sFreeThrowsAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1661 | 1693 | x.set_s_free_throws_attempted(j.at("sFreeThrowsAttempted").get<int64_t>()); |
| 1694 | + if (j.find("sFreeThrowsMade") != j.end() && !j.at("sFreeThrowsMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1662 | 1695 | x.set_s_free_throws_made(j.at("sFreeThrowsMade").get<int64_t>()); |
| 1696 | + if (j.find("sFreeThrowsPercentage") != j.end() && !j.at("sFreeThrowsPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1663 | 1697 | x.set_s_free_throws_percentage(j.at("sFreeThrowsPercentage").get<int64_t>()); |
| 1664 | 1698 | x.set_s_minutes(j.at("sMinutes").get<SMinutes>()); |
| 1699 | + if (j.find("sPlusMinusPoints") != j.end() && !j.at("sPlusMinusPoints").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1665 | 1700 | x.set_s_plus_minus_points(j.at("sPlusMinusPoints").get<int64_t>()); |
| 1701 | + if (j.find("sPoints") != j.end() && !j.at("sPoints").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1666 | 1702 | x.set_s_points(j.at("sPoints").get<int64_t>()); |
| 1703 | + if (j.find("sPointsFastBreak") != j.end() && !j.at("sPointsFastBreak").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1667 | 1704 | x.set_s_points_fast_break(j.at("sPointsFastBreak").get<int64_t>()); |
| 1705 | + if (j.find("sPointsInThePaint") != j.end() && !j.at("sPointsInThePaint").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1668 | 1706 | x.set_s_points_in_the_paint(j.at("sPointsInThePaint").get<int64_t>()); |
| 1707 | + if (j.find("sPointsSecondChance") != j.end() && !j.at("sPointsSecondChance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1669 | 1708 | x.set_s_points_second_chance(j.at("sPointsSecondChance").get<int64_t>()); |
| 1709 | + if (j.find("sReboundsDefensive") != j.end() && !j.at("sReboundsDefensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1670 | 1710 | x.set_s_rebounds_defensive(j.at("sReboundsDefensive").get<int64_t>()); |
| 1711 | + if (j.find("sReboundsOffensive") != j.end() && !j.at("sReboundsOffensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1671 | 1712 | x.set_s_rebounds_offensive(j.at("sReboundsOffensive").get<int64_t>()); |
| 1713 | + if (j.find("sReboundsTotal") != j.end() && !j.at("sReboundsTotal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1672 | 1714 | x.set_s_rebounds_total(j.at("sReboundsTotal").get<int64_t>()); |
| 1715 | + if (j.find("sSteals") != j.end() && !j.at("sSteals").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1673 | 1716 | x.set_s_steals(j.at("sSteals").get<int64_t>()); |
| 1717 | + if (j.find("sThreePointersAttempted") != j.end() && !j.at("sThreePointersAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1674 | 1718 | x.set_s_three_pointers_attempted(j.at("sThreePointersAttempted").get<int64_t>()); |
| 1719 | + if (j.find("sThreePointersMade") != j.end() && !j.at("sThreePointersMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1675 | 1720 | x.set_s_three_pointers_made(j.at("sThreePointersMade").get<int64_t>()); |
| 1721 | + if (j.find("sThreePointersPercentage") != j.end() && !j.at("sThreePointersPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1676 | 1722 | x.set_s_three_pointers_percentage(j.at("sThreePointersPercentage").get<int64_t>()); |
| 1723 | + if (j.find("sTurnovers") != j.end() && !j.at("sTurnovers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1677 | 1724 | x.set_s_turnovers(j.at("sTurnovers").get<int64_t>()); |
| 1725 | + if (j.find("sTwoPointersAttempted") != j.end() && !j.at("sTwoPointersAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1678 | 1726 | x.set_s_two_pointers_attempted(j.at("sTwoPointersAttempted").get<int64_t>()); |
| 1727 | + if (j.find("sTwoPointersMade") != j.end() && !j.at("sTwoPointersMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1679 | 1728 | x.set_s_two_pointers_made(j.at("sTwoPointersMade").get<int64_t>()); |
| 1729 | + if (j.find("sTwoPointersPercentage") != j.end() && !j.at("sTwoPointersPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1680 | 1730 | x.set_s_two_pointers_percentage(j.at("sTwoPointersPercentage").get<int64_t>()); |
| 1681 | 1731 | x.set_shirt_number(j.at("shirtNumber").get<std::string>()); |
| 1732 | + if (j.find("starter") != j.end() && !j.at("starter").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1682 | 1733 | x.set_starter(j.at("starter").get<int64_t>()); |
| 1683 | 1734 | } |
| 1684 | 1735 | |
| @@ -1739,16 +1790,23 @@ namespace quicktype { | ||
| 1739 | 1790 | inline void from_json(const json & j, Shot& x) { |
| 1740 | 1791 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1741 | 1792 | x.set_action_type(j.at("actionType").get<ActionType>()); |
| 1793 | + if (j.find("p") != j.end() && !j.at("p").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1742 | 1794 | x.set_p(j.at("p").get<int64_t>()); |
| 1795 | + if (j.find("per") != j.end() && !j.at("per").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1743 | 1796 | x.set_per(j.at("per").get<int64_t>()); |
| 1744 | 1797 | x.set_per_type(j.at("perType").get<PerType>()); |
| 1745 | 1798 | x.set_player(j.at("player").get<std::string>()); |
| 1799 | + if (j.find("pno") != j.end() && !j.at("pno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1746 | 1800 | x.set_pno(j.at("pno").get<int64_t>()); |
| 1801 | + if (j.find("r") != j.end() && !j.at("r").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1747 | 1802 | x.set_r(j.at("r").get<int64_t>()); |
| 1748 | 1803 | x.set_shirt_number(j.at("shirtNumber").get<std::string>()); |
| 1749 | 1804 | x.set_sub_type(j.at("subType").get<SubType>()); |
| 1805 | + if (j.find("tno") != j.end() && !j.at("tno").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1750 | 1806 | x.set_tno(j.at("tno").get<int64_t>()); |
| 1807 | + if (j.find("x") != j.end() && !j.at("x").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1751 | 1808 | x.set_x(j.at("x").get<int64_t>()); |
| 1809 | + if (j.find("y") != j.end() && !j.at("y").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1752 | 1810 | x.set_y(j.at("y").get<int64_t>()); |
| 1753 | 1811 | } |
| 1754 | 1812 | |
| @@ -1772,68 +1830,120 @@ namespace quicktype { | ||
| 1772 | 1830 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1773 | 1831 | x.set_code(j.at("code").get<std::string>()); |
| 1774 | 1832 | x.set_code_international(j.at("codeInternational").get<std::string>()); |
| 1833 | + if (j.find("fouls") != j.end() && !j.at("fouls").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1775 | 1834 | x.set_fouls(j.at("fouls").get<int64_t>()); |
| 1835 | + if (j.find("full_score") != j.end() && !j.at("full_score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1776 | 1836 | x.set_full_score(j.at("full_score").get<int64_t>()); |
| 1777 | 1837 | x.set_lds(j.at("lds").get<Lds>()); |
| 1778 | 1838 | x.set_logo(j.at("logo").get<std::string>()); |
| 1779 | 1839 | x.set_name(j.at("name").get<std::string>()); |
| 1780 | 1840 | x.set_name_international(j.at("nameInternational").get<std::string>()); |
| 1841 | + if (j.find("p1_score") != j.end() && !j.at("p1_score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1781 | 1842 | x.set_p1_score(j.at("p1_score").get<int64_t>()); |
| 1843 | + if (j.find("p2_score") != j.end() && !j.at("p2_score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1782 | 1844 | x.set_p2_score(j.at("p2_score").get<int64_t>()); |
| 1845 | + if (j.find("p3_score") != j.end() && !j.at("p3_score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1783 | 1846 | x.set_p3_score(j.at("p3_score").get<int64_t>()); |
| 1847 | + if (j.find("p4_score") != j.end() && !j.at("p4_score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1784 | 1848 | x.set_p4_score(j.at("p4_score").get<int64_t>()); |
| 1785 | 1849 | x.set_pl(j.at("pl").get<std::map<std::string, Pl>>()); |
| 1850 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1786 | 1851 | x.set_score(j.at("score").get<int64_t>()); |
| 1787 | 1852 | x.set_scoring(j.at("scoring").get<std::vector<Scorer>>()); |
| 1788 | 1853 | x.set_short_name(j.at("shortName").get<std::string>()); |
| 1789 | 1854 | x.set_short_name_international(j.at("shortNameInternational").get<std::string>()); |
| 1790 | 1855 | x.set_shot(j.at("shot").get<std::vector<Shot>>()); |
| 1856 | + if (j.find("timeouts") != j.end() && !j.at("timeouts").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1791 | 1857 | x.set_timeouts(j.at("timeouts").get<int64_t>()); |
| 1858 | + if (j.find("tot_eff_1") != j.end() && !j.at("tot_eff_1").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1792 | 1859 | x.set_tot_eff_1(j.at("tot_eff_1").get<int64_t>()); |
| 1860 | + if (j.find("tot_eff_2") != j.end() && !j.at("tot_eff_2").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1793 | 1861 | x.set_tot_eff_2(j.at("tot_eff_2").get<int64_t>()); |
| 1794 | 1862 | x.set_tot_eff_3(j.at("tot_eff_3").get<double>()); |
| 1863 | + if (j.find("tot_eff_4") != j.end() && !j.at("tot_eff_4").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1795 | 1864 | x.set_tot_eff_4(j.at("tot_eff_4").get<int64_t>()); |
| 1865 | + if (j.find("tot_eff_5") != j.end() && !j.at("tot_eff_5").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1796 | 1866 | x.set_tot_eff_5(j.at("tot_eff_5").get<int64_t>()); |
| 1867 | + if (j.find("tot_eff_6") != j.end() && !j.at("tot_eff_6").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1797 | 1868 | x.set_tot_eff_6(j.at("tot_eff_6").get<int64_t>()); |
| 1869 | + if (j.find("tot_eff_7") != j.end() && !j.at("tot_eff_7").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1798 | 1870 | x.set_tot_eff_7(j.at("tot_eff_7").get<int64_t>()); |
| 1871 | + if (j.find("tot_sAssists") != j.end() && !j.at("tot_sAssists").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1799 | 1872 | x.set_tot_s_assists(j.at("tot_sAssists").get<int64_t>()); |
| 1873 | + if (j.find("tot_sBenchPoints") != j.end() && !j.at("tot_sBenchPoints").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1800 | 1874 | x.set_tot_s_bench_points(j.at("tot_sBenchPoints").get<int64_t>()); |
| 1875 | + if (j.find("tot_sBiggestLead") != j.end() && !j.at("tot_sBiggestLead").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1801 | 1876 | x.set_tot_s_biggest_lead(j.at("tot_sBiggestLead").get<int64_t>()); |
| 1877 | + if (j.find("tot_sBiggestScoringRun") != j.end() && !j.at("tot_sBiggestScoringRun").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1802 | 1878 | x.set_tot_s_biggest_scoring_run(j.at("tot_sBiggestScoringRun").get<int64_t>()); |
| 1879 | + if (j.find("tot_sBlocks") != j.end() && !j.at("tot_sBlocks").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1803 | 1880 | x.set_tot_s_blocks(j.at("tot_sBlocks").get<int64_t>()); |
| 1881 | + if (j.find("tot_sBlocksReceived") != j.end() && !j.at("tot_sBlocksReceived").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1804 | 1882 | x.set_tot_s_blocks_received(j.at("tot_sBlocksReceived").get<int64_t>()); |
| 1883 | + if (j.find("tot_sFieldGoalsAttempted") != j.end() && !j.at("tot_sFieldGoalsAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1805 | 1884 | x.set_tot_s_field_goals_attempted(j.at("tot_sFieldGoalsAttempted").get<int64_t>()); |
| 1885 | + if (j.find("tot_sFieldGoalsMade") != j.end() && !j.at("tot_sFieldGoalsMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1806 | 1886 | x.set_tot_s_field_goals_made(j.at("tot_sFieldGoalsMade").get<int64_t>()); |
| 1887 | + if (j.find("tot_sFieldGoalsPercentage") != j.end() && !j.at("tot_sFieldGoalsPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1807 | 1888 | x.set_tot_s_field_goals_percentage(j.at("tot_sFieldGoalsPercentage").get<int64_t>()); |
| 1889 | + if (j.find("tot_sFoulsOn") != j.end() && !j.at("tot_sFoulsOn").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1808 | 1890 | x.set_tot_s_fouls_on(j.at("tot_sFoulsOn").get<int64_t>()); |
| 1891 | + if (j.find("tot_sFoulsPersonal") != j.end() && !j.at("tot_sFoulsPersonal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1809 | 1892 | x.set_tot_s_fouls_personal(j.at("tot_sFoulsPersonal").get<int64_t>()); |
| 1893 | + if (j.find("tot_sFoulsTeam") != j.end() && !j.at("tot_sFoulsTeam").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1810 | 1894 | x.set_tot_s_fouls_team(j.at("tot_sFoulsTeam").get<int64_t>()); |
| 1895 | + if (j.find("tot_sFreeThrowsAttempted") != j.end() && !j.at("tot_sFreeThrowsAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1811 | 1896 | x.set_tot_s_free_throws_attempted(j.at("tot_sFreeThrowsAttempted").get<int64_t>()); |
| 1897 | + if (j.find("tot_sFreeThrowsMade") != j.end() && !j.at("tot_sFreeThrowsMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1812 | 1898 | x.set_tot_s_free_throws_made(j.at("tot_sFreeThrowsMade").get<int64_t>()); |
| 1899 | + if (j.find("tot_sFreeThrowsPercentage") != j.end() && !j.at("tot_sFreeThrowsPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1813 | 1900 | x.set_tot_s_free_throws_percentage(j.at("tot_sFreeThrowsPercentage").get<int64_t>()); |
| 1901 | + if (j.find("tot_sLeadChanges") != j.end() && !j.at("tot_sLeadChanges").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1814 | 1902 | x.set_tot_s_lead_changes(j.at("tot_sLeadChanges").get<int64_t>()); |
| 1903 | + if (j.find("tot_sMinutes") != j.end() && !j.at("tot_sMinutes").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1815 | 1904 | x.set_tot_s_minutes(j.at("tot_sMinutes").get<int64_t>()); |
| 1905 | + if (j.find("tot_sPoints") != j.end() && !j.at("tot_sPoints").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1816 | 1906 | x.set_tot_s_points(j.at("tot_sPoints").get<int64_t>()); |
| 1907 | + if (j.find("tot_sPointsFastBreak") != j.end() && !j.at("tot_sPointsFastBreak").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1817 | 1908 | x.set_tot_s_points_fast_break(j.at("tot_sPointsFastBreak").get<int64_t>()); |
| 1909 | + if (j.find("tot_sPointsFromTurnovers") != j.end() && !j.at("tot_sPointsFromTurnovers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1818 | 1910 | x.set_tot_s_points_from_turnovers(j.at("tot_sPointsFromTurnovers").get<int64_t>()); |
| 1911 | + if (j.find("tot_sPointsInThePaint") != j.end() && !j.at("tot_sPointsInThePaint").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1819 | 1912 | x.set_tot_s_points_in_the_paint(j.at("tot_sPointsInThePaint").get<int64_t>()); |
| 1913 | + if (j.find("tot_sPointsSecondChance") != j.end() && !j.at("tot_sPointsSecondChance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1820 | 1914 | x.set_tot_s_points_second_chance(j.at("tot_sPointsSecondChance").get<int64_t>()); |
| 1915 | + if (j.find("tot_sReboundsDefensive") != j.end() && !j.at("tot_sReboundsDefensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1821 | 1916 | x.set_tot_s_rebounds_defensive(j.at("tot_sReboundsDefensive").get<int64_t>()); |
| 1917 | + if (j.find("tot_sReboundsOffensive") != j.end() && !j.at("tot_sReboundsOffensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1822 | 1918 | x.set_tot_s_rebounds_offensive(j.at("tot_sReboundsOffensive").get<int64_t>()); |
| 1919 | + if (j.find("tot_sReboundsTeam") != j.end() && !j.at("tot_sReboundsTeam").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1823 | 1920 | x.set_tot_s_rebounds_team(j.at("tot_sReboundsTeam").get<int64_t>()); |
| 1921 | + if (j.find("tot_sReboundsTeamDefensive") != j.end() && !j.at("tot_sReboundsTeamDefensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1824 | 1922 | x.set_tot_s_rebounds_team_defensive(j.at("tot_sReboundsTeamDefensive").get<int64_t>()); |
| 1923 | + if (j.find("tot_sReboundsTeamOffensive") != j.end() && !j.at("tot_sReboundsTeamOffensive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1825 | 1924 | x.set_tot_s_rebounds_team_offensive(j.at("tot_sReboundsTeamOffensive").get<int64_t>()); |
| 1925 | + if (j.find("tot_sReboundsTotal") != j.end() && !j.at("tot_sReboundsTotal").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1826 | 1926 | x.set_tot_s_rebounds_total(j.at("tot_sReboundsTotal").get<int64_t>()); |
| 1927 | + if (j.find("tot_sSteals") != j.end() && !j.at("tot_sSteals").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1827 | 1928 | x.set_tot_s_steals(j.at("tot_sSteals").get<int64_t>()); |
| 1929 | + if (j.find("tot_sThreePointersAttempted") != j.end() && !j.at("tot_sThreePointersAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1828 | 1930 | x.set_tot_s_three_pointers_attempted(j.at("tot_sThreePointersAttempted").get<int64_t>()); |
| 1931 | + if (j.find("tot_sThreePointersMade") != j.end() && !j.at("tot_sThreePointersMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1829 | 1932 | x.set_tot_s_three_pointers_made(j.at("tot_sThreePointersMade").get<int64_t>()); |
| 1933 | + if (j.find("tot_sThreePointersPercentage") != j.end() && !j.at("tot_sThreePointersPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1830 | 1934 | x.set_tot_s_three_pointers_percentage(j.at("tot_sThreePointersPercentage").get<int64_t>()); |
| 1831 | 1935 | x.set_tot_s_time_leading(j.at("tot_sTimeLeading").get<double>()); |
| 1936 | + if (j.find("tot_sTimesScoresLevel") != j.end() && !j.at("tot_sTimesScoresLevel").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1832 | 1937 | x.set_tot_s_times_scores_level(j.at("tot_sTimesScoresLevel").get<int64_t>()); |
| 1938 | + if (j.find("tot_sTurnovers") != j.end() && !j.at("tot_sTurnovers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1833 | 1939 | x.set_tot_s_turnovers(j.at("tot_sTurnovers").get<int64_t>()); |
| 1940 | + if (j.find("tot_sTurnoversTeam") != j.end() && !j.at("tot_sTurnoversTeam").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1834 | 1941 | x.set_tot_s_turnovers_team(j.at("tot_sTurnoversTeam").get<int64_t>()); |
| 1942 | + if (j.find("tot_sTwoPointersAttempted") != j.end() && !j.at("tot_sTwoPointersAttempted").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1835 | 1943 | x.set_tot_s_two_pointers_attempted(j.at("tot_sTwoPointersAttempted").get<int64_t>()); |
| 1944 | + if (j.find("tot_sTwoPointersMade") != j.end() && !j.at("tot_sTwoPointersMade").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1836 | 1945 | x.set_tot_s_two_pointers_made(j.at("tot_sTwoPointersMade").get<int64_t>()); |
| 1946 | + if (j.find("tot_sTwoPointersPercentage") != j.end() && !j.at("tot_sTwoPointersPercentage").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1837 | 1947 | x.set_tot_s_two_pointers_percentage(j.at("tot_sTwoPointersPercentage").get<int64_t>()); |
| 1838 | 1948 | } |
| 1839 | 1949 | |
| @@ -1926,9 +2036,12 @@ namespace quicktype { | ||
| 1926 | 2036 | |
| 1927 | 2037 | inline void from_json(const json & j, TopLevel& x) { |
| 1928 | 2038 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2039 | + if (j.find("attendance") != j.end() && !j.at("attendance").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1929 | 2040 | x.set_attendance(j.at("attendance").get<int64_t>()); |
| 1930 | 2041 | x.set_clock(j.at("clock").get<std::string>()); |
| 2042 | + if (j.find("disableMatch") != j.end() && !j.at("disableMatch").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1931 | 2043 | x.set_disable_match(j.at("disableMatch").get<int64_t>()); |
| 2044 | + if (j.find("inOT") != j.end() && !j.at("inOT").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1932 | 2045 | x.set_in_ot(j.at("inOT").get<int64_t>()); |
| 1933 | 2046 | x.set_leaddata(j.at("leaddata").get<std::vector<std::vector<LeaddatumElement>>>()); |
| 1934 | 2047 | x.set_officials_referee1(j.at("officials_referee1").get<std::string>()); |
| @@ -1936,14 +2049,19 @@ namespace quicktype { | ||
| 1936 | 2049 | x.set_officials_referee3(j.at("officials_referee3").get<std::string>()); |
| 1937 | 2050 | x.set_othermatches(j.at("othermatches").get<std::vector<Othermatch>>()); |
| 1938 | 2051 | x.set_pbp(j.at("pbp").get<std::vector<Pbp>>()); |
| 2052 | + if (j.find("period") != j.end() && !j.at("period").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1939 | 2053 | x.set_period(j.at("period").get<int64_t>()); |
| 2054 | + if (j.find("periodLengthOVERTIME") != j.end() && !j.at("periodLengthOVERTIME").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1940 | 2055 | x.set_period_length_overtime(j.at("periodLengthOVERTIME").get<int64_t>()); |
| 2056 | + if (j.find("periodLengthREGULAR") != j.end() && !j.at("periodLengthREGULAR").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1941 | 2057 | x.set_period_length_regular(j.at("periodLengthREGULAR").get<int64_t>()); |
| 1942 | 2058 | x.set_period_type(j.at("periodType").get<PerType>()); |
| 2059 | + if (j.find("periodsMax") != j.end() && !j.at("periodsMax").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1943 | 2060 | x.set_periods_max(j.at("periodsMax").get<int64_t>()); |
| 1944 | 2061 | x.set_scorers(j.at("scorers").get<std::map<std::string, std::vector<Scorer>>>()); |
| 1945 | 2062 | x.set_timeline(j.at("timeline").get<std::vector<nlohmann::json>>()); |
| 1946 | 2063 | x.set_tm(j.at("tm").get<std::map<std::string, Tm>>()); |
| 2064 | + if (j.find("totalTimeAdded") != j.end() && !j.at("totalTimeAdded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1947 | 2065 | x.set_total_time_added(j.at("totalTimeAdded").get<int64_t>()); |
| 1948 | 2066 | x.set_totallds(j.at("totallds").get<Totallds>()); |
| 1949 | 2067 | } |
Test case
1 generated file · +3 −0test/inputs/json/priority/nst-test-suite.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -798,6 +798,7 @@ namespace quicktype { | ||
| 798 | 798 | |
| 799 | 799 | inline void from_json(const json & j, YObjectEmptyKeyJson& x) { |
| 800 | 800 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 801 | + if (j.find("") != j.end() && !j.at("").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 801 | 802 | x.set_empty(j.at("").get<int64_t>()); |
| 802 | 803 | } |
| 803 | 804 | |
| @@ -808,6 +809,7 @@ namespace quicktype { | ||
| 808 | 809 | |
| 809 | 810 | inline void from_json(const json & j, YObjectEscapedNullInKeyJson& x) { |
| 810 | 811 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 812 | + if (j.find(([] { constexpr auto &s = "foo\u0000bar"; return std::string(s, sizeof(s) / sizeof(s[0]) - 1); }())) != j.end() && !j.at(([] { constexpr auto &s = "foo\u0000bar"; return std::string(s, sizeof(s) / sizeof(s[0]) - 1); }())).is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 811 | 813 | x.set_foo_bar(j.at(([] { constexpr auto &s = "foo\u0000bar"; return std::string(s, sizeof(s) / sizeof(s[0]) - 1); }())).get<int64_t>()); |
| 812 | 814 | } |
| 813 | 815 | |
| @@ -978,6 +980,7 @@ namespace quicktype { | ||
| 978 | 980 | x.set_y_string_utf8_json(j.at("y_string_utf8.json").get<std::vector<std::string>>()); |
| 979 | 981 | x.set_y_string_with_del_character_json(j.at("y_string_with_del_character.json").get<std::vector<std::string>>()); |
| 980 | 982 | x.set_y_structure_lonely_false_json(j.at("y_structure_lonely_false.json").get<bool>()); |
| 983 | + if (j.find("y_structure_lonely_int.json") != j.end() && !j.at("y_structure_lonely_int.json").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 981 | 984 | x.set_y_structure_lonely_int_json(j.at("y_structure_lonely_int.json").get<int64_t>()); |
| 982 | 985 | x.set_y_structure_lonely_negative_real_json(j.at("y_structure_lonely_negative_real.json").get<double>()); |
| 983 | 986 | x.set_y_structure_lonely_null_json(get_untyped(j, "y_structure_lonely_null.json")); |
Test case
1 generated file · +1 −0test/inputs/json/priority/omit-empty.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -131,6 +131,7 @@ namespace quicktype { | ||
| 131 | 131 | |
| 132 | 132 | inline void from_json(const json & j, Result& x) { |
| 133 | 133 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 134 | + if (j.find("age") != j.end() && !j.at("age").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 134 | 135 | x.set_age(j.at("age").get<int64_t>()); |
| 135 | 136 | x.set_name(get_untyped(j, "name")); |
| 136 | 137 | } |
Test case
1 generated file · +1 −0test/inputs/json/priority/php-validation.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -73,6 +73,7 @@ namespace quicktype { | ||
| 73 | 73 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 74 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 75 | 75 | x.set_boolean(j.at("boolean").get<bool>()); |
| 76 | + if (j.find("integer") != j.end() && !j.at("integer").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 76 | 77 | x.set_integer(j.at("integer").get<int64_t>()); |
| 77 | 78 | x.set_integers(j.at("integers").get<std::vector<int64_t>>()); |
| 78 | 79 | x.set_number(j.at("number").get<double>()); |
Test case
1 generated file · +26 −0test/inputs/json/priority/recursive.json
Mcplusplusdefault / quicktype.hpp+26 −0
| @@ -694,10 +694,12 @@ namespace quicktype { | ||
| 694 | 694 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 695 | 695 | x.set_concatenatecategoryname(j.at("concatenatecategoryname").get<bool>()); |
| 696 | 696 | x.set_hasoffer(j.at("hasoffer").get<bool>()); |
| 697 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 697 | 698 | x.set_id(j.at("id").get<int64_t>()); |
| 698 | 699 | x.set_isfinal(j.at("isfinal").get<bool>()); |
| 699 | 700 | x.set_links(j.at("links").get<std::vector<LinkElement>>()); |
| 700 | 701 | x.set_name(j.at("name").get<std::string>()); |
| 702 | + if (j.find("parentcategoryid") != j.end() && !j.at("parentcategoryid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 701 | 703 | x.set_parentcategoryid(j.at("parentcategoryid").get<int64_t>()); |
| 702 | 704 | x.set_thumbnail(j.at("thumbnail").get<CategoryThumbnail>()); |
| 703 | 705 | } |
| @@ -716,6 +718,7 @@ namespace quicktype { | ||
| 716 | 718 | |
| 717 | 719 | inline void from_json(const json & j, Eonandyear& x) { |
| 718 | 720 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 721 | + if (j.find("lowestsetbit") != j.end() && !j.at("lowestsetbit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 719 | 722 | x.set_lowestsetbit(j.at("lowestsetbit").get<int64_t>()); |
| 720 | 723 | } |
| 721 | 724 | |
| @@ -740,16 +743,24 @@ namespace quicktype { | ||
| 740 | 743 | |
| 741 | 744 | inline void from_json(const json & j, Date& x) { |
| 742 | 745 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 746 | + if (j.find("day") != j.end() && !j.at("day").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 743 | 747 | x.set_day(j.at("day").get<int64_t>()); |
| 744 | 748 | x.set_eonandyear(j.at("eonandyear").get<Eonandyear>()); |
| 749 | + if (j.find("hour") != j.end() && !j.at("hour").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 745 | 750 | x.set_hour(j.at("hour").get<int64_t>()); |
| 751 | + if (j.find("millisecond") != j.end() && !j.at("millisecond").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 746 | 752 | x.set_millisecond(j.at("millisecond").get<int64_t>()); |
| 753 | + if (j.find("minute") != j.end() && !j.at("minute").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 747 | 754 | x.set_minute(j.at("minute").get<int64_t>()); |
| 755 | + if (j.find("month") != j.end() && !j.at("month").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 748 | 756 | x.set_month(j.at("month").get<int64_t>()); |
| 757 | + if (j.find("second") != j.end() && !j.at("second").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 749 | 758 | x.set_second(j.at("second").get<int64_t>()); |
| 759 | + if (j.find("timezone") != j.end() && !j.at("timezone").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 750 | 760 | x.set_timezone(j.at("timezone").get<int64_t>()); |
| 751 | 761 | x.set_valid(j.at("valid").get<bool>()); |
| 752 | 762 | x.set_xmlschematype(j.at("xmlschematype").get<Xmlschematype>()); |
| 763 | + if (j.find("year") != j.end() && !j.at("year").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 753 | 764 | x.set_year(j.at("year").get<int64_t>()); |
| 754 | 765 | } |
| 755 | 766 | |
| @@ -772,8 +783,10 @@ namespace quicktype { | ||
| 772 | 783 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 773 | 784 | x.set_applicationid(j.at("applicationid").get<std::string>()); |
| 774 | 785 | x.set_applicationversion(j.at("applicationversion").get<std::string>()); |
| 786 | + if (j.find("code") != j.end() && !j.at("code").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 775 | 787 | x.set_code(j.at("code").get<int64_t>()); |
| 776 | 788 | x.set_date(j.at("date").get<Date>()); |
| 789 | + if (j.find("elapsedtime") != j.end() && !j.at("elapsedtime").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 777 | 790 | x.set_elapsedtime(j.at("elapsedtime").get<int64_t>()); |
| 778 | 791 | x.set_message(j.at("message").get<std::string>()); |
| 779 | 792 | x.set_status(j.at("status").get<std::string>()); |
| @@ -803,6 +816,7 @@ namespace quicktype { | ||
| 803 | 816 | inline void from_json(const json & j, Useraveragerating& x) { |
| 804 | 817 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 805 | 818 | x.set_links(j.at("links").get<std::vector<LinkElement>>()); |
| 819 | + if (j.find("numcomments") != j.end() && !j.at("numcomments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 806 | 820 | x.set_numcomments(j.at("numcomments").get<int64_t>()); |
| 807 | 821 | x.set_rating(j.at("rating").get<std::string>()); |
| 808 | 822 | } |
| @@ -847,8 +861,10 @@ namespace quicktype { | ||
| 847 | 861 | inline void from_json(const json & j, FormatsClass& x) { |
| 848 | 862 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 849 | 863 | x.set_formats(get_stack_optional<std::vector<Format>>(j, "formats")); |
| 864 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 850 | 865 | x.set_height(j.at("height").get<int64_t>()); |
| 851 | 866 | x.set_url(j.at("url").get<std::string>()); |
| 867 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 852 | 868 | x.set_width(j.at("width").get<int64_t>()); |
| 853 | 869 | } |
| 854 | 870 | |
| @@ -862,21 +878,26 @@ namespace quicktype { | ||
| 862 | 878 | |
| 863 | 879 | inline void from_json(const json & j, ProductProduct& x) { |
| 864 | 880 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 881 | + if (j.find("categoryid") != j.end() && !j.at("categoryid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 865 | 882 | x.set_categoryid(j.at("categoryid").get<int64_t>()); |
| 866 | 883 | x.set_currency(j.at("currency").get<Currency>()); |
| 867 | 884 | x.set_eco(j.at("eco").get<bool>()); |
| 868 | 885 | x.set_fulldescription(j.at("fulldescription").get<bool>()); |
| 869 | 886 | x.set_hasmetasearch(j.at("hasmetasearch").get<bool>()); |
| 887 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 870 | 888 | x.set_id(j.at("id").get<int64_t>()); |
| 871 | 889 | x.set_links(j.at("links").get<std::vector<LinkElement>>()); |
| 890 | + if (j.find("numoffers") != j.end() && !j.at("numoffers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 872 | 891 | x.set_numoffers(j.at("numoffers").get<int64_t>()); |
| 873 | 892 | x.set_pricemax(j.at("pricemax").get<std::string>()); |
| 874 | 893 | x.set_pricemin(j.at("pricemin").get<std::string>()); |
| 875 | 894 | x.set_productname(j.at("productname").get<std::string>()); |
| 895 | + if (j.find("quantity") != j.end() && !j.at("quantity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 876 | 896 | x.set_quantity(j.at("quantity").get<int64_t>()); |
| 877 | 897 | x.set_rating(j.at("rating").get<Rating>()); |
| 878 | 898 | x.set_specification(j.at("specification").get<Specification>()); |
| 879 | 899 | x.set_thumbnail(j.at("thumbnail").get<std::shared_ptr<FormatsClass>>()); |
| 900 | + if (j.find("totalsellers") != j.end() && !j.at("totalsellers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 880 | 901 | x.set_totalsellers(j.at("totalsellers").get<int64_t>()); |
| 881 | 902 | } |
| 882 | 903 | |
| @@ -915,12 +936,17 @@ namespace quicktype { | ||
| 915 | 936 | x.set_category(j.at("category").get<Category>()); |
| 916 | 937 | x.set_details(j.at("details").get<Details>()); |
| 917 | 938 | x.set_match(j.at("match").get<std::string>()); |
| 939 | + if (j.find("page") != j.end() && !j.at("page").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 918 | 940 | x.set_page(j.at("page").get<int64_t>()); |
| 919 | 941 | x.set_product(j.at("product").get<std::vector<ProductElement>>()); |
| 920 | 942 | x.set_schk(j.at("schk").get<bool>()); |
| 943 | + if (j.find("totallooseoffers") != j.end() && !j.at("totallooseoffers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 921 | 944 | x.set_totallooseoffers(j.at("totallooseoffers").get<int64_t>()); |
| 945 | + if (j.find("totalpages") != j.end() && !j.at("totalpages").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 922 | 946 | x.set_totalpages(j.at("totalpages").get<int64_t>()); |
| 947 | + if (j.find("totalresultsavailable") != j.end() && !j.at("totalresultsavailable").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 923 | 948 | x.set_totalresultsavailable(j.at("totalresultsavailable").get<int64_t>()); |
| 949 | + if (j.find("totalresultsreturned") != j.end() && !j.at("totalresultsreturned").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 924 | 950 | x.set_totalresultsreturned(j.at("totalresultsreturned").get<int64_t>()); |
| 925 | 951 | } |
Test case
1 generated file · +1 −0test/inputs/json/priority/uuids.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -79,6 +79,7 @@ namespace quicktype { | ||
| 79 | 79 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 80 | 80 | x.set_boolean_value(j.at("booleanValue").get<bool>()); |
| 81 | 81 | x.set_double_value(j.at("doubleValue").get<double>()); |
| 82 | + if (j.find("intValue") != j.end() && !j.at("intValue").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 82 | 83 | x.set_int_value(j.at("intValue").get<int64_t>()); |
| 83 | 84 | x.set_string_value(j.at("stringValue").get<std::string>()); |
| 84 | 85 | x.set_uuid_value(j.at("uuidValue").get<std::string>()); |
Test case
1 generated file · +3 −0test/inputs/json/samples/bitcoin-block.json
Mcplusplusdefault / quicktype.hpp+3 −0
| @@ -72,9 +72,12 @@ namespace quicktype { | ||
| 72 | 72 | |
| 73 | 73 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 74 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 75 | + if (j.find("block_index") != j.end() && !j.at("block_index").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 75 | 76 | x.set_block_index(j.at("block_index").get<int64_t>()); |
| 76 | 77 | x.set_hash(j.at("hash").get<std::string>()); |
| 78 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 77 | 79 | x.set_height(j.at("height").get<int64_t>()); |
| 80 | + if (j.find("time") != j.end() && !j.at("time").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 78 | 81 | x.set_time(j.at("time").get<int64_t>()); |
| 79 | 82 | x.set_tx_indexes(j.at("txIndexes").get<std::vector<int64_t>>()); |
| 80 | 83 | } |
Test case
1 generated file · +33 −0test/inputs/json/samples/github-events.json
Mcplusplusdefault / quicktype.hpp+33 −0
| @@ -1478,6 +1478,7 @@ namespace quicktype { | ||
| 1478 | 1478 | x.set_avatar_url(j.at("avatar_url").get<std::string>()); |
| 1479 | 1479 | x.set_display_login(get_stack_optional<std::string>(j, "display_login")); |
| 1480 | 1480 | x.set_gravatar_id(j.at("gravatar_id").get<std::string>()); |
| 1481 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1481 | 1482 | x.set_id(j.at("id").get<int64_t>()); |
| 1482 | 1483 | x.set_login(j.at("login").get<std::string>()); |
| 1483 | 1484 | x.set_url(j.at("url").get<std::string>()); |
| @@ -1502,6 +1503,7 @@ namespace quicktype { | ||
| 1502 | 1503 | x.set_gists_url(j.at("gists_url").get<std::string>()); |
| 1503 | 1504 | x.set_gravatar_id(j.at("gravatar_id").get<std::string>()); |
| 1504 | 1505 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1506 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1505 | 1507 | x.set_id(j.at("id").get<int64_t>()); |
| 1506 | 1508 | x.set_login(j.at("login").get<std::string>()); |
| 1507 | 1509 | x.set_organizations_url(j.at("organizations_url").get<std::string>()); |
| @@ -1540,6 +1542,7 @@ namespace quicktype { | ||
| 1540 | 1542 | x.set_body(j.at("body").get<std::string>()); |
| 1541 | 1543 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1542 | 1544 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1545 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1543 | 1546 | x.set_id(j.at("id").get<int64_t>()); |
| 1544 | 1547 | x.set_issue_url(j.at("issue_url").get<std::string>()); |
| 1545 | 1548 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| @@ -1592,6 +1595,7 @@ namespace quicktype { | ||
| 1592 | 1595 | inline void from_json(const json & j, Label& x) { |
| 1593 | 1596 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1594 | 1597 | x.set_color(j.at("color").get<std::string>()); |
| 1598 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1595 | 1599 | x.set_id(j.at("id").get<int64_t>()); |
| 1596 | 1600 | x.set_label_default(j.at("default").get<bool>()); |
| 1597 | 1601 | x.set_name(j.at("name").get<std::string>()); |
| @@ -1610,15 +1614,19 @@ namespace quicktype { | ||
| 1610 | 1614 | inline void from_json(const json & j, Milestone& x) { |
| 1611 | 1615 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1612 | 1616 | x.set_closed_at(get_untyped(j, "closed_at")); |
| 1617 | + if (j.find("closed_issues") != j.end() && !j.at("closed_issues").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1613 | 1618 | x.set_closed_issues(j.at("closed_issues").get<int64_t>()); |
| 1614 | 1619 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1615 | 1620 | x.set_creator(j.at("creator").get<User>()); |
| 1616 | 1621 | x.set_description(j.at("description").get<std::string>()); |
| 1617 | 1622 | x.set_due_on(get_stack_optional<std::string>(j, "due_on")); |
| 1618 | 1623 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1624 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1619 | 1625 | x.set_id(j.at("id").get<int64_t>()); |
| 1620 | 1626 | x.set_labels_url(j.at("labels_url").get<std::string>()); |
| 1627 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1621 | 1628 | x.set_number(j.at("number").get<int64_t>()); |
| 1629 | + if (j.find("open_issues") != j.end() && !j.at("open_issues").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1622 | 1630 | x.set_open_issues(j.at("open_issues").get<int64_t>()); |
| 1623 | 1631 | x.set_state(j.at("state").get<std::string>()); |
| 1624 | 1632 | x.set_title(j.at("title").get<std::string>()); |
| @@ -1667,16 +1675,19 @@ namespace quicktype { | ||
| 1667 | 1675 | x.set_assignees(j.at("assignees").get<std::vector<nlohmann::json>>()); |
| 1668 | 1676 | x.set_body(j.at("body").get<std::string>()); |
| 1669 | 1677 | x.set_closed_at(get_stack_optional<std::string>(j, "closed_at")); |
| 1678 | + if (j.find("comments") != j.end() && !j.at("comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1670 | 1679 | x.set_comments(j.at("comments").get<int64_t>()); |
| 1671 | 1680 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| 1672 | 1681 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1673 | 1682 | x.set_events_url(j.at("events_url").get<std::string>()); |
| 1674 | 1683 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1684 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1675 | 1685 | x.set_id(j.at("id").get<int64_t>()); |
| 1676 | 1686 | x.set_labels(j.at("labels").get<std::vector<Label>>()); |
| 1677 | 1687 | x.set_labels_url(j.at("labels_url").get<std::string>()); |
| 1678 | 1688 | x.set_locked(j.at("locked").get<bool>()); |
| 1679 | 1689 | x.set_milestone(get_stack_optional<Milestone>(j, "milestone")); |
| 1690 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1680 | 1691 | x.set_number(j.at("number").get<int64_t>()); |
| 1681 | 1692 | x.set_pull_request(get_stack_optional<IssuePullRequest>(j, "pull_request")); |
| 1682 | 1693 | x.set_repository_url(j.at("repository_url").get<std::string>()); |
| @@ -1733,7 +1744,9 @@ namespace quicktype { | ||
| 1733 | 1744 | x.set_downloads_url(j.at("downloads_url").get<std::string>()); |
| 1734 | 1745 | x.set_events_url(j.at("events_url").get<std::string>()); |
| 1735 | 1746 | x.set_fork(j.at("fork").get<bool>()); |
| 1747 | + if (j.find("forks") != j.end() && !j.at("forks").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1736 | 1748 | x.set_forks(j.at("forks").get<int64_t>()); |
| 1749 | + if (j.find("forks_count") != j.end() && !j.at("forks_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1737 | 1750 | x.set_forks_count(j.at("forks_count").get<int64_t>()); |
| 1738 | 1751 | x.set_forks_url(j.at("forks_url").get<std::string>()); |
| 1739 | 1752 | x.set_full_name(j.at("full_name").get<std::string>()); |
| @@ -1749,6 +1762,7 @@ namespace quicktype { | ||
| 1749 | 1762 | x.set_homepage(j.at("homepage").get<std::string>()); |
| 1750 | 1763 | x.set_hooks_url(j.at("hooks_url").get<std::string>()); |
| 1751 | 1764 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1765 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1752 | 1766 | x.set_id(j.at("id").get<int64_t>()); |
| 1753 | 1767 | x.set_issue_comment_url(j.at("issue_comment_url").get<std::string>()); |
| 1754 | 1768 | x.set_issue_events_url(j.at("issue_events_url").get<std::string>()); |
| @@ -1762,15 +1776,19 @@ namespace quicktype { | ||
| 1762 | 1776 | x.set_mirror_url(get_untyped(j, "mirror_url")); |
| 1763 | 1777 | x.set_name(j.at("name").get<std::string>()); |
| 1764 | 1778 | x.set_notifications_url(j.at("notifications_url").get<std::string>()); |
| 1779 | + if (j.find("open_issues") != j.end() && !j.at("open_issues").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1765 | 1780 | x.set_open_issues(j.at("open_issues").get<int64_t>()); |
| 1781 | + if (j.find("open_issues_count") != j.end() && !j.at("open_issues_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1766 | 1782 | x.set_open_issues_count(j.at("open_issues_count").get<int64_t>()); |
| 1767 | 1783 | x.set_owner(j.at("owner").get<User>()); |
| 1768 | 1784 | x.set_pulls_url(j.at("pulls_url").get<std::string>()); |
| 1769 | 1785 | x.set_pushed_at(j.at("pushed_at").get<std::string>()); |
| 1770 | 1786 | x.set_releases_url(j.at("releases_url").get<std::string>()); |
| 1771 | 1787 | x.set_repo_private(j.at("private").get<bool>()); |
| 1788 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1772 | 1789 | x.set_size(j.at("size").get<int64_t>()); |
| 1773 | 1790 | x.set_ssh_url(j.at("ssh_url").get<std::string>()); |
| 1791 | + if (j.find("stargazers_count") != j.end() && !j.at("stargazers_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1774 | 1792 | x.set_stargazers_count(j.at("stargazers_count").get<int64_t>()); |
| 1775 | 1793 | x.set_stargazers_url(j.at("stargazers_url").get<std::string>()); |
| 1776 | 1794 | x.set_statuses_url(j.at("statuses_url").get<std::string>()); |
| @@ -1782,7 +1800,9 @@ namespace quicktype { | ||
| 1782 | 1800 | x.set_trees_url(j.at("trees_url").get<std::string>()); |
| 1783 | 1801 | x.set_updated_at(j.at("updated_at").get<std::string>()); |
| 1784 | 1802 | x.set_url(j.at("url").get<std::string>()); |
| 1803 | + if (j.find("watchers") != j.end() && !j.at("watchers").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1785 | 1804 | x.set_watchers(j.at("watchers").get<int64_t>()); |
| 1805 | + if (j.find("watchers_count") != j.end() && !j.at("watchers_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1786 | 1806 | x.set_watchers_count(j.at("watchers_count").get<int64_t>()); |
| 1787 | 1807 | } |
| 1788 | 1808 | |
| @@ -1913,22 +1933,28 @@ namespace quicktype { | ||
| 1913 | 1933 | |
| 1914 | 1934 | inline void from_json(const json & j, PayloadPullRequest& x) { |
| 1915 | 1935 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 1936 | + if (j.find("additions") != j.end() && !j.at("additions").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1916 | 1937 | x.set_additions(j.at("additions").get<int64_t>()); |
| 1917 | 1938 | x.set_assignee(get_untyped(j, "assignee")); |
| 1918 | 1939 | x.set_assignees(j.at("assignees").get<std::vector<nlohmann::json>>()); |
| 1919 | 1940 | x.set_base(j.at("base").get<Base>()); |
| 1920 | 1941 | x.set_body(j.at("body").get<std::string>()); |
| 1942 | + if (j.find("changed_files") != j.end() && !j.at("changed_files").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1921 | 1943 | x.set_changed_files(j.at("changed_files").get<int64_t>()); |
| 1922 | 1944 | x.set_closed_at(j.at("closed_at").get<std::string>()); |
| 1945 | + if (j.find("comments") != j.end() && !j.at("comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1923 | 1946 | x.set_comments(j.at("comments").get<int64_t>()); |
| 1924 | 1947 | x.set_comments_url(j.at("comments_url").get<std::string>()); |
| 1948 | + if (j.find("commits") != j.end() && !j.at("commits").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1925 | 1949 | x.set_commits(j.at("commits").get<int64_t>()); |
| 1926 | 1950 | x.set_commits_url(j.at("commits_url").get<std::string>()); |
| 1927 | 1951 | x.set_created_at(j.at("created_at").get<std::string>()); |
| 1952 | + if (j.find("deletions") != j.end() && !j.at("deletions").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1928 | 1953 | x.set_deletions(j.at("deletions").get<int64_t>()); |
| 1929 | 1954 | x.set_diff_url(j.at("diff_url").get<std::string>()); |
| 1930 | 1955 | x.set_head(j.at("head").get<Base>()); |
| 1931 | 1956 | x.set_html_url(j.at("html_url").get<std::string>()); |
| 1957 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1932 | 1958 | x.set_id(j.at("id").get<int64_t>()); |
| 1933 | 1959 | x.set_issue_url(j.at("issue_url").get<std::string>()); |
| 1934 | 1960 | x.set_links(j.at("_links").get<Links>()); |
| @@ -1941,11 +1967,13 @@ namespace quicktype { | ||
| 1941 | 1967 | x.set_merged_at(j.at("merged_at").get<std::string>()); |
| 1942 | 1968 | x.set_merged_by(j.at("merged_by").get<User>()); |
| 1943 | 1969 | x.set_milestone(get_untyped(j, "milestone")); |
| 1970 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1944 | 1971 | x.set_number(j.at("number").get<int64_t>()); |
| 1945 | 1972 | x.set_patch_url(j.at("patch_url").get<std::string>()); |
| 1946 | 1973 | x.set_rebaseable(get_untyped(j, "rebaseable")); |
| 1947 | 1974 | x.set_requested_reviewers(j.at("requested_reviewers").get<std::vector<nlohmann::json>>()); |
| 1948 | 1975 | x.set_review_comment_url(j.at("review_comment_url").get<std::string>()); |
| 1976 | + if (j.find("review_comments") != j.end() && !j.at("review_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 1949 | 1977 | x.set_review_comments(j.at("review_comments").get<int64_t>()); |
| 1950 | 1978 | x.set_review_comments_url(j.at("review_comments_url").get<std::string>()); |
| 1951 | 1979 | x.set_state(j.at("state").get<std::string>()); |
| @@ -2008,16 +2036,20 @@ namespace quicktype { | ||
| 2008 | 2036 | x.set_comment(get_stack_optional<Comment>(j, "comment")); |
| 2009 | 2037 | x.set_commits(get_stack_optional<std::vector<Commit>>(j, "commits")); |
| 2010 | 2038 | x.set_description(get_stack_optional<std::string>(j, "description")); |
| 2039 | + if (j.find("distinct_size") != j.end() && !j.at("distinct_size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2011 | 2040 | x.set_distinct_size(get_stack_optional<int64_t>(j, "distinct_size")); |
| 2012 | 2041 | x.set_head(get_stack_optional<std::string>(j, "head")); |
| 2013 | 2042 | x.set_issue(get_stack_optional<Issue>(j, "issue")); |
| 2014 | 2043 | x.set_master_branch(get_stack_optional<std::string>(j, "master_branch")); |
| 2044 | + if (j.find("number") != j.end() && !j.at("number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2015 | 2045 | x.set_number(get_stack_optional<int64_t>(j, "number")); |
| 2016 | 2046 | x.set_pull_request(get_stack_optional<PayloadPullRequest>(j, "pull_request")); |
| 2047 | + if (j.find("push_id") != j.end() && !j.at("push_id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2017 | 2048 | x.set_push_id(get_stack_optional<int64_t>(j, "push_id")); |
| 2018 | 2049 | x.set_pusher_type(get_stack_optional<std::string>(j, "pusher_type")); |
| 2019 | 2050 | x.set_ref(get_stack_optional<std::string>(j, "ref")); |
| 2020 | 2051 | x.set_ref_type(get_stack_optional<std::string>(j, "ref_type")); |
| 2052 | + if (j.find("size") != j.end() && !j.at("size").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2021 | 2053 | x.set_size(get_stack_optional<int64_t>(j, "size")); |
| 2022 | 2054 | } |
| 2023 | 2055 | |
| @@ -2043,6 +2075,7 @@ namespace quicktype { | ||
| 2043 | 2075 | |
| 2044 | 2076 | inline void from_json(const json & j, TopLevelRepo& x) { |
| 2045 | 2077 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 2078 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 2046 | 2079 | x.set_id(j.at("id").get<int64_t>()); |
| 2047 | 2080 | x.set_name(j.at("name").get<std::string>()); |
| 2048 | 2081 | x.set_url(j.at("url").get<std::string>()); |
Test case
1 generated file · +2 −0test/inputs/json/samples/kitchen-sink.json
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -283,6 +283,7 @@ namespace quicktype { | ||
| 283 | 283 | |
| 284 | 284 | inline void from_json(const json & j, PurplePerson& x) { |
| 285 | 285 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 286 | + if (j.find("intOrString") != j.end() && !j.at("intOrString").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 286 | 287 | x.set_int_or_string(j.at("intOrString").get<int64_t>()); |
| 287 | 288 | x.set_name(j.at("name").get<std::string>()); |
| 288 | 289 | } |
| @@ -299,6 +300,7 @@ namespace quicktype { | ||
| 299 | 300 | x.set_date_value(j.at("dateValue").get<std::string>()); |
| 300 | 301 | x.set_different_things(j.at("differentThings").get<std::vector<DifferentThingElement>>()); |
| 301 | 302 | x.set_double_value(j.at("doubleValue").get<double>()); |
| 303 | + if (j.find("intValue") != j.end() && !j.at("intValue").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 302 | 304 | x.set_int_value(j.at("intValue").get<int64_t>()); |
| 303 | 305 | x.set_map_value(j.at("mapValue").get<std::map<std::string, std::optional<int64_t>>>()); |
| 304 | 306 | x.set_name_with_spaces(get_untyped(j, "name with spaces")); |
Test case
3 generated files · +6 −0test/inputs/json/samples/pokedex.json
Mcplusplus-multi-sourcedefault / Generators.hpp+2 −0
| @@ -50,9 +50,11 @@ namespace quicktype { | ||
| 50 | 50 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 51 | 51 | x.set_avg_spawns(j.at("avg_spawns").get<double>()); |
| 52 | 52 | x.set_candy(j.at("candy").get<std::string>()); |
| 53 | + if (j.find("candy_count") != j.end() && !j.at("candy_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 53 | 54 | x.set_candy_count(get_stack_optional<int64_t>(j, "candy_count")); |
| 54 | 55 | x.set_egg(j.at("egg").get<Egg>()); |
| 55 | 56 | x.set_height(j.at("height").get<std::string>()); |
| 57 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 56 | 58 | x.set_id(j.at("id").get<int64_t>()); |
| 57 | 59 | x.set_img(j.at("img").get<std::string>()); |
| 58 | 60 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
Mcplusplusboost-true--bed8626e10e6 / quicktype.hpp+2 −0
| @@ -253,9 +253,11 @@ namespace quicktype { | ||
| 253 | 253 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 254 | 254 | x.set_avg_spawns(j.at("avg_spawns").get<double>()); |
| 255 | 255 | x.set_candy(j.at("candy").get<std::string>()); |
| 256 | + if (j.find("candy_count") != j.end() && !j.at("candy_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 256 | 257 | x.set_candy_count(get_stack_optional<int64_t>(j, "candy_count")); |
| 257 | 258 | x.set_egg(j.at("egg").get<Egg>()); |
| 258 | 259 | x.set_height(j.at("height").get<std::string>()); |
| 260 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 259 | 261 | x.set_id(j.at("id").get<int64_t>()); |
| 260 | 262 | x.set_img(j.at("img").get<std::string>()); |
| 261 | 263 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
Mcplusplusdefault / quicktype.hpp+2 −0
| @@ -252,9 +252,11 @@ namespace quicktype { | ||
| 252 | 252 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 253 | 253 | x.set_avg_spawns(j.at("avg_spawns").get<double>()); |
| 254 | 254 | x.set_candy(j.at("candy").get<std::string>()); |
| 255 | + if (j.find("candy_count") != j.end() && !j.at("candy_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 255 | 256 | x.set_candy_count(get_stack_optional<int64_t>(j, "candy_count")); |
| 256 | 257 | x.set_egg(j.at("egg").get<Egg>()); |
| 257 | 258 | x.set_height(j.at("height").get<std::string>()); |
| 259 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 258 | 260 | x.set_id(j.at("id").get<int64_t>()); |
| 259 | 261 | x.set_img(j.at("img").get<std::string>()); |
| 260 | 262 | x.set_multipliers(get_stack_optional<std::vector<double>>(j, "multipliers")); |
Test case
1 generated file · +11 −0test/inputs/json/samples/reddit.json
Mcplusplusdefault / quicktype.hpp+11 −0
| @@ -694,8 +694,10 @@ namespace quicktype { | ||
| 694 | 694 | |
| 695 | 695 | inline void from_json(const json & j, Source& x) { |
| 696 | 696 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 697 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 697 | 698 | x.set_height(j.at("height").get<int64_t>()); |
| 698 | 699 | x.set_url(j.at("url").get<std::string>()); |
| 700 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 699 | 701 | x.set_width(j.at("width").get<int64_t>()); |
| 700 | 702 | } |
| 701 | 703 | |
| @@ -773,12 +775,16 @@ namespace quicktype { | ||
| 773 | 775 | x.set_can_mod_post(j.at("can_mod_post").get<bool>()); |
| 774 | 776 | x.set_clicked(j.at("clicked").get<bool>()); |
| 775 | 777 | x.set_contest_mode(j.at("contest_mode").get<bool>()); |
| 778 | + if (j.find("created") != j.end() && !j.at("created").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 776 | 779 | x.set_created(j.at("created").get<int64_t>()); |
| 780 | + if (j.find("created_utc") != j.end() && !j.at("created_utc").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 777 | 781 | x.set_created_utc(j.at("created_utc").get<int64_t>()); |
| 778 | 782 | x.set_distinguished(get_stack_optional<std::string>(j, "distinguished")); |
| 779 | 783 | x.set_domain(j.at("domain").get<Domain>()); |
| 784 | + if (j.find("downs") != j.end() && !j.at("downs").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 780 | 785 | x.set_downs(j.at("downs").get<int64_t>()); |
| 781 | 786 | x.set_edited(j.at("edited").get<bool>()); |
| 787 | + if (j.find("gilded") != j.end() && !j.at("gilded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 782 | 788 | x.set_gilded(j.at("gilded").get<int64_t>()); |
| 783 | 789 | x.set_hidden(j.at("hidden").get<bool>()); |
| 784 | 790 | x.set_hide_score(j.at("hide_score").get<bool>()); |
| @@ -793,6 +799,7 @@ namespace quicktype { | ||
| 793 | 799 | x.set_media_embed(j.at("media_embed").get<MediaEmbed>()); |
| 794 | 800 | x.set_mod_reports(j.at("mod_reports").get<std::vector<nlohmann::json>>()); |
| 795 | 801 | x.set_name(j.at("name").get<std::string>()); |
| 802 | + if (j.find("num_comments") != j.end() && !j.at("num_comments").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 796 | 803 | x.set_num_comments(j.at("num_comments").get<int64_t>()); |
| 797 | 804 | x.set_num_reports(get_untyped(j, "num_reports")); |
| 798 | 805 | x.set_over_18(j.at("over_18").get<bool>()); |
| @@ -804,6 +811,7 @@ namespace quicktype { | ||
| 804 | 811 | x.set_removal_reason(get_untyped(j, "removal_reason")); |
| 805 | 812 | x.set_report_reasons(get_untyped(j, "report_reasons")); |
| 806 | 813 | x.set_saved(j.at("saved").get<bool>()); |
| 814 | + if (j.find("score") != j.end() && !j.at("score").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 807 | 815 | x.set_score(j.at("score").get<int64_t>()); |
| 808 | 816 | x.set_secure_media(get_untyped(j, "secure_media")); |
| 809 | 817 | x.set_secure_media_embed(j.at("secure_media_embed").get<MediaEmbed>()); |
| @@ -817,9 +825,12 @@ namespace quicktype { | ||
| 817 | 825 | x.set_subreddit_type(j.at("subreddit_type").get<SubredditType>()); |
| 818 | 826 | x.set_suggested_sort(get_untyped(j, "suggested_sort")); |
| 819 | 827 | x.set_thumbnail(j.at("thumbnail").get<std::string>()); |
| 828 | + if (j.find("thumbnail_height") != j.end() && !j.at("thumbnail_height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 820 | 829 | x.set_thumbnail_height(j.at("thumbnail_height").get<int64_t>()); |
| 830 | + if (j.find("thumbnail_width") != j.end() && !j.at("thumbnail_width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 821 | 831 | x.set_thumbnail_width(j.at("thumbnail_width").get<int64_t>()); |
| 822 | 832 | x.set_title(j.at("title").get<std::string>()); |
| 833 | + if (j.find("ups") != j.end() && !j.at("ups").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 823 | 834 | x.set_ups(j.at("ups").get<int64_t>()); |
| 824 | 835 | x.set_url(j.at("url").get<std::string>()); |
| 825 | 836 | x.set_user_reports(j.at("user_reports").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +1 −0test/inputs/json/samples/simple-object.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -62,6 +62,7 @@ namespace quicktype { | ||
| 62 | 62 | |
| 63 | 63 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 64 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 65 | + if (j.find("date") != j.end() && !j.at("date").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 65 | 66 | x.set_date(j.at("date").get<int64_t>()); |
| 66 | 67 | x.set_title(j.at("title").get<std::string>()); |
| 67 | 68 | x.set_validity(j.at("validity").get<bool>()); |
Test case
1 generated file · +9 −0test/inputs/json/samples/spotify-album.json
Mcplusplusdefault / quicktype.hpp+9 −0
| @@ -433,8 +433,10 @@ namespace quicktype { | ||
| 433 | 433 | |
| 434 | 434 | inline void from_json(const json & j, Image& x) { |
| 435 | 435 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 436 | + if (j.find("height") != j.end() && !j.at("height").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 436 | 437 | x.set_height(j.at("height").get<int64_t>()); |
| 437 | 438 | x.set_url(j.at("url").get<std::string>()); |
| 439 | + if (j.find("width") != j.end() && !j.at("width").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 438 | 440 | x.set_width(j.at("width").get<int64_t>()); |
| 439 | 441 | } |
| 440 | 442 | |
| @@ -449,7 +451,9 @@ namespace quicktype { | ||
| 449 | 451 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 450 | 452 | x.set_artists(j.at("artists").get<std::vector<Artist>>()); |
| 451 | 453 | x.set_available_markets(j.at("available_markets").get<std::vector<std::string>>()); |
| 454 | + if (j.find("disc_number") != j.end() && !j.at("disc_number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 452 | 455 | x.set_disc_number(j.at("disc_number").get<int64_t>()); |
| 456 | + if (j.find("duration_ms") != j.end() && !j.at("duration_ms").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 453 | 457 | x.set_duration_ms(j.at("duration_ms").get<int64_t>()); |
| 454 | 458 | x.set_external_urls(j.at("external_urls").get<ExternalUrls>()); |
| 455 | 459 | x.set_href(j.at("href").get<std::string>()); |
| @@ -457,6 +461,7 @@ namespace quicktype { | ||
| 457 | 461 | x.set_item_explicit(j.at("explicit").get<bool>()); |
| 458 | 462 | x.set_name(j.at("name").get<std::string>()); |
| 459 | 463 | x.set_preview_url(j.at("preview_url").get<std::string>()); |
| 464 | + if (j.find("track_number") != j.end() && !j.at("track_number").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 460 | 465 | x.set_track_number(j.at("track_number").get<int64_t>()); |
| 461 | 466 | x.set_type(j.at("type").get<std::string>()); |
| 462 | 467 | x.set_uri(j.at("uri").get<std::string>()); |
| @@ -483,10 +488,13 @@ namespace quicktype { | ||
| 483 | 488 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 484 | 489 | x.set_href(j.at("href").get<std::string>()); |
| 485 | 490 | x.set_items(j.at("items").get<std::vector<Item>>()); |
| 491 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 486 | 492 | x.set_limit(j.at("limit").get<int64_t>()); |
| 487 | 493 | x.set_next(get_untyped(j, "next")); |
| 494 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 488 | 495 | x.set_offset(j.at("offset").get<int64_t>()); |
| 489 | 496 | x.set_previous(get_untyped(j, "previous")); |
| 497 | + if (j.find("total") != j.end() && !j.at("total").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 490 | 498 | x.set_total(j.at("total").get<int64_t>()); |
| 491 | 499 | } |
| 492 | 500 | |
| @@ -514,6 +522,7 @@ namespace quicktype { | ||
| 514 | 522 | x.set_id(j.at("id").get<std::string>()); |
| 515 | 523 | x.set_images(j.at("images").get<std::vector<Image>>()); |
| 516 | 524 | x.set_name(j.at("name").get<std::string>()); |
| 525 | + if (j.find("popularity") != j.end() && !j.at("popularity").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 517 | 526 | x.set_popularity(j.at("popularity").get<int64_t>()); |
| 518 | 527 | x.set_release_date(j.at("release_date").get<std::string>()); |
| 519 | 528 | x.set_release_date_precision(j.at("release_date_precision").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/json/samples/us-avg-temperatures.json
Mcplusplusdefault / quicktype.hpp+1 −0
| @@ -124,6 +124,7 @@ namespace quicktype { | ||
| 124 | 124 | inline void from_json(const json & j, Description& x) { |
| 125 | 125 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 126 | 126 | x.set_base_period(j.at("base_period").get<std::string>()); |
| 127 | + if (j.find("missing") != j.end() && !j.at("missing").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 127 | 128 | x.set_missing(j.at("missing").get<int64_t>()); |
| 128 | 129 | x.set_title(j.at("title").get<std::string>()); |
| 129 | 130 | x.set_units(j.at("units").get<std::string>()); |
Test case
1 generated file · +4 −0test/inputs/json/samples/us-senators.json
Mcplusplusdefault / quicktype.hpp+4 −0
| @@ -448,8 +448,11 @@ namespace quicktype { | ||
| 448 | 448 | |
| 449 | 449 | inline void from_json(const json & j, Meta& x) { |
| 450 | 450 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 451 | + if (j.find("limit") != j.end() && !j.at("limit").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 451 | 452 | x.set_limit(j.at("limit").get<int64_t>()); |
| 453 | + if (j.find("offset") != j.end() && !j.at("offset").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 452 | 454 | x.set_offset(j.at("offset").get<int64_t>()); |
| 455 | + if (j.find("total_count") != j.end() && !j.at("total_count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 453 | 456 | x.set_total_count(j.at("total_count").get<int64_t>()); |
| 454 | 457 | } |
| 455 | 458 | |
| @@ -482,6 +485,7 @@ namespace quicktype { | ||
| 482 | 485 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 483 | 486 | x.set_bioguideid(j.at("bioguideid").get<std::string>()); |
| 484 | 487 | x.set_birthday(j.at("birthday").get<std::string>()); |
| 488 | + if (j.find("cspanid") != j.end() && !j.at("cspanid").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 485 | 489 | x.set_cspanid(j.at("cspanid").get<int64_t>()); |
| 486 | 490 | x.set_firstname(j.at("firstname").get<std::string>()); |
| 487 | 491 | x.set_gender(j.at("gender").get<Gender>()); |
Test case
1 generated file · +1 −0test/inputs/schema/class-map-union.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -137,6 +137,7 @@ struct adl_serializer<std::variant<bool, quicktype::UnionClass, double, std::str | ||
| 137 | 137 | namespace quicktype { |
| 138 | 138 | inline void from_json(const json & j, UnionClass& x) { |
| 139 | 139 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 140 | + if (j.find("quux") != j.end() && !j.at("quux").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 140 | 141 | x.set_quux(get_stack_optional<int64_t>(j, "quux")); |
| 141 | 142 | } |
Test case
1 generated file · +1 −0test/inputs/schema/const-non-string.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -77,6 +77,7 @@ namespace quicktype { | ||
| 77 | 77 | |
| 78 | 78 | inline void from_json(const json & j, TopLevel& x) { |
| 79 | 79 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 80 | + if (j.find("amount") != j.end() && !j.at("amount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 80 | 81 | x.set_amount(j.at("amount").get<int64_t>()); |
| 81 | 82 | x.set_enabled(j.at("enabled").get<bool>()); |
| 82 | 83 | x.set_kind(j.at("kind").get<Kind>()); |
Test case
1 generated file · +1 −0test/inputs/schema/cut-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -52,6 +52,7 @@ namespace quicktype { | ||
| 52 | 52 | |
| 53 | 53 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 54 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 55 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 55 | 56 | x.set_foo(j.at("foo").get<int64_t>()); |
| 56 | 57 | } |
Test case
1 generated file · +1 −0test/inputs/schema/default-value.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -55,6 +55,7 @@ namespace quicktype { | ||
| 55 | 55 | |
| 56 | 56 | inline void from_json(const json & j, TopLevel& x) { |
| 57 | 57 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 58 | + if (j.find("id") != j.end() && !j.at("id").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 58 | 59 | x.set_id(j.at("id").get<int64_t>()); |
| 59 | 60 | } |
Test case
1 generated file · +1 −0test/inputs/schema/id-no-address.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -52,6 +52,7 @@ namespace quicktype { | ||
| 52 | 52 | |
| 53 | 53 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 54 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 55 | + if (j.find("item") != j.end() && !j.at("item").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 55 | 56 | x.set_item(j.at("item").get<int64_t>()); |
| 56 | 57 | } |
Test case
1 generated file · +1 −0test/inputs/schema/id-root.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -52,6 +52,7 @@ namespace quicktype { | ||
| 52 | 52 | |
| 53 | 53 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 54 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 55 | + if (j.find("bar") != j.end() && !j.at("bar").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 55 | 56 | x.set_bar(j.at("bar").get<int64_t>()); |
| 56 | 57 | } |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-all-of.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -62,6 +62,7 @@ namespace quicktype { | ||
| 62 | 62 | |
| 63 | 63 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 64 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 65 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 65 | 66 | x.set_foo(j.at("foo").get<int64_t>()); |
| 66 | 67 | x.set_bar(j.at("bar").get<bool>()); |
| 67 | 68 | x.set_quux(j.at("quux").get<std::string>()); |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-class-array-union.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -135,6 +135,7 @@ struct adl_serializer<std::variant<std::vector<int64_t>, bool, quicktype::FooCla | ||
| 135 | 135 | namespace quicktype { |
| 136 | 136 | inline void from_json(const json & j, FooClass& x) { |
| 137 | 137 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 138 | + if (j.find("bar") != j.end() && !j.at("bar").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 138 | 139 | x.set_bar(j.at("bar").get<int64_t>()); |
| 139 | 140 | } |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-one-of.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -119,6 +119,7 @@ namespace quicktype { | ||
| 119 | 119 | |
| 120 | 120 | inline void from_json(const json & j, TopLevel& x) { |
| 121 | 121 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 122 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 122 | 123 | x.set_foo(j.at("foo").get<int64_t>()); |
| 123 | 124 | x.set_bar(get_stack_optional<bool>(j, "bar")); |
| 124 | 125 | x.set_quux(get_stack_optional<std::string>(j, "quux")); |
Test case
1 generated file · +9 −0test/inputs/schema/integer-type.schema
Mschema-cplusplusdefault / quicktype.hpp+9 −0
| @@ -240,14 +240,23 @@ namespace quicktype { | ||
| 240 | 240 | |
| 241 | 241 | inline void from_json(const json & j, TopLevel& x) { |
| 242 | 242 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 243 | + if (j.find("above_i32_max") != j.end() && !j.at("above_i32_max").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 243 | 244 | x.set_above_i32_max(j.at("above_i32_max").get<int64_t>()); |
| 245 | + if (j.find("below_i32_min") != j.end() && !j.at("below_i32_min").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 244 | 246 | x.set_below_i32_min(j.at("below_i32_min").get<int64_t>()); |
| 247 | + if (j.find("i32_range") != j.end() && !j.at("i32_range").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 245 | 248 | x.set_i32_range(j.at("i32_range").get<int64_t>()); |
| 249 | + if (j.find("large_bounds") != j.end() && !j.at("large_bounds").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 246 | 250 | x.set_large_bounds(j.at("large_bounds").get<int64_t>()); |
| 251 | + if (j.find("only_maximum") != j.end() && !j.at("only_maximum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 247 | 252 | x.set_only_maximum(j.at("only_maximum").get<int64_t>()); |
| 253 | + if (j.find("only_minimum") != j.end() && !j.at("only_minimum").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 248 | 254 | x.set_only_minimum(j.at("only_minimum").get<int64_t>()); |
| 255 | + if (j.find("small_negative") != j.end() && !j.at("small_negative").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 249 | 256 | x.set_small_negative(j.at("small_negative").get<int64_t>()); |
| 257 | + if (j.find("small_positive") != j.end() && !j.at("small_positive").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 250 | 258 | x.set_small_positive(j.at("small_positive").get<int64_t>()); |
| 259 | + if (j.find("unbounded") != j.end() && !j.at("unbounded").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 251 | 260 | x.set_unbounded(j.at("unbounded").get<int64_t>()); |
| 252 | 261 | } |
Test case
1 generated file · +8 −0test/inputs/schema/minmax-integer.schema
Mschema-cplusplusdefault / quicktype.hpp+8 −0
| @@ -231,13 +231,21 @@ namespace quicktype { | ||
| 231 | 231 | |
| 232 | 232 | inline void from_json(const json & j, TopLevel& x) { |
| 233 | 233 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 234 | + if (j.find("free") != j.end() && !j.at("free").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 234 | 235 | x.set_free(j.at("free").get<int64_t>()); |
| 236 | + if (j.find("intersection") != j.end() && !j.at("intersection").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 235 | 237 | x.set_intersection(j.at("intersection").get<int64_t>()); |
| 238 | + if (j.find("max") != j.end() && !j.at("max").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 236 | 239 | x.set_max(j.at("max").get<int64_t>()); |
| 240 | + if (j.find("min") != j.end() && !j.at("min").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 237 | 241 | x.set_min(j.at("min").get<int64_t>()); |
| 242 | + if (j.find("minmax") != j.end() && !j.at("minmax").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 238 | 243 | x.set_minmax(j.at("minmax").get<int64_t>()); |
| 244 | + if (j.find("minMaxIntersection") != j.end() && !j.at("minMaxIntersection").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 239 | 245 | x.set_min_max_intersection(j.at("minMaxIntersection").get<int64_t>()); |
| 246 | + if (j.find("minMaxUnion") != j.end() && !j.at("minMaxUnion").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 240 | 247 | x.set_min_max_union(j.at("minMaxUnion").get<int64_t>()); |
| 248 | + if (j.find("union") != j.end() && !j.at("union").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 241 | 249 | x.set_top_level_union(j.at("union").get<int64_t>()); |
| 242 | 250 | } |
Test case
1 generated file · +2 −0test/inputs/schema/non-standard-ref.schema
Mschema-cplusplusdefault / quicktype.hpp+2 −0
| @@ -62,7 +62,9 @@ namespace quicktype { | ||
| 62 | 62 | |
| 63 | 63 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 64 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 65 | + if (j.find("bar") != j.end() && !j.at("bar").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 65 | 66 | x.set_bar(j.at("bar").get<int64_t>()); |
| 67 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 66 | 68 | x.set_foo(j.at("foo").get<int64_t>()); |
| 67 | 69 | x.set_quux(j.at("quux").get<bool>()); |
| 68 | 70 | } |
Test case
1 generated file · +2 −0test/inputs/schema/optional-const-ref.schema
Mschema-cplusplusdefault / quicktype.hpp+2 −0
| @@ -316,9 +316,11 @@ namespace quicktype { | ||
| 316 | 316 | inline void from_json(const json & j, TopLevel& x) { |
| 317 | 317 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 318 | 318 | x.set_coordinates(get_stack_optional<std::vector<Coordinate>>(j, "coordinates")); |
| 319 | + if (j.find("count") != j.end() && !j.at("count").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 319 | 320 | x.set_count(get_stack_optional<int64_t>(j, "count")); |
| 320 | 321 | x.set_label(get_stack_optional<std::string>(j, "label")); |
| 321 | 322 | x.set_required_coordinates(j.at("requiredCoordinates").get<std::vector<Coordinate>>()); |
| 323 | + if (j.find("requiredCount") != j.end() && !j.at("requiredCount").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 322 | 324 | x.set_required_count(j.at("requiredCount").get<int64_t>()); |
| 323 | 325 | x.set_required_label(j.at("requiredLabel").get<std::string>()); |
| 324 | 326 | x.set_weight(get_stack_optional<double>(j, "weight")); |
Test case
1 generated file · +2 −0test/inputs/schema/optional-constraints.schema
Mschema-cplusplusdefault / quicktype.hpp+2 −0
| @@ -272,9 +272,11 @@ namespace quicktype { | ||
| 272 | 272 | inline void from_json(const json & j, TopLevel& x) { |
| 273 | 273 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 274 | 274 | x.set_opt_double(get_stack_optional<double>(j, "optDouble")); |
| 275 | + if (j.find("optInt") != j.end() && !j.at("optInt").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 275 | 276 | x.set_opt_int(get_stack_optional<int64_t>(j, "optInt")); |
| 276 | 277 | x.set_opt_pattern(get_stack_optional<std::string>(j, "optPattern")); |
| 277 | 278 | x.set_opt_string(get_stack_optional<std::string>(j, "optString")); |
| 279 | + if (j.find("reqZeroMin") != j.end() && !j.at("reqZeroMin").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 278 | 280 | x.set_req_zero_min(j.at("reqZeroMin").get<int64_t>()); |
| 279 | 281 | } |
Test case
1 generated file · +1 −0test/inputs/schema/ref-id-files.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -52,6 +52,7 @@ namespace quicktype { | ||
| 52 | 52 | |
| 53 | 53 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 54 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 55 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 55 | 56 | x.set_foo(j.at("foo").get<int64_t>()); |
| 56 | 57 | } |
Test case
1 generated file · +1 −0test/inputs/schema/required-non-properties.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -57,6 +57,7 @@ namespace quicktype { | ||
| 57 | 57 | |
| 58 | 58 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 59 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 60 | + if (j.find("foo") != j.end() && !j.at("foo").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 60 | 61 | x.set_foo(j.at("foo").get<int64_t>()); |
| 61 | 62 | x.set_bar(get_untyped(j, "bar")); |
| 62 | 63 | } |
Test case
1 generated file · +1 −0test/inputs/schema/union.schema
Mschema-cplusplusdefault / quicktype.hpp+1 −0
| @@ -121,6 +121,7 @@ namespace quicktype { | ||
| 121 | 121 | |
| 122 | 122 | inline void from_json(const json & j, TopLevelElement& x) { |
| 123 | 123 | if (!j.is_object()) throw std::runtime_error("Expected object"); |
| 124 | + if (j.find("one") != j.end() && !j.at("one").is_number_integer()) throw std::runtime_error("Expected integer"); | |
| 124 | 125 | x.set_one(get_stack_optional<int64_t>(j, "one")); |
| 125 | 126 | x.set_two(j.at("two").get<bool>()); |
| 126 | 127 | x.set_three(get_stack_optional<double>(j, "three")); |
No generated files match these filters.