Test case
1 generated file · +1 −0test/inputs/graphql/github2.graphql
Mgraphql-pikedefault / TopLevel.pmod+1 −0
| @@ -99,6 +99,7 @@ class RepositoryConnection { | ||
| 99 | 99 | RepositoryConnection RepositoryConnection_from_JSON(mixed json) { |
| 100 | 100 | RepositoryConnection retval = RepositoryConnection(); |
| 101 | 101 | |
| 102 | + if (!intp(json["totalCount"])) error("Expected integer"); | |
| 102 | 103 | retval.total_count = json["totalCount"]; |
| 103 | 104 | if (!has_index(json, "nodes")) error("Missing required property"); |
| 104 | 105 | retval.nodes = json["nodes"]; |
Test case
1 generated file · +1 −0test/inputs/graphql/github7.graphql
Mgraphql-pikedefault / TopLevel.pmod+1 −0
| @@ -180,6 +180,7 @@ class Connection { | ||
| 180 | 180 | Connection Connection_from_JSON(mixed json) { |
| 181 | 181 | Connection retval = Connection(); |
| 182 | 182 | |
| 183 | + if (!intp(json["totalCount"])) error("Expected integer"); | |
| 183 | 184 | retval.total_count = json["totalCount"]; |
| 184 | 185 | |
| 185 | 186 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/00c36.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -120,9 +120,12 @@ class FluffyTopLevel { | ||
| 120 | 120 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 121 | 121 | FluffyTopLevel retval = FluffyTopLevel(); |
| 122 | 122 | |
| 123 | + if (!intp(json["page"])) error("Expected integer"); | |
| 123 | 124 | retval.page = json["page"]; |
| 125 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 124 | 126 | retval.pages = json["pages"]; |
| 125 | 127 | retval.per_page = json["per_page"]; |
| 128 | + if (!intp(json["total"])) error("Expected integer"); | |
| 126 | 129 | retval.total = json["total"]; |
| 127 | 130 | |
| 128 | 131 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/010b1.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/016af.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/09f54.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -81,6 +81,7 @@ Description Description_from_JSON(mixed json) { | ||
| 81 | 81 | Description retval = Description(); |
| 82 | 82 | |
| 83 | 83 | retval.base_period = json["base_period"]; |
| 84 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 84 | 85 | retval.missing = json["missing"]; |
| 85 | 86 | retval.title = json["title"]; |
| 86 | 87 | retval.units = json["units"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/0a358.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
| @@ -95,6 +98,7 @@ Result Result_from_JSON(mixed json) { | ||
| 95 | 98 | |
| 96 | 99 | retval.code = json["code"]; |
| 97 | 100 | retval.created_at = json["created_at"]; |
| 101 | + if (!intp(json["id"])) error("Expected integer"); | |
| 98 | 102 | retval.id = json["id"]; |
| 99 | 103 | retval.name = json["name"]; |
| 100 | 104 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +20 −0test/inputs/json/misc/0a91a.json
Mpikedefault / TopLevel.pmod+20 −0
| @@ -92,6 +92,7 @@ Actor Actor_from_JSON(mixed json) { | ||
| 92 | 92 | retval.avatar_url = json["avatar_url"]; |
| 93 | 93 | retval.display_login = json["display_login"]; |
| 94 | 94 | retval.gravatar_id = json["gravatar_id"]; |
| 95 | + if (!intp(json["id"])) error("Expected integer"); | |
| 95 | 96 | retval.id = json["id"]; |
| 96 | 97 | retval.login = json["login"]; |
| 97 | 98 | retval.url = json["url"]; |
| @@ -311,24 +312,30 @@ class PullRequest { | ||
| 311 | 312 | PullRequest PullRequest_from_JSON(mixed json) { |
| 312 | 313 | PullRequest retval = PullRequest(); |
| 313 | 314 | |
| 315 | + if (!intp(json["additions"])) error("Expected integer"); | |
| 314 | 316 | retval.additions = json["additions"]; |
| 315 | 317 | retval.assignee = json["assignee"]; |
| 316 | 318 | retval.assignees = json["assignees"]; |
| 317 | 319 | Base_from_JSON(json["base"]); |
| 318 | 320 | retval.base = json["base"]; |
| 319 | 321 | retval.body = json["body"]; |
| 322 | + if (!intp(json["changed_files"])) error("Expected integer"); | |
| 320 | 323 | retval.changed_files = json["changed_files"]; |
| 321 | 324 | retval.closed_at = json["closed_at"]; |
| 325 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 322 | 326 | retval.comments = json["comments"]; |
| 323 | 327 | retval.comments_url = json["comments_url"]; |
| 328 | + if (!intp(json["commits"])) error("Expected integer"); | |
| 324 | 329 | retval.commits = json["commits"]; |
| 325 | 330 | retval.commits_url = json["commits_url"]; |
| 326 | 331 | retval.created_at = json["created_at"]; |
| 332 | + if (!intp(json["deletions"])) error("Expected integer"); | |
| 327 | 333 | retval.deletions = json["deletions"]; |
| 328 | 334 | retval.diff_url = json["diff_url"]; |
| 329 | 335 | Base_from_JSON(json["head"]); |
| 330 | 336 | retval.head = json["head"]; |
| 331 | 337 | retval.html_url = json["html_url"]; |
| 338 | + if (!intp(json["id"])) error("Expected integer"); | |
| 332 | 339 | retval.id = json["id"]; |
| 333 | 340 | retval.issue_url = json["issue_url"]; |
| 334 | 341 | Links_from_JSON(json["_links"]); |
| @@ -346,11 +353,13 @@ PullRequest PullRequest_from_JSON(mixed json) { | ||
| 346 | 353 | MergedBy_from_JSON(json["merged_by"]); |
| 347 | 354 | retval.merged_by = json["merged_by"]; |
| 348 | 355 | retval.milestone = json["milestone"]; |
| 356 | + if (!intp(json["number"])) error("Expected integer"); | |
| 349 | 357 | retval.number = json["number"]; |
| 350 | 358 | retval.patch_url = json["patch_url"]; |
| 351 | 359 | retval.rebaseable = json["rebaseable"]; |
| 352 | 360 | retval.requested_reviewers = json["requested_reviewers"]; |
| 353 | 361 | retval.review_comment_url = json["review_comment_url"]; |
| 362 | + if (!intp(json["review_comments"])) error("Expected integer"); | |
| 354 | 363 | retval.review_comments = json["review_comments"]; |
| 355 | 364 | retval.review_comments_url = json["review_comments_url"]; |
| 356 | 365 | retval.state = json["state"]; |
| @@ -568,7 +577,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 568 | 577 | retval.events_url = json["events_url"]; |
| 569 | 578 | if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool"); |
| 570 | 579 | retval.fork = json["fork"]; |
| 580 | + if (!intp(json["forks"])) error("Expected integer"); | |
| 571 | 581 | retval.forks = json["forks"]; |
| 582 | + if (!intp(json["forks_count"])) error("Expected integer"); | |
| 572 | 583 | retval.forks_count = json["forks_count"]; |
| 573 | 584 | retval.forks_url = json["forks_url"]; |
| 574 | 585 | retval.full_name = json["full_name"]; |
| @@ -589,6 +600,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 589 | 600 | retval.homepage = json["homepage"]; |
| 590 | 601 | retval.hooks_url = json["hooks_url"]; |
| 591 | 602 | retval.html_url = json["html_url"]; |
| 603 | + if (!intp(json["id"])) error("Expected integer"); | |
| 592 | 604 | retval.id = json["id"]; |
| 593 | 605 | retval.issue_comment_url = json["issue_comment_url"]; |
| 594 | 606 | retval.issue_events_url = json["issue_events_url"]; |
| @@ -602,7 +614,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 602 | 614 | retval.mirror_url = json["mirror_url"]; |
| 603 | 615 | retval.name = json["name"]; |
| 604 | 616 | retval.notifications_url = json["notifications_url"]; |
| 617 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 605 | 618 | retval.open_issues = json["open_issues"]; |
| 619 | + if (!intp(json["open_issues_count"])) error("Expected integer"); | |
| 606 | 620 | retval.open_issues_count = json["open_issues_count"]; |
| 607 | 621 | MergedBy_from_JSON(json["owner"]); |
| 608 | 622 | retval.owner = json["owner"]; |
| @@ -611,8 +625,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 611 | 625 | retval.releases_url = json["releases_url"]; |
| 612 | 626 | if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool"); |
| 613 | 627 | retval.repo_private = json["private"]; |
| 628 | + if (!intp(json["size"])) error("Expected integer"); | |
| 614 | 629 | retval.size = json["size"]; |
| 615 | 630 | retval.ssh_url = json["ssh_url"]; |
| 631 | + if (!intp(json["stargazers_count"])) error("Expected integer"); | |
| 616 | 632 | retval.stargazers_count = json["stargazers_count"]; |
| 617 | 633 | retval.stargazers_url = json["stargazers_url"]; |
| 618 | 634 | retval.statuses_url = json["statuses_url"]; |
| @@ -624,7 +640,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 624 | 640 | retval.trees_url = json["trees_url"]; |
| 625 | 641 | retval.updated_at = json["updated_at"]; |
| 626 | 642 | retval.url = json["url"]; |
| 643 | + if (!intp(json["watchers"])) error("Expected integer"); | |
| 627 | 644 | retval.watchers = json["watchers"]; |
| 645 | + if (!intp(json["watchers_count"])) error("Expected integer"); | |
| 628 | 646 | retval.watchers_count = json["watchers_count"]; |
| 629 | 647 | |
| 630 | 648 | return retval; |
| @@ -684,6 +702,7 @@ MergedBy MergedBy_from_JSON(mixed json) { | ||
| 684 | 702 | retval.gists_url = json["gists_url"]; |
| 685 | 703 | retval.gravatar_id = json["gravatar_id"]; |
| 686 | 704 | retval.html_url = json["html_url"]; |
| 705 | + if (!intp(json["id"])) error("Expected integer"); | |
| 687 | 706 | retval.id = json["id"]; |
| 688 | 707 | retval.login = json["login"]; |
| 689 | 708 | retval.organizations_url = json["organizations_url"]; |
| @@ -787,6 +806,7 @@ class TopLevelRepo { | ||
| 787 | 806 | TopLevelRepo TopLevelRepo_from_JSON(mixed json) { |
| 788 | 807 | TopLevelRepo retval = TopLevelRepo(); |
| 789 | 808 | |
| 809 | + if (!intp(json["id"])) error("Expected integer"); | |
| 790 | 810 | retval.id = json["id"]; |
| 791 | 811 | retval.name = json["name"]; |
| 792 | 812 | retval.url = json["url"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/0b91a.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 82 | 82 | ResponseInfo retval = ResponseInfo(); |
| 83 | 83 | |
| 84 | 84 | retval.developer_message = json["developerMessage"]; |
| 85 | + if (!intp(json["status"])) error("Expected integer"); | |
| 85 | 86 | retval.status = json["status"]; |
| 86 | 87 | |
| 87 | 88 | return retval; |
| @@ -106,8 +107,11 @@ class Resultset { | ||
| 106 | 107 | Resultset Resultset_from_JSON(mixed json) { |
| 107 | 108 | Resultset retval = Resultset(); |
| 108 | 109 | |
| 110 | + if (!intp(json["count"])) error("Expected integer"); | |
| 109 | 111 | retval.count = json["count"]; |
| 112 | + if (!intp(json["page"])) error("Expected integer"); | |
| 110 | 113 | retval.page = json["page"]; |
| 114 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 111 | 115 | retval.pagesize = json["pagesize"]; |
| 112 | 116 | |
| 113 | 117 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/0cffa.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -434,6 +435,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 434 | 435 | |
| 435 | 436 | retval.msg = json["msg"]; |
| 436 | 437 | retval.response_id = json["response_id"]; |
| 438 | + if (!intp(json["status"])) error("Expected integer"); | |
| 437 | 439 | retval.status = json["status"]; |
| 438 | 440 | |
| 439 | 441 | return retval; |
| @@ -458,8 +460,11 @@ class Pagination { | ||
| 458 | 460 | Pagination Pagination_from_JSON(mixed json) { |
| 459 | 461 | Pagination retval = Pagination(); |
| 460 | 462 | |
| 463 | + if (!intp(json["count"])) error("Expected integer"); | |
| 461 | 464 | retval.count = json["count"]; |
| 465 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 462 | 466 | retval.offset = json["offset"]; |
| 467 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 463 | 468 | retval.total_count = json["total_count"]; |
| 464 | 469 | |
| 465 | 470 | return retval; |
Test case
1 generated file · +13 −0test/inputs/json/misc/0e0c2.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -33,6 +33,7 @@ class TopLevel { | ||
| 33 | 33 | TopLevel TopLevel_from_JSON(mixed json) { |
| 34 | 34 | TopLevel retval = TopLevel(); |
| 35 | 35 | |
| 36 | + if (!intp(json["count"])) error("Expected integer"); | |
| 36 | 37 | retval.count = json["count"]; |
| 37 | 38 | retval.next = json["next"]; |
| 38 | 39 | retval.previous = json["previous"]; |
| @@ -84,16 +85,20 @@ class Result { | ||
| 84 | 85 | Result Result_from_JSON(mixed json) { |
| 85 | 86 | Result retval = Result(); |
| 86 | 87 | |
| 88 | + if (!intp(json["active_screens"])) error("Expected integer"); | |
| 87 | 89 | retval.active_screens = json["active_screens"]; |
| 88 | 90 | retval.collections = json["collections"]; |
| 89 | 91 | retval.details = json["details"]; |
| 92 | + if (!intp(json["duration"])) error("Expected integer"); | |
| 90 | 93 | retval.duration = json["duration"]; |
| 91 | 94 | FavMovie_from_JSON(json["fav_movie"]); |
| 92 | 95 | retval.fav_movie = json["fav_movie"]; |
| 96 | + if (!intp(json["id"])) error("Expected integer"); | |
| 93 | 97 | retval.id = json["id"]; |
| 94 | 98 | retval.images = json["images"]; |
| 95 | 99 | retval.language = ResultLanguage_from_JSON(json["language"]); |
| 96 | 100 | retval.release_date = json["release_date"]; |
| 101 | + if (!intp(json["stars"])) error("Expected integer"); | |
| 97 | 102 | retval.stars = json["stars"]; |
| 98 | 103 | if (!has_index(json, "tags")) error("Missing required property"); |
| 99 | 104 | retval.tags = json["tags"]; |
| @@ -101,6 +106,7 @@ Result Result_from_JSON(mixed json) { | ||
| 101 | 106 | retval.videos = json["videos"]; |
| 102 | 107 | VoteScore_from_JSON(json["vote_score"]); |
| 103 | 108 | retval.vote_score = json["vote_score"]; |
| 109 | + if (!intp(json["watches"])) error("Expected integer"); | |
| 104 | 110 | retval.watches = json["watches"]; |
| 105 | 111 | |
| 106 | 112 | return retval; |
| @@ -127,6 +133,7 @@ class Collection { | ||
| 127 | 133 | Collection Collection_from_JSON(mixed json) { |
| 128 | 134 | Collection retval = Collection(); |
| 129 | 135 | |
| 136 | + if (!intp(json["id"])) error("Expected integer"); | |
| 130 | 137 | retval.id = json["id"]; |
| 131 | 138 | retval.movies = json["movies"]; |
| 132 | 139 | retval.name = json["name"]; |
| @@ -164,6 +171,7 @@ Detail Detail_from_JSON(mixed json) { | ||
| 164 | 171 | |
| 165 | 172 | retval.cast = json["cast"]; |
| 166 | 173 | retval.director = json["director"]; |
| 174 | + if (!intp(json["id"])) error("Expected integer"); | |
| 167 | 175 | retval.id = json["id"]; |
| 168 | 176 | retval.language = DetailLanguage_from_JSON(json["language"]); |
| 169 | 177 | retval.storyline = json["storyline"]; |
| @@ -234,7 +242,9 @@ class Image { | ||
| 234 | 242 | Image Image_from_JSON(mixed json) { |
| 235 | 243 | Image retval = Image(); |
| 236 | 244 | |
| 245 | + if (!intp(json["favs"])) error("Expected integer"); | |
| 237 | 246 | retval.favs = json["favs"]; |
| 247 | + if (!intp(json["id"])) error("Expected integer"); | |
| 238 | 248 | retval.id = json["id"]; |
| 239 | 249 | retval.thumbnail = json["thumbnail"]; |
| 240 | 250 | retval.type = Type_from_JSON(json["type"]); |
| @@ -309,8 +319,11 @@ class VoteScore { | ||
| 309 | 319 | VoteScore VoteScore_from_JSON(mixed json) { |
| 310 | 320 | VoteScore retval = VoteScore(); |
| 311 | 321 | |
| 322 | + if (!intp(json["avg"])) error("Expected integer"); | |
| 312 | 323 | retval.avg = json["avg"]; |
| 324 | + if (!intp(json["score"])) error("Expected integer"); | |
| 313 | 325 | retval.score = json["score"]; |
| 326 | + if (!intp(json["total"])) error("Expected integer"); | |
| 314 | 327 | retval.total = json["total"]; |
| 315 | 328 | |
| 316 | 329 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/127a1.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -433,6 +434,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 433 | 434 | |
| 434 | 435 | retval.msg = json["msg"]; |
| 435 | 436 | retval.response_id = json["response_id"]; |
| 437 | + if (!intp(json["status"])) error("Expected integer"); | |
| 436 | 438 | retval.status = json["status"]; |
| 437 | 439 | |
| 438 | 440 | return retval; |
| @@ -457,8 +459,11 @@ class Pagination { | ||
| 457 | 459 | Pagination Pagination_from_JSON(mixed json) { |
| 458 | 460 | Pagination retval = Pagination(); |
| 459 | 461 | |
| 462 | + if (!intp(json["count"])) error("Expected integer"); | |
| 460 | 463 | retval.count = json["count"]; |
| 464 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 461 | 465 | retval.offset = json["offset"]; |
| 466 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 462 | 467 | retval.total_count = json["total_count"]; |
| 463 | 468 | |
| 464 | 469 | return retval; |
Test case
1 generated file · +2 −0test/inputs/json/misc/13d8d.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -51,6 +51,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 51 | 51 | |
| 52 | 52 | retval.category = json["category"]; |
| 53 | 53 | retval.context = json["context"]; |
| 54 | + if (!intp(json["id"])) error("Expected integer"); | |
| 54 | 55 | retval.id = json["id"]; |
| 55 | 56 | Location_from_JSON(json["location"]); |
| 56 | 57 | retval.location = json["location"]; |
| @@ -108,6 +109,7 @@ class Street { | ||
| 108 | 109 | Street Street_from_JSON(mixed json) { |
| 109 | 110 | Street retval = Street(); |
| 110 | 111 | |
| 112 | + if (!intp(json["id"])) error("Expected integer"); | |
| 111 | 113 | retval.id = json["id"]; |
| 112 | 114 | retval.name = json["name"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/16bc5.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/176f1.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 34 | 34 | TopLevel retval = TopLevel(); |
| 35 | 35 | |
| 36 | 36 | retval.message = json["message"]; |
| 37 | + if (!intp(json["responseTime"])) error("Expected integer"); | |
| 37 | 38 | retval.response_time = json["responseTime"]; |
| 38 | 39 | Results_from_JSON(json["Results"]); |
| 39 | 40 | retval.results = json["Results"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/1a7f5.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/1b28c.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +7 −0test/inputs/json/misc/1b409.json
Mpikedefault / TopLevel.pmod+7 −0
| @@ -55,8 +55,11 @@ class Meta { | ||
| 55 | 55 | Meta Meta_from_JSON(mixed json) { |
| 56 | 56 | Meta retval = Meta(); |
| 57 | 57 | |
| 58 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 58 | 59 | retval.limit = json["limit"]; |
| 60 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 59 | 61 | retval.offset = json["offset"]; |
| 62 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 60 | 63 | retval.total_count = json["total_count"]; |
| 61 | 64 | |
| 62 | 65 | return retval; |
| @@ -122,10 +125,12 @@ Object Object_from_JSON(mixed json) { | ||
| 122 | 125 | if (json["current"] != Standards.JSON.true && json["current"] != Standards.JSON.false) error("Expected bool"); |
| 123 | 126 | retval.current = json["current"]; |
| 124 | 127 | retval.description = json["description"]; |
| 128 | + if (!intp(json["district"])) error("Expected integer"); | |
| 125 | 129 | retval.district = json["district"]; |
| 126 | 130 | retval.enddate = json["enddate"]; |
| 127 | 131 | Extra_from_JSON(json["extra"]); |
| 128 | 132 | retval.extra = json["extra"]; |
| 133 | + if (!intp(json["id"])) error("Expected integer"); | |
| 129 | 134 | retval.id = json["id"]; |
| 130 | 135 | if (!has_index(json, "leadership_title")) error("Missing required property"); |
| 131 | 136 | retval.leadership_title = json["leadership_title"]; |
| @@ -238,10 +243,12 @@ Person Person_from_JSON(mixed json) { | ||
| 238 | 243 | |
| 239 | 244 | retval.bioguideid = json["bioguideid"]; |
| 240 | 245 | retval.birthday = json["birthday"]; |
| 246 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 241 | 247 | retval.cspanid = json["cspanid"]; |
| 242 | 248 | retval.firstname = json["firstname"]; |
| 243 | 249 | retval.gender = Gender_from_JSON(json["gender"]); |
| 244 | 250 | retval.gender_label = GenderLabel_from_JSON(json["gender_label"]); |
| 251 | + if (!intp(json["id"])) error("Expected integer"); | |
| 245 | 252 | retval.id = json["id"]; |
| 246 | 253 | retval.lastname = json["lastname"]; |
| 247 | 254 | retval.link = json["link"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/262f0.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/26b49.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -429,6 +430,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 429 | 430 | |
| 430 | 431 | retval.msg = json["msg"]; |
| 431 | 432 | retval.response_id = json["response_id"]; |
| 433 | + if (!intp(json["status"])) error("Expected integer"); | |
| 432 | 434 | retval.status = json["status"]; |
| 433 | 435 | |
| 434 | 436 | return retval; |
| @@ -453,8 +455,11 @@ class Pagination { | ||
| 453 | 455 | Pagination Pagination_from_JSON(mixed json) { |
| 454 | 456 | Pagination retval = Pagination(); |
| 455 | 457 | |
| 458 | + if (!intp(json["count"])) error("Expected integer"); | |
| 456 | 459 | retval.count = json["count"]; |
| 460 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 457 | 461 | retval.offset = json["offset"]; |
| 462 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 458 | 463 | retval.total_count = json["total_count"]; |
| 459 | 464 | |
| 460 | 465 | return retval; |
Test case
1 generated file · +19 −0test/inputs/json/misc/26c9c.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -154,12 +154,15 @@ View View_from_JSON(mixed json) { | ||
| 154 | 154 | |
| 155 | 155 | retval.attribution = json["attribution"]; |
| 156 | 156 | retval.attribution_link = json["attributionLink"]; |
| 157 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 157 | 158 | retval.average_rating = json["averageRating"]; |
| 158 | 159 | retval.category = json["category"]; |
| 159 | 160 | retval.columns = json["columns"]; |
| 161 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 160 | 162 | retval.created_at = json["createdAt"]; |
| 161 | 163 | retval.description = json["description"]; |
| 162 | 164 | retval.display_type = json["displayType"]; |
| 165 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 163 | 166 | retval.download_count = json["downloadCount"]; |
| 164 | 167 | retval.flags = json["flags"]; |
| 165 | 168 | retval.grants = json["grants"]; |
| @@ -168,6 +171,7 @@ View View_from_JSON(mixed json) { | ||
| 168 | 171 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 169 | 172 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 170 | 173 | retval.id = json["id"]; |
| 174 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 171 | 175 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 172 | 176 | retval.locale = json["locale"]; |
| 173 | 177 | Metadata_from_JSON(json["metadata"]); |
| @@ -175,27 +179,36 @@ View View_from_JSON(mixed json) { | ||
| 175 | 179 | retval.name = json["name"]; |
| 176 | 180 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 181 | retval.new_backend = json["newBackend"]; |
| 182 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 178 | 183 | retval.number_of_comments = json["numberOfComments"]; |
| 184 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 179 | 185 | retval.oid = json["oid"]; |
| 180 | 186 | Owner_from_JSON(json["owner"]); |
| 181 | 187 | retval.owner = json["owner"]; |
| 182 | 188 | retval.provenance = json["provenance"]; |
| 183 | 189 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 184 | 190 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 191 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 185 | 192 | retval.publication_date = json["publicationDate"]; |
| 193 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 186 | 194 | retval.publication_group = json["publicationGroup"]; |
| 187 | 195 | retval.publication_stage = json["publicationStage"]; |
| 188 | 196 | Query_from_JSON(json["query"]); |
| 189 | 197 | retval.query = json["query"]; |
| 190 | 198 | retval.rights = json["rights"]; |
| 199 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 191 | 200 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 192 | 201 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 193 | 202 | Owner_from_JSON(json["tableAuthor"]); |
| 194 | 203 | retval.table_author = json["tableAuthor"]; |
| 204 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 195 | 205 | retval.table_id = json["tableId"]; |
| 196 | 206 | retval.tags = json["tags"]; |
| 207 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 197 | 208 | retval.total_times_rated = json["totalTimesRated"]; |
| 209 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 198 | 210 | retval.view_count = json["viewCount"]; |
| 211 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 199 | 212 | retval.view_last_modified = json["viewLastModified"]; |
| 200 | 213 | retval.view_type = json["viewType"]; |
| 201 | 214 | |
| @@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) { | ||
| 244 | 257 | retval.flags = json["flags"]; |
| 245 | 258 | Format_from_JSON(json["format"]); |
| 246 | 259 | retval.format = json["format"]; |
| 260 | + if (!intp(json["id"])) error("Expected integer"); | |
| 247 | 261 | retval.id = json["id"]; |
| 248 | 262 | retval.name = json["name"]; |
| 263 | + if (!intp(json["position"])) error("Expected integer"); | |
| 249 | 264 | retval.position = json["position"]; |
| 250 | 265 | retval.render_type_name = json["renderTypeName"]; |
| 251 | 266 | retval.table_column_id = json["tableColumnId"]; |
| @@ -283,7 +298,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 283 | 298 | |
| 284 | 299 | retval.average = json["average"]; |
| 285 | 300 | retval.largest = json["largest"]; |
| 301 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 286 | 302 | retval.non_null = json["non_null"]; |
| 303 | + if (!intp(json["null"])) error("Expected integer"); | |
| 287 | 304 | retval.null = json["null"]; |
| 288 | 305 | retval.smallest = json["smallest"]; |
| 289 | 306 | retval.sum = json["sum"]; |
| @@ -309,6 +326,7 @@ class Top { | ||
| 309 | 326 | Top Top_from_JSON(mixed json) { |
| 310 | 327 | Top retval = Top(); |
| 311 | 328 | |
| 329 | + if (!intp(json["count"])) error("Expected integer"); | |
| 312 | 330 | retval.count = json["count"]; |
| 313 | 331 | retval.item = json["item"]; |
| 314 | 332 | |
| @@ -797,6 +815,7 @@ class Expression { | ||
| 797 | 815 | Expression Expression_from_JSON(mixed json) { |
| 798 | 816 | Expression retval = Expression(); |
| 799 | 817 | |
| 818 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 800 | 819 | retval.column_id = json["columnId"]; |
| 801 | 820 | retval.type = json["type"]; |
Test case
1 generated file · +13 −0test/inputs/json/misc/27332.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -256,9 +256,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 256 | 256 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 257 | 257 | retval.distinguished = json["distinguished"]; |
| 258 | 258 | retval.domain = Domain_from_JSON(json["domain"]); |
| 259 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 259 | 260 | retval.downs = json["downs"]; |
| 260 | 261 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 261 | 262 | retval.edited = json["edited"]; |
| 263 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 262 | 264 | retval.gilded = json["gilded"]; |
| 263 | 265 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 264 | 266 | retval.hidden = json["hidden"]; |
| @@ -283,6 +285,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 283 | 285 | retval.media_embed = json["media_embed"]; |
| 284 | 286 | retval.mod_reports = json["mod_reports"]; |
| 285 | 287 | retval.name = json["name"]; |
| 288 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 286 | 289 | retval.num_comments = json["num_comments"]; |
| 287 | 290 | retval.num_reports = json["num_reports"]; |
| 288 | 291 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -297,6 +300,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 297 | 300 | retval.report_reasons = json["report_reasons"]; |
| 298 | 301 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 299 | 302 | retval.saved = json["saved"]; |
| 303 | + if (!intp(json["score"])) error("Expected integer"); | |
| 300 | 304 | retval.score = json["score"]; |
| 301 | 305 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 302 | 306 | if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]); |
| @@ -316,11 +320,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 316 | 320 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 317 | 321 | retval.suggested_sort = json["suggested_sort"]; |
| 318 | 322 | retval.thumbnail = json["thumbnail"]; |
| 323 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 319 | 324 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 320 | 325 | retval.thumbnail_height = json["thumbnail_height"]; |
| 326 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 321 | 327 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 322 | 328 | retval.thumbnail_width = json["thumbnail_width"]; |
| 323 | 329 | retval.title = json["title"]; |
| 330 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 324 | 331 | retval.ups = json["ups"]; |
| 325 | 332 | retval.url = json["url"]; |
| 326 | 333 | retval.user_reports = json["user_reports"]; |
| @@ -404,16 +411,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 404 | 411 | Oembed retval = Oembed(); |
| 405 | 412 | |
| 406 | 413 | retval.description = json["description"]; |
| 414 | + if (!intp(json["height"])) error("Expected integer"); | |
| 407 | 415 | retval.height = json["height"]; |
| 408 | 416 | retval.html = json["html"]; |
| 409 | 417 | retval.provider_name = json["provider_name"]; |
| 410 | 418 | retval.provider_url = json["provider_url"]; |
| 419 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 411 | 420 | retval.thumbnail_height = json["thumbnail_height"]; |
| 412 | 421 | retval.thumbnail_url = json["thumbnail_url"]; |
| 422 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 413 | 423 | retval.thumbnail_width = json["thumbnail_width"]; |
| 414 | 424 | retval.title = json["title"]; |
| 415 | 425 | retval.type = json["type"]; |
| 416 | 426 | retval.version = json["version"]; |
| 427 | + if (!intp(json["width"])) error("Expected integer"); | |
| 417 | 428 | retval.width = json["width"]; |
| 418 | 429 | |
| 419 | 430 | return retval; |
| @@ -531,8 +542,10 @@ class Source { | ||
| 531 | 542 | Source Source_from_JSON(mixed json) { |
| 532 | 543 | Source retval = Source(); |
| 533 | 544 | |
| 545 | + if (!intp(json["height"])) error("Expected integer"); | |
| 534 | 546 | retval.height = json["height"]; |
| 535 | 547 | retval.url = json["url"]; |
| 548 | + if (!intp(json["width"])) error("Expected integer"); | |
| 536 | 549 | retval.width = json["width"]; |
| 537 | 550 | |
| 538 | 551 | return retval; |
Test case
1 generated file · +9 −0test/inputs/json/misc/29f47.json
Mpikedefault / TopLevel.pmod+9 −0
| @@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 253 | 253 | retval.created_utc = (float)json["created_utc"]; |
| 254 | 254 | retval.distinguished = Distinguished_from_JSON(json["distinguished"]); |
| 255 | 255 | retval.domain = Domain_from_JSON(json["domain"]); |
| 256 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 256 | 257 | retval.downs = json["downs"]; |
| 257 | 258 | if (arrayp(json["edited"])) error("Unexpected array"); |
| 258 | 259 | retval.edited = json["edited"]; |
| 260 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 259 | 261 | retval.gilded = json["gilded"]; |
| 260 | 262 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 261 | 263 | retval.hidden = json["hidden"]; |
| @@ -276,6 +278,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 276 | 278 | retval.media_embed = json["media_embed"]; |
| 277 | 279 | retval.mod_reports = json["mod_reports"]; |
| 278 | 280 | retval.name = json["name"]; |
| 281 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 279 | 282 | retval.num_comments = json["num_comments"]; |
| 280 | 283 | retval.num_reports = json["num_reports"]; |
| 281 | 284 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -290,6 +293,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 290 | 293 | retval.report_reasons = json["report_reasons"]; |
| 291 | 294 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 292 | 295 | retval.saved = json["saved"]; |
| 296 | + if (!intp(json["score"])) error("Expected integer"); | |
| 293 | 297 | retval.score = json["score"]; |
| 294 | 298 | retval.secure_media = json["secure_media"]; |
| 295 | 299 | MediaEmbed_from_JSON(json["secure_media_embed"]); |
| @@ -308,11 +312,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 308 | 312 | if (!has_index(json, "suggested_sort")) error("Missing required property"); |
| 309 | 313 | retval.suggested_sort = json["suggested_sort"]; |
| 310 | 314 | retval.thumbnail = json["thumbnail"]; |
| 315 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 311 | 316 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 312 | 317 | retval.thumbnail_height = json["thumbnail_height"]; |
| 318 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 313 | 319 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 314 | 320 | retval.thumbnail_width = json["thumbnail_width"]; |
| 315 | 321 | retval.title = json["title"]; |
| 322 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 316 | 323 | retval.ups = json["ups"]; |
| 317 | 324 | retval.url = json["url"]; |
| 318 | 325 | retval.user_reports = json["user_reports"]; |
| @@ -445,8 +452,10 @@ class Source { | ||
| 445 | 452 | Source Source_from_JSON(mixed json) { |
| 446 | 453 | Source retval = Source(); |
| 447 | 454 | |
| 455 | + if (!intp(json["height"])) error("Expected integer"); | |
| 448 | 456 | retval.height = json["height"]; |
| 449 | 457 | retval.url = json["url"]; |
| 458 | + if (!intp(json["width"])) error("Expected integer"); | |
| 450 | 459 | retval.width = json["width"]; |
| 451 | 460 | |
| 452 | 461 | return retval; |
Test case
1 generated file · +6 −0test/inputs/json/misc/2d4e2.json
Mpikedefault / TopLevel.pmod+6 −0
| @@ -55,8 +55,11 @@ class Meta { | ||
| 55 | 55 | Meta Meta_from_JSON(mixed json) { |
| 56 | 56 | Meta retval = Meta(); |
| 57 | 57 | |
| 58 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 58 | 59 | retval.limit = json["limit"]; |
| 60 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 59 | 61 | retval.offset = json["offset"]; |
| 62 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 60 | 63 | retval.total_count = json["total_count"]; |
| 61 | 64 | |
| 62 | 65 | return retval; |
| @@ -131,6 +134,7 @@ Object Object_from_JSON(mixed json) { | ||
| 131 | 134 | retval.enddate = json["enddate"]; |
| 132 | 135 | Extra_from_JSON(json["extra"]); |
| 133 | 136 | retval.extra = json["extra"]; |
| 137 | + if (!intp(json["id"])) error("Expected integer"); | |
| 134 | 138 | retval.id = json["id"]; |
| 135 | 139 | if (!has_index(json, "leadership_title")) error("Missing required property"); |
| 136 | 140 | retval.leadership_title = json["leadership_title"]; |
| @@ -246,10 +250,12 @@ Person Person_from_JSON(mixed json) { | ||
| 246 | 250 | |
| 247 | 251 | retval.bioguideid = json["bioguideid"]; |
| 248 | 252 | retval.birthday = json["birthday"]; |
| 253 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 249 | 254 | retval.cspanid = json["cspanid"]; |
| 250 | 255 | retval.firstname = json["firstname"]; |
| 251 | 256 | retval.gender = Gender_from_JSON(json["gender"]); |
| 252 | 257 | retval.gender_label = GenderLabel_from_JSON(json["gender_label"]); |
| 258 | + if (!intp(json["id"])) error("Expected integer"); | |
| 253 | 259 | retval.id = json["id"]; |
| 254 | 260 | retval.lastname = json["lastname"]; |
| 255 | 261 | retval.link = json["link"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/2df80.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -177,9 +177,12 @@ class FluffyTopLevel { | ||
| 177 | 177 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 178 | 178 | FluffyTopLevel retval = FluffyTopLevel(); |
| 179 | 179 | |
| 180 | + if (!intp(json["page"])) error("Expected integer"); | |
| 180 | 181 | retval.page = json["page"]; |
| 182 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 181 | 183 | retval.pages = json["pages"]; |
| 182 | 184 | retval.per_page = json["per_page"]; |
| 185 | + if (!intp(json["total"])) error("Expected integer"); | |
| 183 | 186 | retval.total = json["total"]; |
| 184 | 187 | |
| 185 | 188 | return retval; |
Test case
1 generated file · +10 −0test/inputs/json/misc/32431.json
Mpikedefault / TopLevel.pmod+10 −0
| @@ -176,6 +176,7 @@ Properties Properties_from_JSON(mixed json) { | ||
| 176 | 176 | if (!has_index(json, "dmin")) error("Missing required property"); |
| 177 | 177 | retval.dmin = json["dmin"]; |
| 178 | 178 | retval.felt = json["felt"]; |
| 179 | + if (!intp(json["gap"])) error("Expected integer"); | |
| 179 | 180 | if (!has_index(json, "gap")) error("Missing required property"); |
| 180 | 181 | retval.gap = json["gap"]; |
| 181 | 182 | retval.ids = json["ids"]; |
| @@ -183,19 +184,25 @@ Properties Properties_from_JSON(mixed json) { | ||
| 183 | 184 | retval.mag_type = MagType_from_JSON(json["magType"]); |
| 184 | 185 | retval.mmi = json["mmi"]; |
| 185 | 186 | retval.net = json["net"]; |
| 187 | + if (!intp(json["nst"])) error("Expected integer"); | |
| 186 | 188 | if (!has_index(json, "nst")) error("Missing required property"); |
| 187 | 189 | retval.nst = json["nst"]; |
| 188 | 190 | retval.place = json["place"]; |
| 189 | 191 | retval.rms = (float)json["rms"]; |
| 192 | + if (!intp(json["sig"])) error("Expected integer"); | |
| 190 | 193 | retval.sig = json["sig"]; |
| 191 | 194 | retval.sources = json["sources"]; |
| 192 | 195 | retval.status = Status_from_JSON(json["status"]); |
| 196 | + if (!intp(json["time"])) error("Expected integer"); | |
| 193 | 197 | retval.time = json["time"]; |
| 194 | 198 | retval.title = json["title"]; |
| 199 | + if (!intp(json["tsunami"])) error("Expected integer"); | |
| 195 | 200 | retval.tsunami = json["tsunami"]; |
| 196 | 201 | retval.type = PropertiesType_from_JSON(json["type"]); |
| 197 | 202 | retval.types = json["types"]; |
| 203 | + if (!intp(json["tz"])) error("Expected integer"); | |
| 198 | 204 | retval.tz = json["tz"]; |
| 205 | + if (!intp(json["updated"])) error("Expected integer"); | |
| 199 | 206 | retval.updated = json["updated"]; |
| 200 | 207 | retval.url = json["url"]; |
| 201 | 208 | |
| @@ -263,8 +270,11 @@ Metadata Metadata_from_JSON(mixed json) { | ||
| 263 | 270 | Metadata retval = Metadata(); |
| 264 | 271 | |
| 265 | 272 | retval.api = json["api"]; |
| 273 | + if (!intp(json["count"])) error("Expected integer"); | |
| 266 | 274 | retval.count = json["count"]; |
| 275 | + if (!intp(json["generated"])) error("Expected integer"); | |
| 267 | 276 | retval.generated = json["generated"]; |
| 277 | + if (!intp(json["status"])) error("Expected integer"); | |
| 268 | 278 | retval.status = json["status"]; |
| 269 | 279 | retval.title = json["title"]; |
| 270 | 280 | retval.url = json["url"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/32d5c.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -51,9 +51,11 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 51 | 51 | retval.birth_date = json["BirthDate"]; |
| 52 | 52 | if (json["BirthDateIsProtected"] != Standards.JSON.true && json["BirthDateIsProtected"] != Standards.JSON.false) error("Expected bool"); |
| 53 | 53 | retval.birth_date_is_protected = json["BirthDateIsProtected"]; |
| 54 | + if (!intp(json["GenderTypeID"])) error("Expected integer"); | |
| 54 | 55 | retval.gender_type_id = json["GenderTypeID"]; |
| 55 | 56 | retval.notes = json["Notes"]; |
| 56 | 57 | retval.parliamentary_name = json["ParliamentaryName"]; |
| 58 | + if (!intp(json["PersonID"])) error("Expected integer"); | |
| 57 | 59 | retval.person_id = json["PersonID"]; |
| 58 | 60 | retval.photo_url = json["PhotoURL"]; |
| 59 | 61 | retval.preferred_name = json["PreferredName"]; |
Test case
1 generated file · +19 −0test/inputs/json/misc/337ed.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
| @@ -145,10 +148,13 @@ class Result { | ||
| 145 | 148 | Result Result_from_JSON(mixed json) { |
| 146 | 149 | Result retval = Result(); |
| 147 | 150 | |
| 151 | + if (!intp(json["cost_absolute"])) error("Expected integer"); | |
| 148 | 152 | if (!has_index(json, "cost_absolute")) error("Missing required property"); |
| 149 | 153 | retval.cost_absolute = json["cost_absolute"]; |
| 154 | + if (!intp(json["cost_max"])) error("Expected integer"); | |
| 150 | 155 | if (!has_index(json, "cost_max")) error("Missing required property"); |
| 151 | 156 | retval.cost_max = json["cost_max"]; |
| 157 | + if (!intp(json["cost_min"])) error("Expected integer"); | |
| 152 | 158 | if (!has_index(json, "cost_min")) error("Missing required property"); |
| 153 | 159 | retval.cost_min = json["cost_min"]; |
| 154 | 160 | retval.created_at = json["created_at"]; |
| @@ -156,9 +162,11 @@ Result Result_from_JSON(mixed json) { | ||
| 156 | 162 | retval.direct_rep_costs_max = json["direct_rep_costs_max"]; |
| 157 | 163 | retval.direct_rep_costs_min = json["direct_rep_costs_min"]; |
| 158 | 164 | retval.end_date = json["end_date"]; |
| 165 | + if (!intp(json["eur_sources_grants"])) error("Expected integer"); | |
| 159 | 166 | retval.eur_sources_grants = json["eur_sources_grants"]; |
| 160 | 167 | if (!has_index(json, "eur_sources_grants_src")) error("Missing required property"); |
| 161 | 168 | retval.eur_sources_grants_src = json["eur_sources_grants_src"]; |
| 169 | + if (!intp(json["eur_sources_procurement"])) error("Expected integer"); | |
| 162 | 170 | retval.eur_sources_procurement = json["eur_sources_procurement"]; |
| 163 | 171 | if (!has_index(json, "eur_sources_procurement_src")) error("Missing required property"); |
| 164 | 172 | retval.eur_sources_procurement_src = json["eur_sources_procurement_src"]; |
| @@ -168,27 +176,37 @@ Result Result_from_JSON(mixed json) { | ||
| 168 | 176 | retval.no_clients = json["no_clients"]; |
| 169 | 177 | if (!has_index(json, "other_financial_information")) error("Missing required property"); |
| 170 | 178 | retval.other_financial_information = json["other_financial_information"]; |
| 179 | + if (!intp(json["other_sources_contributions"])) error("Expected integer"); | |
| 171 | 180 | if (!has_index(json, "other_sources_contributions")) error("Missing required property"); |
| 172 | 181 | retval.other_sources_contributions = json["other_sources_contributions"]; |
| 182 | + if (!intp(json["other_sources_donation"])) error("Expected integer"); | |
| 173 | 183 | if (!has_index(json, "other_sources_donation")) error("Missing required property"); |
| 174 | 184 | retval.other_sources_donation = json["other_sources_donation"]; |
| 185 | + if (!intp(json["other_sources_total"])) error("Expected integer"); | |
| 175 | 186 | if (!has_index(json, "other_sources_total")) error("Missing required property"); |
| 176 | 187 | retval.other_sources_total = json["other_sources_total"]; |
| 188 | + if (!intp(json["public_financing_infranational"])) error("Expected integer"); | |
| 177 | 189 | if (!has_index(json, "public_financing_infranational")) error("Missing required property"); |
| 178 | 190 | retval.public_financing_infranational = json["public_financing_infranational"]; |
| 191 | + if (!intp(json["public_financing_national"])) error("Expected integer"); | |
| 179 | 192 | if (!has_index(json, "public_financing_national")) error("Missing required property"); |
| 180 | 193 | retval.public_financing_national = json["public_financing_national"]; |
| 194 | + if (!intp(json["public_financing_total"])) error("Expected integer"); | |
| 181 | 195 | if (!has_index(json, "public_financing_total")) error("Missing required property"); |
| 182 | 196 | retval.public_financing_total = json["public_financing_total"]; |
| 183 | 197 | retval.representative = json["representative"]; |
| 184 | 198 | retval.start_date = json["start_date"]; |
| 185 | 199 | retval.status = Status_from_JSON(json["status"]); |
| 200 | + if (!intp(json["total_budget"])) error("Expected integer"); | |
| 186 | 201 | if (!has_index(json, "total_budget")) error("Missing required property"); |
| 187 | 202 | retval.total_budget = json["total_budget"]; |
| 203 | + if (!intp(json["turnover_absolute"])) error("Expected integer"); | |
| 188 | 204 | if (!has_index(json, "turnover_absolute")) error("Missing required property"); |
| 189 | 205 | retval.turnover_absolute = json["turnover_absolute"]; |
| 206 | + if (!intp(json["turnover_max"])) error("Expected integer"); | |
| 190 | 207 | if (!has_index(json, "turnover_max")) error("Missing required property"); |
| 191 | 208 | retval.turnover_max = json["turnover_max"]; |
| 209 | + if (!intp(json["turnover_min"])) error("Expected integer"); | |
| 192 | 210 | if (!has_index(json, "turnover_min")) error("Missing required property"); |
| 193 | 211 | retval.turnover_min = json["turnover_min"]; |
| 194 | 212 | retval.type = ResultType_from_JSON(json["type"]); |
| @@ -227,6 +245,7 @@ class CustomIncome { | ||
| 227 | 245 | CustomIncome CustomIncome_from_JSON(mixed json) { |
| 228 | 246 | CustomIncome retval = CustomIncome(); |
| 229 | 247 | |
| 248 | + if (!intp(json["amount"])) error("Expected integer"); | |
| 230 | 249 | retval.amount = json["amount"]; |
| 231 | 250 | retval.created_at = json["created_at"]; |
| 232 | 251 | retval.id = json["id"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/34702.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 36 | 36 | Crs_from_JSON(json["crs"]); |
| 37 | 37 | retval.crs = json["crs"]; |
| 38 | 38 | retval.features = json["features"]; |
| 39 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 39 | 40 | retval.total_features = json["totalFeatures"]; |
| 40 | 41 | retval.type = json["type"]; |
| 41 | 42 | |
| @@ -212,6 +213,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 212 | 213 | if (!has_index(json, "no")) error("Missing required property"); |
| 213 | 214 | retval.no = json["no"]; |
| 214 | 215 | retval.phone = (float)json["phone"]; |
| 216 | + if (!intp(json["postcode"])) error("Expected integer"); | |
| 215 | 217 | retval.postcode = json["postcode"]; |
| 216 | 218 | retval.psa = json["psa"]; |
| 217 | 219 | retval.region = Region_from_JSON(json["region"]); |
Test case
1 generated file · +1 −0test/inputs/json/misc/3659d.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/3e9a3.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 34 | 34 | TopLevel retval = TopLevel(); |
| 35 | 35 | |
| 36 | 36 | retval.message = json["message"]; |
| 37 | + if (!intp(json["responseTime"])) error("Expected integer"); | |
| 37 | 38 | retval.response_time = json["responseTime"]; |
| 38 | 39 | Results_from_JSON(json["Results"]); |
| 39 | 40 | retval.results = json["Results"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/3f1ce.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +18 −0test/inputs/json/misc/421d4.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -157,12 +157,15 @@ View View_from_JSON(mixed json) { | ||
| 157 | 157 | View retval = View(); |
| 158 | 158 | |
| 159 | 159 | retval.attribution = json["attribution"]; |
| 160 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 160 | 161 | retval.average_rating = json["averageRating"]; |
| 161 | 162 | retval.category = json["category"]; |
| 162 | 163 | retval.columns = json["columns"]; |
| 164 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 163 | 165 | retval.created_at = json["createdAt"]; |
| 164 | 166 | retval.description = json["description"]; |
| 165 | 167 | retval.display_type = json["displayType"]; |
| 168 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 166 | 169 | retval.download_count = json["downloadCount"]; |
| 167 | 170 | retval.flags = json["flags"]; |
| 168 | 171 | retval.grants = json["grants"]; |
| @@ -171,6 +174,7 @@ View View_from_JSON(mixed json) { | ||
| 171 | 174 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 172 | 175 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 173 | 176 | retval.id = json["id"]; |
| 177 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 174 | 178 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 175 | 179 | License_from_JSON(json["license"]); |
| 176 | 180 | retval.license = json["license"]; |
| @@ -181,28 +185,37 @@ View View_from_JSON(mixed json) { | ||
| 181 | 185 | retval.name = json["name"]; |
| 182 | 186 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 183 | 187 | retval.new_backend = json["newBackend"]; |
| 188 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 184 | 189 | retval.number_of_comments = json["numberOfComments"]; |
| 190 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 185 | 191 | retval.oid = json["oid"]; |
| 186 | 192 | Owner_from_JSON(json["owner"]); |
| 187 | 193 | retval.owner = json["owner"]; |
| 188 | 194 | retval.provenance = json["provenance"]; |
| 189 | 195 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 190 | 196 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 197 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 191 | 198 | retval.publication_date = json["publicationDate"]; |
| 199 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 192 | 200 | retval.publication_group = json["publicationGroup"]; |
| 193 | 201 | retval.publication_stage = json["publicationStage"]; |
| 194 | 202 | Query_from_JSON(json["query"]); |
| 195 | 203 | retval.query = json["query"]; |
| 196 | 204 | retval.rights = json["rights"]; |
| 197 | 205 | retval.row_class = json["rowClass"]; |
| 206 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 198 | 207 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 199 | 208 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 200 | 209 | Owner_from_JSON(json["tableAuthor"]); |
| 201 | 210 | retval.table_author = json["tableAuthor"]; |
| 211 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 202 | 212 | retval.table_id = json["tableId"]; |
| 203 | 213 | retval.tags = json["tags"]; |
| 214 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 204 | 215 | retval.total_times_rated = json["totalTimesRated"]; |
| 216 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 205 | 217 | retval.view_count = json["viewCount"]; |
| 218 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 206 | 219 | retval.view_last_modified = json["viewLastModified"]; |
| 207 | 220 | retval.view_type = json["viewType"]; |
| 208 | 221 | |
| @@ -251,8 +264,10 @@ Column Column_from_JSON(mixed json) { | ||
| 251 | 264 | retval.flags = json["flags"]; |
| 252 | 265 | Query_from_JSON(json["format"]); |
| 253 | 266 | retval.format = json["format"]; |
| 267 | + if (!intp(json["id"])) error("Expected integer"); | |
| 254 | 268 | retval.id = json["id"]; |
| 255 | 269 | retval.name = json["name"]; |
| 270 | + if (!intp(json["position"])) error("Expected integer"); | |
| 256 | 271 | retval.position = json["position"]; |
| 257 | 272 | retval.render_type_name = json["renderTypeName"]; |
| 258 | 273 | retval.table_column_id = json["tableColumnId"]; |
| @@ -290,7 +305,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 290 | 305 | |
| 291 | 306 | retval.average = json["average"]; |
| 292 | 307 | retval.largest = json["largest"]; |
| 308 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 293 | 309 | retval.non_null = json["non_null"]; |
| 310 | + if (!intp(json["null"])) error("Expected integer"); | |
| 294 | 311 | retval.null = json["null"]; |
| 295 | 312 | retval.smallest = json["smallest"]; |
| 296 | 313 | retval.sum = json["sum"]; |
| @@ -316,6 +333,7 @@ class Top { | ||
| 316 | 333 | Top Top_from_JSON(mixed json) { |
| 317 | 334 | Top retval = Top(); |
| 318 | 335 | |
| 336 | + if (!intp(json["count"])) error("Expected integer"); | |
| 319 | 337 | retval.count = json["count"]; |
| 320 | 338 | retval.item = json["item"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/437e7.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -418,6 +419,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 418 | 419 | |
| 419 | 420 | retval.msg = json["msg"]; |
| 420 | 421 | retval.response_id = json["response_id"]; |
| 422 | + if (!intp(json["status"])) error("Expected integer"); | |
| 421 | 423 | retval.status = json["status"]; |
| 422 | 424 | |
| 423 | 425 | return retval; |
| @@ -442,8 +444,11 @@ class Pagination { | ||
| 442 | 444 | Pagination Pagination_from_JSON(mixed json) { |
| 443 | 445 | Pagination retval = Pagination(); |
| 444 | 446 | |
| 447 | + if (!intp(json["count"])) error("Expected integer"); | |
| 445 | 448 | retval.count = json["count"]; |
| 449 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 446 | 450 | retval.offset = json["offset"]; |
| 451 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 447 | 452 | retval.total_count = json["total_count"]; |
| 448 | 453 | |
| 449 | 454 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/43970.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -37,6 +37,7 @@ class TopLevelElement { | ||
| 37 | 37 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 38 | 38 | TopLevelElement retval = TopLevelElement(); |
| 39 | 39 | |
| 40 | + if (!intp(json["ID"])) error("Expected integer"); | |
| 40 | 41 | retval.id = json["ID"]; |
| 41 | 42 | retval.name = json["Name"]; |
| 42 | 43 | retval.notes = json["Notes"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/458db.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 82 | 82 | ResponseInfo retval = ResponseInfo(); |
| 83 | 83 | |
| 84 | 84 | retval.developer_message = json["developerMessage"]; |
| 85 | + if (!intp(json["status"])) error("Expected integer"); | |
| 85 | 86 | retval.status = json["status"]; |
| 86 | 87 | |
| 87 | 88 | return retval; |
| @@ -106,8 +107,11 @@ class Resultset { | ||
| 106 | 107 | Resultset Resultset_from_JSON(mixed json) { |
| 107 | 108 | Resultset retval = Resultset(); |
| 108 | 109 | |
| 110 | + if (!intp(json["count"])) error("Expected integer"); | |
| 109 | 111 | retval.count = json["count"]; |
| 112 | + if (!intp(json["page"])) error("Expected integer"); | |
| 110 | 113 | retval.page = json["page"]; |
| 114 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 111 | 115 | retval.pagesize = json["pagesize"]; |
| 112 | 116 | |
| 113 | 117 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4961a.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4a0d7.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4a455.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 36 | 36 | Crs_from_JSON(json["crs"]); |
| 37 | 37 | retval.crs = json["crs"]; |
| 38 | 38 | retval.features = json["features"]; |
| 39 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 39 | 40 | retval.total_features = json["totalFeatures"]; |
| 40 | 41 | retval.type = json["type"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4c547.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +13 −0test/inputs/json/misc/4d6fb.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 253 | 253 | retval.created_utc = (float)json["created_utc"]; |
| 254 | 254 | retval.distinguished = json["distinguished"]; |
| 255 | 255 | retval.domain = json["domain"]; |
| 256 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 256 | 257 | retval.downs = json["downs"]; |
| 257 | 258 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 258 | 259 | retval.edited = json["edited"]; |
| 260 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 259 | 261 | retval.gilded = json["gilded"]; |
| 260 | 262 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 261 | 263 | retval.hidden = json["hidden"]; |
| @@ -278,6 +280,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 278 | 280 | retval.media_embed = json["media_embed"]; |
| 279 | 281 | retval.mod_reports = json["mod_reports"]; |
| 280 | 282 | retval.name = json["name"]; |
| 283 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 281 | 284 | retval.num_comments = json["num_comments"]; |
| 282 | 285 | retval.num_reports = json["num_reports"]; |
| 283 | 286 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -292,6 +295,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 292 | 295 | retval.report_reasons = json["report_reasons"]; |
| 293 | 296 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 294 | 297 | retval.saved = json["saved"]; |
| 298 | + if (!intp(json["score"])) error("Expected integer"); | |
| 295 | 299 | retval.score = json["score"]; |
| 296 | 300 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 297 | 301 | if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]); |
| @@ -310,11 +314,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 310 | 314 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 311 | 315 | retval.suggested_sort = json["suggested_sort"]; |
| 312 | 316 | retval.thumbnail = json["thumbnail"]; |
| 317 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 313 | 318 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 314 | 319 | retval.thumbnail_height = json["thumbnail_height"]; |
| 320 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 315 | 321 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 316 | 322 | retval.thumbnail_width = json["thumbnail_width"]; |
| 317 | 323 | retval.title = json["title"]; |
| 324 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 318 | 325 | retval.ups = json["ups"]; |
| 319 | 326 | retval.url = json["url"]; |
| 320 | 327 | retval.user_reports = json["user_reports"]; |
| @@ -390,16 +397,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 390 | 397 | |
| 391 | 398 | retval.author_name = json["author_name"]; |
| 392 | 399 | retval.author_url = json["author_url"]; |
| 400 | + if (!intp(json["height"])) error("Expected integer"); | |
| 393 | 401 | retval.height = json["height"]; |
| 394 | 402 | retval.html = json["html"]; |
| 395 | 403 | retval.provider_name = json["provider_name"]; |
| 396 | 404 | retval.provider_url = json["provider_url"]; |
| 405 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 397 | 406 | retval.thumbnail_height = json["thumbnail_height"]; |
| 398 | 407 | retval.thumbnail_url = json["thumbnail_url"]; |
| 408 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 399 | 409 | retval.thumbnail_width = json["thumbnail_width"]; |
| 400 | 410 | retval.title = json["title"]; |
| 401 | 411 | retval.type = json["type"]; |
| 402 | 412 | retval.version = json["version"]; |
| 413 | + if (!intp(json["width"])) error("Expected integer"); | |
| 403 | 414 | retval.width = json["width"]; |
| 404 | 415 | |
| 405 | 416 | return retval; |
| @@ -517,8 +528,10 @@ class Source { | ||
| 517 | 528 | Source Source_from_JSON(mixed json) { |
| 518 | 529 | Source retval = Source(); |
| 519 | 530 | |
| 531 | + if (!intp(json["height"])) error("Expected integer"); | |
| 520 | 532 | retval.height = json["height"]; |
| 521 | 533 | retval.url = json["url"]; |
| 534 | + if (!intp(json["width"])) error("Expected integer"); | |
| 522 | 535 | retval.width = json["width"]; |
| 523 | 536 | |
| 524 | 537 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4e336.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/54d32.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/5eae5.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -40,6 +40,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 40 | 40 | TopLevelElement retval = TopLevelElement(); |
| 41 | 41 | |
| 42 | 42 | retval.date = json["Date"]; |
| 43 | + if (!intp(json["ID"])) error("Expected integer"); | |
| 43 | 44 | retval.id = json["ID"]; |
| 44 | 45 | retval.sponsor = json["Sponsor"]; |
| 45 | 46 | retval.title = json["Title"]; |
Test case
1 generated file · +19 −0test/inputs/json/misc/5f7fe.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -154,12 +154,15 @@ View View_from_JSON(mixed json) { | ||
| 154 | 154 | |
| 155 | 155 | retval.attribution = json["attribution"]; |
| 156 | 156 | retval.attribution_link = json["attributionLink"]; |
| 157 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 157 | 158 | retval.average_rating = json["averageRating"]; |
| 158 | 159 | retval.category = json["category"]; |
| 159 | 160 | retval.columns = json["columns"]; |
| 161 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 160 | 162 | retval.created_at = json["createdAt"]; |
| 161 | 163 | retval.description = json["description"]; |
| 162 | 164 | retval.display_type = json["displayType"]; |
| 165 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 163 | 166 | retval.download_count = json["downloadCount"]; |
| 164 | 167 | retval.flags = json["flags"]; |
| 165 | 168 | retval.grants = json["grants"]; |
| @@ -168,6 +171,7 @@ View View_from_JSON(mixed json) { | ||
| 168 | 171 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 169 | 172 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 170 | 173 | retval.id = json["id"]; |
| 174 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 171 | 175 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 172 | 176 | retval.locale = json["locale"]; |
| 173 | 177 | Metadata_from_JSON(json["metadata"]); |
| @@ -175,27 +179,36 @@ View View_from_JSON(mixed json) { | ||
| 175 | 179 | retval.name = json["name"]; |
| 176 | 180 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 181 | retval.new_backend = json["newBackend"]; |
| 182 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 178 | 183 | retval.number_of_comments = json["numberOfComments"]; |
| 184 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 179 | 185 | retval.oid = json["oid"]; |
| 180 | 186 | Owner_from_JSON(json["owner"]); |
| 181 | 187 | retval.owner = json["owner"]; |
| 182 | 188 | retval.provenance = json["provenance"]; |
| 183 | 189 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 184 | 190 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 191 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 185 | 192 | retval.publication_date = json["publicationDate"]; |
| 193 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 186 | 194 | retval.publication_group = json["publicationGroup"]; |
| 187 | 195 | retval.publication_stage = json["publicationStage"]; |
| 188 | 196 | Query_from_JSON(json["query"]); |
| 189 | 197 | retval.query = json["query"]; |
| 190 | 198 | retval.rights = json["rights"]; |
| 199 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 191 | 200 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 192 | 201 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 193 | 202 | Owner_from_JSON(json["tableAuthor"]); |
| 194 | 203 | retval.table_author = json["tableAuthor"]; |
| 204 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 195 | 205 | retval.table_id = json["tableId"]; |
| 196 | 206 | retval.tags = json["tags"]; |
| 207 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 197 | 208 | retval.total_times_rated = json["totalTimesRated"]; |
| 209 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 198 | 210 | retval.view_count = json["viewCount"]; |
| 211 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 199 | 212 | retval.view_last_modified = json["viewLastModified"]; |
| 200 | 213 | retval.view_type = json["viewType"]; |
| 201 | 214 | |
| @@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) { | ||
| 244 | 257 | retval.flags = json["flags"]; |
| 245 | 258 | Format_from_JSON(json["format"]); |
| 246 | 259 | retval.format = json["format"]; |
| 260 | + if (!intp(json["id"])) error("Expected integer"); | |
| 247 | 261 | retval.id = json["id"]; |
| 248 | 262 | retval.name = json["name"]; |
| 263 | + if (!intp(json["position"])) error("Expected integer"); | |
| 249 | 264 | retval.position = json["position"]; |
| 250 | 265 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 251 | 266 | retval.table_column_id = json["tableColumnId"]; |
| @@ -278,7 +293,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 278 | 293 | CachedContents retval = CachedContents(); |
| 279 | 294 | |
| 280 | 295 | retval.largest = json["largest"]; |
| 296 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 281 | 297 | retval.non_null = json["non_null"]; |
| 298 | + if (!intp(json["null"])) error("Expected integer"); | |
| 282 | 299 | retval.null = json["null"]; |
| 283 | 300 | retval.smallest = json["smallest"]; |
| 284 | 301 | retval.top = json["top"]; |
| @@ -303,6 +320,7 @@ class Top { | ||
| 303 | 320 | Top Top_from_JSON(mixed json) { |
| 304 | 321 | Top retval = Top(); |
| 305 | 322 | |
| 323 | + if (!intp(json["count"])) error("Expected integer"); | |
| 306 | 324 | retval.count = json["count"]; |
| 307 | 325 | retval.item = json["item"]; |
| 308 | 326 | |
| @@ -795,6 +813,7 @@ class Expression { | ||
| 795 | 813 | Expression Expression_from_JSON(mixed json) { |
| 796 | 814 | Expression retval = Expression(); |
| 797 | 815 | |
| 816 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 798 | 817 | retval.column_id = json["columnId"]; |
| 799 | 818 | retval.type = json["type"]; |
Test case
1 generated file · +19 −0test/inputs/json/misc/617e8.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -154,12 +154,15 @@ View View_from_JSON(mixed json) { | ||
| 154 | 154 | |
| 155 | 155 | retval.attribution = json["attribution"]; |
| 156 | 156 | retval.attribution_link = json["attributionLink"]; |
| 157 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 157 | 158 | retval.average_rating = json["averageRating"]; |
| 158 | 159 | retval.category = json["category"]; |
| 159 | 160 | retval.columns = json["columns"]; |
| 161 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 160 | 162 | retval.created_at = json["createdAt"]; |
| 161 | 163 | retval.description = json["description"]; |
| 162 | 164 | retval.display_type = json["displayType"]; |
| 165 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 163 | 166 | retval.download_count = json["downloadCount"]; |
| 164 | 167 | retval.flags = json["flags"]; |
| 165 | 168 | retval.grants = json["grants"]; |
| @@ -168,6 +171,7 @@ View View_from_JSON(mixed json) { | ||
| 168 | 171 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 169 | 172 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 170 | 173 | retval.id = json["id"]; |
| 174 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 171 | 175 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 172 | 176 | retval.locale = json["locale"]; |
| 173 | 177 | Metadata_from_JSON(json["metadata"]); |
| @@ -175,27 +179,36 @@ View View_from_JSON(mixed json) { | ||
| 175 | 179 | retval.name = json["name"]; |
| 176 | 180 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 181 | retval.new_backend = json["newBackend"]; |
| 182 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 178 | 183 | retval.number_of_comments = json["numberOfComments"]; |
| 184 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 179 | 185 | retval.oid = json["oid"]; |
| 180 | 186 | Owner_from_JSON(json["owner"]); |
| 181 | 187 | retval.owner = json["owner"]; |
| 182 | 188 | retval.provenance = json["provenance"]; |
| 183 | 189 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 184 | 190 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 191 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 185 | 192 | retval.publication_date = json["publicationDate"]; |
| 193 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 186 | 194 | retval.publication_group = json["publicationGroup"]; |
| 187 | 195 | retval.publication_stage = json["publicationStage"]; |
| 188 | 196 | Query_from_JSON(json["query"]); |
| 189 | 197 | retval.query = json["query"]; |
| 190 | 198 | retval.rights = json["rights"]; |
| 199 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 191 | 200 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 192 | 201 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 193 | 202 | Owner_from_JSON(json["tableAuthor"]); |
| 194 | 203 | retval.table_author = json["tableAuthor"]; |
| 204 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 195 | 205 | retval.table_id = json["tableId"]; |
| 196 | 206 | retval.tags = json["tags"]; |
| 207 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 197 | 208 | retval.total_times_rated = json["totalTimesRated"]; |
| 209 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 198 | 210 | retval.view_count = json["viewCount"]; |
| 211 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 199 | 212 | retval.view_last_modified = json["viewLastModified"]; |
| 200 | 213 | retval.view_type = json["viewType"]; |
| 201 | 214 | |
| @@ -247,8 +260,10 @@ Column Column_from_JSON(mixed json) { | ||
| 247 | 260 | retval.flags = json["flags"]; |
| 248 | 261 | Format_from_JSON(json["format"]); |
| 249 | 262 | retval.format = json["format"]; |
| 263 | + if (!intp(json["id"])) error("Expected integer"); | |
| 250 | 264 | retval.id = json["id"]; |
| 251 | 265 | retval.name = json["name"]; |
| 266 | + if (!intp(json["position"])) error("Expected integer"); | |
| 252 | 267 | retval.position = json["position"]; |
| 253 | 268 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 254 | 269 | retval.table_column_id = json["tableColumnId"]; |
| @@ -281,7 +296,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 281 | 296 | CachedContents retval = CachedContents(); |
| 282 | 297 | |
| 283 | 298 | retval.largest = json["largest"]; |
| 299 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 284 | 300 | retval.non_null = json["non_null"]; |
| 301 | + if (!intp(json["null"])) error("Expected integer"); | |
| 285 | 302 | retval.null = json["null"]; |
| 286 | 303 | retval.smallest = json["smallest"]; |
| 287 | 304 | retval.top = json["top"]; |
| @@ -306,6 +323,7 @@ class Top { | ||
| 306 | 323 | Top Top_from_JSON(mixed json) { |
| 307 | 324 | Top retval = Top(); |
| 308 | 325 | |
| 326 | + if (!intp(json["count"])) error("Expected integer"); | |
| 309 | 327 | retval.count = json["count"]; |
| 310 | 328 | retval.item = json["item"]; |
| 311 | 329 | |
| @@ -792,6 +810,7 @@ class Expression { | ||
| 792 | 810 | Expression Expression_from_JSON(mixed json) { |
| 793 | 811 | Expression retval = Expression(); |
| 794 | 812 | |
| 813 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 795 | 814 | retval.column_id = json["columnId"]; |
| 796 | 815 | retval.type = json["type"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/65dec.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 53 | 53 | retval.code = json["code"]; |
| 54 | 54 | retval.gatherer_code = json["gathererCode"]; |
| 55 | 55 | retval.magic_cards_info_code = json["magicCardsInfoCode"]; |
| 56 | + if (!intp(json["mkm_id"])) error("Expected integer"); | |
| 56 | 57 | retval.mkm_id = json["mkm_id"]; |
| 57 | 58 | retval.mkm_name = json["mkm_name"]; |
| 58 | 59 | retval.name = json["name"]; |
| @@ -132,6 +133,7 @@ Card Card_from_JSON(mixed json) { | ||
| 132 | 133 | Card retval = Card(); |
| 133 | 134 | |
| 134 | 135 | retval.artist = json["artist"]; |
| 136 | + if (!intp(json["cmc"])) error("Expected integer"); | |
| 135 | 137 | retval.cmc = json["cmc"]; |
| 136 | 138 | retval.color_identity = json["colorIdentity"]; |
| 137 | 139 | retval.colors = json["colors"]; |
| @@ -142,6 +144,7 @@ Card Card_from_JSON(mixed json) { | ||
| 142 | 144 | retval.legalities = json["legalities"]; |
| 143 | 145 | retval.mana_cost = json["manaCost"]; |
| 144 | 146 | retval.mci_number = json["mciNumber"]; |
| 147 | + if (!intp(json["multiverseid"])) error("Expected integer"); | |
| 145 | 148 | retval.multiverseid = json["multiverseid"]; |
| 146 | 149 | retval.name = json["name"]; |
| 147 | 150 | retval.original_text = json["originalText"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/6617c.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 34 | 34 | IssPosition_from_JSON(json["iss_position"]); |
| 35 | 35 | retval.iss_position = json["iss_position"]; |
| 36 | 36 | retval.message = json["message"]; |
| 37 | + if (!intp(json["timestamp"])) error("Expected integer"); | |
| 37 | 38 | retval.timestamp = json["timestamp"]; |
| 38 | 39 | |
| 39 | 40 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/67c03.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -32,6 +32,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 32 | 32 | TopLevel retval = TopLevel(); |
| 33 | 33 | |
| 34 | 34 | retval.message = json["message"]; |
| 35 | + if (!intp(json["number"])) error("Expected integer"); | |
| 35 | 36 | retval.number = json["number"]; |
| 36 | 37 | retval.people = json["people"]; |
Test case
1 generated file · +12 −0test/inputs/json/misc/68c30.json
Mpikedefault / TopLevel.pmod+12 −0
| @@ -73,14 +73,21 @@ Tx Tx_from_JSON(mixed json) { | ||
| 73 | 73 | retval.double_spend = json["double_spend"]; |
| 74 | 74 | retval.hash = json["hash"]; |
| 75 | 75 | retval.inputs = json["inputs"]; |
| 76 | + if (!intp(json["lock_time"])) error("Expected integer"); | |
| 76 | 77 | retval.lock_time = json["lock_time"]; |
| 77 | 78 | retval.out = json["out"]; |
| 78 | 79 | retval.relayed_by = json["relayed_by"]; |
| 80 | + if (!intp(json["size"])) error("Expected integer"); | |
| 79 | 81 | retval.size = json["size"]; |
| 82 | + if (!intp(json["time"])) error("Expected integer"); | |
| 80 | 83 | retval.time = json["time"]; |
| 84 | + if (!intp(json["tx_index"])) error("Expected integer"); | |
| 81 | 85 | retval.tx_index = json["tx_index"]; |
| 86 | + if (!intp(json["ver"])) error("Expected integer"); | |
| 82 | 87 | retval.ver = json["ver"]; |
| 88 | + if (!intp(json["vin_sz"])) error("Expected integer"); | |
| 83 | 89 | retval.vin_sz = json["vin_sz"]; |
| 90 | + if (!intp(json["vout_sz"])) error("Expected integer"); | |
| 84 | 91 | retval.vout_sz = json["vout_sz"]; |
| 85 | 92 | |
| 86 | 93 | return retval; |
| @@ -108,6 +115,7 @@ Input Input_from_JSON(mixed json) { | ||
| 108 | 115 | Out_from_JSON(json["prev_out"]); |
| 109 | 116 | retval.prev_out = json["prev_out"]; |
| 110 | 117 | retval.script = json["script"]; |
| 118 | + if (!intp(json["sequence"])) error("Expected integer"); | |
| 111 | 119 | retval.sequence = json["sequence"]; |
| 112 | 120 | |
| 113 | 121 | return retval; |
| @@ -141,12 +149,16 @@ Out Out_from_JSON(mixed json) { | ||
| 141 | 149 | Out retval = Out(); |
| 142 | 150 | |
| 143 | 151 | retval.addr = json["addr"]; |
| 152 | + if (!intp(json["n"])) error("Expected integer"); | |
| 144 | 153 | retval.n = json["n"]; |
| 145 | 154 | retval.script = json["script"]; |
| 146 | 155 | if (json["spent"] != Standards.JSON.true && json["spent"] != Standards.JSON.false) error("Expected bool"); |
| 147 | 156 | retval.spent = json["spent"]; |
| 157 | + if (!intp(json["tx_index"])) error("Expected integer"); | |
| 148 | 158 | retval.tx_index = json["tx_index"]; |
| 159 | + if (!intp(json["type"])) error("Expected integer"); | |
| 149 | 160 | retval.type = json["type"]; |
| 161 | + if (!intp(json["value"])) error("Expected integer"); | |
| 150 | 162 | retval.value = json["value"]; |
| 151 | 163 | |
| 152 | 164 | return retval; |
Test case
1 generated file · +4 −0test/inputs/json/misc/6c155.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 82 | 82 | ResponseInfo retval = ResponseInfo(); |
| 83 | 83 | |
| 84 | 84 | retval.developer_message = json["developerMessage"]; |
| 85 | + if (!intp(json["status"])) error("Expected integer"); | |
| 85 | 86 | retval.status = json["status"]; |
| 86 | 87 | |
| 87 | 88 | return retval; |
| @@ -106,8 +107,11 @@ class Resultset { | ||
| 106 | 107 | Resultset Resultset_from_JSON(mixed json) { |
| 107 | 108 | Resultset retval = Resultset(); |
| 108 | 109 | |
| 110 | + if (!intp(json["count"])) error("Expected integer"); | |
| 109 | 111 | retval.count = json["count"]; |
| 112 | + if (!intp(json["page"])) error("Expected integer"); | |
| 110 | 113 | retval.page = json["page"]; |
| 114 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 111 | 115 | retval.pagesize = json["pagesize"]; |
| 112 | 116 | |
| 113 | 117 | return retval; |
Test case
1 generated file · +13 −0test/inputs/json/misc/6de06.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 255 | 255 | retval.created_utc = (float)json["created_utc"]; |
| 256 | 256 | retval.distinguished = json["distinguished"]; |
| 257 | 257 | retval.domain = json["domain"]; |
| 258 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 258 | 259 | retval.downs = json["downs"]; |
| 259 | 260 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 260 | 261 | retval.edited = json["edited"]; |
| 262 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 261 | 263 | retval.gilded = json["gilded"]; |
| 262 | 264 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 263 | 265 | retval.hidden = json["hidden"]; |
| @@ -282,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 282 | 284 | retval.media_embed = json["media_embed"]; |
| 283 | 285 | retval.mod_reports = json["mod_reports"]; |
| 284 | 286 | retval.name = json["name"]; |
| 287 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 285 | 288 | retval.num_comments = json["num_comments"]; |
| 286 | 289 | retval.num_reports = json["num_reports"]; |
| 287 | 290 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -296,6 +299,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 296 | 299 | retval.report_reasons = json["report_reasons"]; |
| 297 | 300 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 298 | 301 | retval.saved = json["saved"]; |
| 302 | + if (!intp(json["score"])) error("Expected integer"); | |
| 299 | 303 | retval.score = json["score"]; |
| 300 | 304 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 301 | 305 | if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]); |
| @@ -316,11 +320,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 316 | 320 | if (!has_index(json, "suggested_sort")) error("Missing required property"); |
| 317 | 321 | retval.suggested_sort = json["suggested_sort"]; |
| 318 | 322 | retval.thumbnail = json["thumbnail"]; |
| 323 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 319 | 324 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 320 | 325 | retval.thumbnail_height = json["thumbnail_height"]; |
| 326 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 321 | 327 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 322 | 328 | retval.thumbnail_width = json["thumbnail_width"]; |
| 323 | 329 | retval.title = json["title"]; |
| 330 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 324 | 331 | retval.ups = json["ups"]; |
| 325 | 332 | retval.url = json["url"]; |
| 326 | 333 | retval.user_reports = json["user_reports"]; |
| @@ -393,16 +400,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 393 | 400 | Oembed retval = Oembed(); |
| 394 | 401 | |
| 395 | 402 | retval.description = json["description"]; |
| 403 | + if (!intp(json["height"])) error("Expected integer"); | |
| 396 | 404 | retval.height = json["height"]; |
| 397 | 405 | retval.html = json["html"]; |
| 398 | 406 | retval.provider_name = json["provider_name"]; |
| 399 | 407 | retval.provider_url = json["provider_url"]; |
| 408 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 400 | 409 | retval.thumbnail_height = json["thumbnail_height"]; |
| 401 | 410 | retval.thumbnail_url = json["thumbnail_url"]; |
| 411 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 402 | 412 | retval.thumbnail_width = json["thumbnail_width"]; |
| 403 | 413 | retval.title = json["title"]; |
| 404 | 414 | retval.type = json["type"]; |
| 405 | 415 | retval.version = json["version"]; |
| 416 | + if (!intp(json["width"])) error("Expected integer"); | |
| 406 | 417 | retval.width = json["width"]; |
| 407 | 418 | |
| 408 | 419 | return retval; |
| @@ -521,8 +532,10 @@ class Source { | ||
| 521 | 532 | Source Source_from_JSON(mixed json) { |
| 522 | 533 | Source retval = Source(); |
| 523 | 534 | |
| 535 | + if (!intp(json["height"])) error("Expected integer"); | |
| 524 | 536 | retval.height = json["height"]; |
| 525 | 537 | retval.url = json["url"]; |
| 538 | + if (!intp(json["width"])) error("Expected integer"); | |
| 526 | 539 | retval.width = json["width"]; |
| 527 | 540 | |
| 528 | 541 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/6dec6.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/6eb00.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -37,7 +37,9 @@ class TopLevelElement { | ||
| 37 | 37 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 38 | 38 | TopLevelElement retval = TopLevelElement(); |
| 39 | 39 | |
| 40 | + if (!intp(json["DirectorateID"])) error("Expected integer"); | |
| 40 | 41 | retval.directorate_id = json["DirectorateID"]; |
| 42 | + if (!intp(json["Id"])) error("Expected integer"); | |
| 41 | 43 | retval.id = json["Id"]; |
| 42 | 44 | retval.name = json["Name"]; |
Test case
1 generated file · +12 −0test/inputs/json/misc/734ad.json
Mpikedefault / TopLevel.pmod+12 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
| @@ -217,6 +220,7 @@ Result Result_from_JSON(mixed json) { | ||
| 217 | 220 | retval.be_office_street = json["be_office_street"]; |
| 218 | 221 | retval.be_office_town = json["be_office_town"]; |
| 219 | 222 | retval.code_of_conduct = json["code_of_conduct"]; |
| 223 | + if (!intp(json["contact_country"])) error("Expected integer"); | |
| 220 | 224 | retval.contact_country = json["contact_country"]; |
| 221 | 225 | retval.created_at = json["created_at"]; |
| 222 | 226 | retval.entity = json["entity"]; |
| @@ -240,15 +244,21 @@ Result Result_from_JSON(mixed json) { | ||
| 240 | 244 | retval.last_update_date = json["last_update_date"]; |
| 241 | 245 | retval.legal = json["legal"]; |
| 242 | 246 | retval.legal_status = json["legal_status"]; |
| 247 | + if (!intp(json["main_category"])) error("Expected integer"); | |
| 243 | 248 | retval.main_category = json["main_category"]; |
| 244 | 249 | retval.main_category_title = json["main_category_title"]; |
| 250 | + if (!intp(json["members"])) error("Expected integer"); | |
| 245 | 251 | retval.members = json["members"]; |
| 252 | + if (!intp(json["members_100"])) error("Expected integer"); | |
| 246 | 253 | if (!has_index(json, "members_100")) error("Missing required property"); |
| 247 | 254 | retval.members_100 = json["members_100"]; |
| 255 | + if (!intp(json["members_25"])) error("Expected integer"); | |
| 248 | 256 | if (!has_index(json, "members_25")) error("Missing required property"); |
| 249 | 257 | retval.members_25 = json["members_25"]; |
| 258 | + if (!intp(json["members_50"])) error("Expected integer"); | |
| 250 | 259 | if (!has_index(json, "members_50")) error("Missing required property"); |
| 251 | 260 | retval.members_50 = json["members_50"]; |
| 261 | + if (!intp(json["members_75"])) error("Expected integer"); | |
| 252 | 262 | if (!has_index(json, "members_75")) error("Missing required property"); |
| 253 | 263 | retval.members_75 = json["members_75"]; |
| 254 | 264 | retval.members_fte = (float)json["members_fte"]; |
| @@ -256,6 +266,7 @@ Result Result_from_JSON(mixed json) { | ||
| 256 | 266 | retval.native_name = json["native_name"]; |
| 257 | 267 | if (!has_index(json, "networking")) error("Missing required property"); |
| 258 | 268 | retval.networking = json["networking"]; |
| 269 | + if (!intp(json["number_of_natural_persons"])) error("Expected integer"); | |
| 259 | 270 | if (!has_index(json, "number_of_natural_persons")) error("Missing required property"); |
| 260 | 271 | retval.number_of_natural_persons = json["number_of_natural_persons"]; |
| 261 | 272 | if (!has_index(json, "other_code_of_conduct")) error("Missing required property"); |
| @@ -263,6 +274,7 @@ Result Result_from_JSON(mixed json) { | ||
| 263 | 274 | retval.registration_date = json["registration_date"]; |
| 264 | 275 | retval.status = Status_from_JSON(json["status"]); |
| 265 | 276 | retval.structure_members = json["structure_members"]; |
| 277 | + if (!intp(json["sub_category"])) error("Expected integer"); | |
| 266 | 278 | retval.sub_category = json["sub_category"]; |
| 267 | 279 | retval.sub_category_title = json["sub_category_title"]; |
| 268 | 280 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/7681c.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -435,6 +436,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 435 | 436 | |
| 436 | 437 | retval.msg = json["msg"]; |
| 437 | 438 | retval.response_id = json["response_id"]; |
| 439 | + if (!intp(json["status"])) error("Expected integer"); | |
| 438 | 440 | retval.status = json["status"]; |
| 439 | 441 | |
| 440 | 442 | return retval; |
| @@ -459,8 +461,11 @@ class Pagination { | ||
| 459 | 461 | Pagination Pagination_from_JSON(mixed json) { |
| 460 | 462 | Pagination retval = Pagination(); |
| 461 | 463 | |
| 464 | + if (!intp(json["count"])) error("Expected integer"); | |
| 462 | 465 | retval.count = json["count"]; |
| 466 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 463 | 467 | retval.offset = json["offset"]; |
| 468 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 464 | 469 | retval.total_count = json["total_count"]; |
| 465 | 470 | |
| 466 | 471 | return retval; |
Test case
1 generated file · +2 −0test/inputs/json/misc/7df41.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -68,8 +68,10 @@ class Pc { | ||
| 68 | 68 | Pc Pc_from_JSON(mixed json) { |
| 69 | 69 | Pc retval = Pc(); |
| 70 | 70 | |
| 71 | + if (!intp(json["count"])) error("Expected integer"); | |
| 71 | 72 | retval.count = json["count"]; |
| 72 | 73 | retval.label = json["label"]; |
| 74 | + if (!intp(json["peak24"])) error("Expected integer"); | |
| 73 | 75 | retval.peak24 = json["peak24"]; |
| 74 | 76 | |
| 75 | 77 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/7dfa6.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/7eb30.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -33,6 +33,7 @@ class TopLevel { | ||
| 33 | 33 | TopLevel TopLevel_from_JSON(mixed json) { |
| 34 | 34 | TopLevel retval = TopLevel(); |
| 35 | 35 | |
| 36 | + if (!intp(json["count"])) error("Expected integer"); | |
| 36 | 37 | retval.count = json["count"]; |
| 37 | 38 | retval.next = json["next"]; |
| 38 | 39 | retval.previous = json["previous"]; |
| @@ -89,12 +90,16 @@ Result Result_from_JSON(mixed json) { | ||
| 89 | 90 | Group_from_JSON(json["group"]); |
| 90 | 91 | retval.group = json["group"]; |
| 91 | 92 | retval.location = Location_from_JSON(json["location"]); |
| 93 | + if (!intp(json["min_screens"])) error("Expected integer"); | |
| 92 | 94 | retval.min_screens = json["min_screens"]; |
| 95 | + if (!intp(json["num_views"])) error("Expected integer"); | |
| 93 | 96 | retval.num_views = json["num_views"]; |
| 94 | 97 | retval.showtimes = json["showtimes"]; |
| 98 | + if (!intp(json["stars"])) error("Expected integer"); | |
| 95 | 99 | retval.stars = json["stars"]; |
| 96 | 100 | retval.tel = Tel_from_JSON(json["tel"]); |
| 97 | 101 | retval.thai = json["thai"]; |
| 102 | + if (!intp(json["today_screens"])) error("Expected integer"); | |
| 98 | 103 | retval.today_screens = json["today_screens"]; |
| 99 | 104 | retval.url = json["url"]; |
| 100 | 105 | retval.website = json["website"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/7f568.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -63,6 +63,7 @@ class TopLevelElement { | ||
| 63 | 63 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 64 | 64 | TopLevelElement retval = TopLevelElement(); |
| 65 | 65 | |
| 66 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 66 | 67 | retval.comments = json["comments"]; |
| 67 | 68 | retval.comments_url = json["comments_url"]; |
| 68 | 69 | retval.commits_url = json["commits_url"]; |
| @@ -113,6 +114,7 @@ File File_from_JSON(mixed json) { | ||
| 113 | 114 | if (!has_index(json, "language")) error("Missing required property"); |
| 114 | 115 | retval.language = Language_from_JSON(json["language"]); |
| 115 | 116 | retval.raw_url = json["raw_url"]; |
| 117 | + if (!intp(json["size"])) error("Expected integer"); | |
| 116 | 118 | retval.size = json["size"]; |
| 117 | 119 | retval.type = Type_from_JSON(json["type"]); |
Test case
1 generated file · +3 −0test/inputs/json/misc/7fbfb.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -120,9 +120,12 @@ class FluffyTopLevel { | ||
| 120 | 120 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 121 | 121 | FluffyTopLevel retval = FluffyTopLevel(); |
| 122 | 122 | |
| 123 | + if (!intp(json["page"])) error("Expected integer"); | |
| 123 | 124 | retval.page = json["page"]; |
| 125 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 124 | 126 | retval.pages = json["pages"]; |
| 125 | 127 | retval.per_page = json["per_page"]; |
| 128 | + if (!intp(json["total"])) error("Expected integer"); | |
| 126 | 129 | retval.total = json["total"]; |
| 127 | 130 | |
| 128 | 131 | return retval; |
Test case
1 generated file · +6 −0test/inputs/json/misc/80aff.json
Mpikedefault / TopLevel.pmod+6 −0
| @@ -39,12 +39,15 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | if (json["next"] != Standards.JSON.true && json["next"] != Standards.JSON.false) error("Expected bool"); |
| 47 | 49 | retval.next = json["next"]; |
| 50 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 48 | 51 | retval.offset = json["offset"]; |
| 49 | 52 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 50 | 53 | retval.previous = json["previous"]; |
| @@ -97,9 +100,12 @@ Result Result_from_JSON(mixed json) { | ||
| 97 | 100 | Result retval = Result(); |
| 98 | 101 | |
| 99 | 102 | retval.created_at = json["created_at"]; |
| 103 | + if (!intp(json["id"])) error("Expected integer"); | |
| 100 | 104 | retval.id = json["id"]; |
| 105 | + if (!intp(json["items"])) error("Expected integer"); | |
| 101 | 106 | retval.items = json["items"]; |
| 102 | 107 | retval.name = json["name"]; |
| 108 | + if (!intp(json["parent"])) error("Expected integer"); | |
| 103 | 109 | if (!has_index(json, "parent")) error("Missing required property"); |
| 104 | 110 | retval.parent = json["parent"]; |
| 105 | 111 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +9 −0test/inputs/json/misc/8592b.json
Mpikedefault / TopLevel.pmod+9 −0
| @@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 255 | 255 | retval.created_utc = (float)json["created_utc"]; |
| 256 | 256 | retval.distinguished = json["distinguished"]; |
| 257 | 257 | retval.domain = json["domain"]; |
| 258 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 258 | 259 | retval.downs = json["downs"]; |
| 259 | 260 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 260 | 261 | retval.edited = json["edited"]; |
| 262 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 261 | 263 | retval.gilded = json["gilded"]; |
| 262 | 264 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 263 | 265 | retval.hidden = json["hidden"]; |
| @@ -278,6 +280,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 278 | 280 | retval.media_embed = json["media_embed"]; |
| 279 | 281 | retval.mod_reports = json["mod_reports"]; |
| 280 | 282 | retval.name = json["name"]; |
| 283 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 281 | 284 | retval.num_comments = json["num_comments"]; |
| 282 | 285 | retval.num_reports = json["num_reports"]; |
| 283 | 286 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -292,6 +295,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 292 | 295 | retval.report_reasons = json["report_reasons"]; |
| 293 | 296 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 294 | 297 | retval.saved = json["saved"]; |
| 298 | + if (!intp(json["score"])) error("Expected integer"); | |
| 295 | 299 | retval.score = json["score"]; |
| 296 | 300 | retval.secure_media = json["secure_media"]; |
| 297 | 301 | MediaEmbed_from_JSON(json["secure_media_embed"]); |
| @@ -309,11 +313,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 309 | 313 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 310 | 314 | retval.suggested_sort = SuggestedSort_from_JSON(json["suggested_sort"]); |
| 311 | 315 | retval.thumbnail = json["thumbnail"]; |
| 316 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 312 | 317 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 313 | 318 | retval.thumbnail_height = json["thumbnail_height"]; |
| 319 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 314 | 320 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 315 | 321 | retval.thumbnail_width = json["thumbnail_width"]; |
| 316 | 322 | retval.title = json["title"]; |
| 323 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 317 | 324 | retval.ups = json["ups"]; |
| 318 | 325 | retval.url = json["url"]; |
| 319 | 326 | retval.user_reports = json["user_reports"]; |
| @@ -422,8 +429,10 @@ class Source { | ||
| 422 | 429 | Source Source_from_JSON(mixed json) { |
| 423 | 430 | Source retval = Source(); |
| 424 | 431 | |
| 432 | + if (!intp(json["height"])) error("Expected integer"); | |
| 425 | 433 | retval.height = json["height"]; |
| 426 | 434 | retval.url = json["url"]; |
| 435 | + if (!intp(json["width"])) error("Expected integer"); | |
| 427 | 436 | retval.width = json["width"]; |
| 428 | 437 | |
| 429 | 438 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/88130.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/8a62c.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/9929c.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/9ac3b.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/a0496.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -68,6 +68,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 68 | 68 | retval.errors = json["errors"]; |
| 69 | 69 | retval.frequency = json["frequency"]; |
| 70 | 70 | retval.from_date = json["from_date"]; |
| 71 | + if (!intp(json["id"])) error("Expected integer"); | |
| 71 | 72 | retval.id = json["id"]; |
| 72 | 73 | retval.name = json["name"]; |
| 73 | 74 | if (json["premium"] != Standards.JSON.true && json["premium"] != Standards.JSON.false) error("Expected bool"); |
Test case
1 generated file · +1 −0test/inputs/json/misc/a1eca.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +18 −0test/inputs/json/misc/a3d8c.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -150,11 +150,14 @@ class View { | ||
| 150 | 150 | View View_from_JSON(mixed json) { |
| 151 | 151 | View retval = View(); |
| 152 | 152 | |
| 153 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 153 | 154 | retval.average_rating = json["averageRating"]; |
| 154 | 155 | retval.category = json["category"]; |
| 155 | 156 | retval.columns = json["columns"]; |
| 157 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 156 | 158 | retval.created_at = json["createdAt"]; |
| 157 | 159 | retval.display_type = json["displayType"]; |
| 160 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 158 | 161 | retval.download_count = json["downloadCount"]; |
| 159 | 162 | retval.flags = json["flags"]; |
| 160 | 163 | retval.grants = json["grants"]; |
| @@ -163,6 +166,7 @@ View View_from_JSON(mixed json) { | ||
| 163 | 166 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 164 | 167 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 165 | 168 | retval.id = json["id"]; |
| 169 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 166 | 170 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 167 | 171 | License_from_JSON(json["license"]); |
| 168 | 172 | retval.license = json["license"]; |
| @@ -173,27 +177,36 @@ View View_from_JSON(mixed json) { | ||
| 173 | 177 | retval.name = json["name"]; |
| 174 | 178 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 175 | 179 | retval.new_backend = json["newBackend"]; |
| 180 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 176 | 181 | retval.number_of_comments = json["numberOfComments"]; |
| 182 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 177 | 183 | retval.oid = json["oid"]; |
| 178 | 184 | Owner_from_JSON(json["owner"]); |
| 179 | 185 | retval.owner = json["owner"]; |
| 180 | 186 | retval.provenance = json["provenance"]; |
| 181 | 187 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 182 | 188 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 189 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 183 | 190 | retval.publication_date = json["publicationDate"]; |
| 191 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 184 | 192 | retval.publication_group = json["publicationGroup"]; |
| 185 | 193 | retval.publication_stage = json["publicationStage"]; |
| 186 | 194 | Query_from_JSON(json["query"]); |
| 187 | 195 | retval.query = json["query"]; |
| 188 | 196 | retval.rights = json["rights"]; |
| 189 | 197 | retval.row_class = json["rowClass"]; |
| 198 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 190 | 199 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 191 | 200 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 192 | 201 | Owner_from_JSON(json["tableAuthor"]); |
| 193 | 202 | retval.table_author = json["tableAuthor"]; |
| 203 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 194 | 204 | retval.table_id = json["tableId"]; |
| 205 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 195 | 206 | retval.total_times_rated = json["totalTimesRated"]; |
| 207 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 196 | 208 | retval.view_count = json["viewCount"]; |
| 209 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 197 | 210 | retval.view_last_modified = json["viewLastModified"]; |
| 198 | 211 | retval.view_type = json["viewType"]; |
| 199 | 212 | |
| @@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) { | ||
| 242 | 255 | retval.flags = json["flags"]; |
| 243 | 256 | Query_from_JSON(json["format"]); |
| 244 | 257 | retval.format = json["format"]; |
| 258 | + if (!intp(json["id"])) error("Expected integer"); | |
| 245 | 259 | retval.id = json["id"]; |
| 246 | 260 | retval.name = json["name"]; |
| 261 | + if (!intp(json["position"])) error("Expected integer"); | |
| 247 | 262 | retval.position = json["position"]; |
| 248 | 263 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 249 | 264 | retval.table_column_id = json["tableColumnId"]; |
| @@ -281,7 +296,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 281 | 296 | |
| 282 | 297 | retval.average = json["average"]; |
| 283 | 298 | retval.largest = json["largest"]; |
| 299 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 284 | 300 | retval.non_null = json["non_null"]; |
| 301 | + if (!intp(json["null"])) error("Expected integer"); | |
| 285 | 302 | retval.null = json["null"]; |
| 286 | 303 | retval.smallest = json["smallest"]; |
| 287 | 304 | retval.sum = json["sum"]; |
| @@ -307,6 +324,7 @@ class Top { | ||
| 307 | 324 | Top Top_from_JSON(mixed json) { |
| 308 | 325 | Top retval = Top(); |
| 309 | 326 | |
| 327 | + if (!intp(json["count"])) error("Expected integer"); | |
| 310 | 328 | retval.count = json["count"]; |
| 311 | 329 | retval.item = json["item"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/a45b0.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/ab0d1.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/abb4b.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/ae7f0.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -245,9 +245,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 245 | 245 | retval.created_utc = (float)json["created_utc"]; |
| 246 | 246 | retval.distinguished = json["distinguished"]; |
| 247 | 247 | retval.domain = Domain_from_JSON(json["domain"]); |
| 248 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 248 | 249 | retval.downs = json["downs"]; |
| 249 | 250 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 250 | 251 | retval.edited = json["edited"]; |
| 252 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 251 | 253 | retval.gilded = json["gilded"]; |
| 252 | 254 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 253 | 255 | retval.hidden = json["hidden"]; |
| @@ -270,6 +272,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 270 | 272 | retval.media_embed = json["media_embed"]; |
| 271 | 273 | retval.mod_reports = json["mod_reports"]; |
| 272 | 274 | retval.name = json["name"]; |
| 275 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 273 | 276 | retval.num_comments = json["num_comments"]; |
| 274 | 277 | retval.num_reports = json["num_reports"]; |
| 275 | 278 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -281,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 281 | 284 | retval.report_reasons = json["report_reasons"]; |
| 282 | 285 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 283 | 286 | retval.saved = json["saved"]; |
| 287 | + if (!intp(json["score"])) error("Expected integer"); | |
| 284 | 288 | retval.score = json["score"]; |
| 285 | 289 | retval.secure_media = json["secure_media"]; |
| 286 | 290 | MediaEmbed_from_JSON(json["secure_media_embed"]); |
| @@ -298,6 +302,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 298 | 302 | retval.suggested_sort = json["suggested_sort"]; |
| 299 | 303 | retval.thumbnail = json["thumbnail"]; |
| 300 | 304 | retval.title = json["title"]; |
| 305 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 301 | 306 | retval.ups = json["ups"]; |
| 302 | 307 | retval.url = json["url"]; |
| 303 | 308 | retval.user_reports = json["user_reports"]; |
Test case
1 generated file · +6 −0test/inputs/json/misc/af2d1.json
Mpikedefault / TopLevel.pmod+6 −0
| @@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 36 | 36 | Crs_from_JSON(json["crs"]); |
| 37 | 37 | retval.crs = json["crs"]; |
| 38 | 38 | retval.features = json["features"]; |
| 39 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 39 | 40 | retval.total_features = json["totalFeatures"]; |
| 40 | 41 | retval.type = json["type"]; |
| 41 | 42 | |
| @@ -254,6 +255,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 254 | 255 | retval.asset_numb = json["asset_numb"]; |
| 255 | 256 | if (!has_index(json, "comments")) error("Missing required property"); |
| 256 | 257 | retval.comments = json["comments"]; |
| 258 | + if (!intp(json["condition"])) error("Expected integer"); | |
| 257 | 259 | retval.condition = json["condition"]; |
| 258 | 260 | if (!has_index(json, "constructi")) error("Missing required property"); |
| 259 | 261 | retval.constructi = json["constructi"]; |
| @@ -269,6 +271,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 269 | 271 | retval.folder_num = json["folder_num"]; |
| 270 | 272 | if (!has_index(json, "funding_ba")) error("Missing required property"); |
| 271 | 273 | retval.funding_ba = FundingBa_from_JSON(json["funding_ba"]); |
| 274 | + if (!intp(json["historic_c"])) error("Expected integer"); | |
| 272 | 275 | retval.historic_c = json["historic_c"]; |
| 273 | 276 | retval.inspection = json["inspection"]; |
| 274 | 277 | retval.inspectors = json["inspectors"]; |
| @@ -276,8 +279,10 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 276 | 279 | if (!has_index(json, "level_accu")) error("Missing required property"); |
| 277 | 280 | retval.level_accu = LevelAccu_from_JSON(json["level_accu"]); |
| 278 | 281 | retval.material = Material_from_JSON(json["material"]); |
| 282 | + if (!intp(json["mi_prinx"])) error("Expected integer"); | |
| 279 | 283 | retval.mi_prinx = json["mi_prinx"]; |
| 280 | 284 | retval.mi_symbolo = MiSymbolo_from_JSON(json["mi_symbolo"]); |
| 285 | + if (!intp(json["number_lan"])) error("Expected integer"); | |
| 281 | 286 | retval.number_lan = json["number_lan"]; |
| 282 | 287 | if (!has_index(json, "owner")) error("Missing required property"); |
| 283 | 288 | retval.owner = json["owner"]; |
| @@ -285,6 +290,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 285 | 290 | retval.positional = LevelAccu_from_JSON(json["positional"]); |
| 286 | 291 | if (!has_index(json, "project_nu")) error("Missing required property"); |
| 287 | 292 | retval.project_nu = json["project_nu"]; |
| 293 | + if (!intp(json["rec_id"])) error("Expected integer"); | |
| 288 | 294 | retval.rec_id = json["rec_id"]; |
| 289 | 295 | if (!has_index(json, "record_cre")) error("Missing required property"); |
| 290 | 296 | retval.record_cre = json["record_cre"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/b6f2c.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/bb1ec.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +13 −0test/inputs/json/misc/be234.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 255 | 255 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 256 | 256 | retval.distinguished = json["distinguished"]; |
| 257 | 257 | retval.domain = Domain_from_JSON(json["domain"]); |
| 258 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 258 | 259 | retval.downs = json["downs"]; |
| 259 | 260 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 260 | 261 | retval.edited = json["edited"]; |
| 262 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 261 | 263 | retval.gilded = json["gilded"]; |
| 262 | 264 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 263 | 265 | retval.hidden = json["hidden"]; |
| @@ -280,6 +282,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 280 | 282 | retval.media_embed = json["media_embed"]; |
| 281 | 283 | retval.mod_reports = json["mod_reports"]; |
| 282 | 284 | retval.name = json["name"]; |
| 285 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 283 | 286 | retval.num_comments = json["num_comments"]; |
| 284 | 287 | retval.num_reports = json["num_reports"]; |
| 285 | 288 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -294,6 +297,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 294 | 297 | retval.report_reasons = json["report_reasons"]; |
| 295 | 298 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 296 | 299 | retval.saved = json["saved"]; |
| 300 | + if (!intp(json["score"])) error("Expected integer"); | |
| 297 | 301 | retval.score = json["score"]; |
| 298 | 302 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 299 | 303 | if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]); |
| @@ -312,9 +316,12 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 312 | 316 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 313 | 317 | retval.suggested_sort = json["suggested_sort"]; |
| 314 | 318 | retval.thumbnail = json["thumbnail"]; |
| 319 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 315 | 320 | retval.thumbnail_height = json["thumbnail_height"]; |
| 321 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 316 | 322 | retval.thumbnail_width = json["thumbnail_width"]; |
| 317 | 323 | retval.title = json["title"]; |
| 324 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 318 | 325 | retval.ups = json["ups"]; |
| 319 | 326 | retval.url = json["url"]; |
| 320 | 327 | retval.user_reports = json["user_reports"]; |
| @@ -399,16 +406,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 399 | 406 | Oembed retval = Oembed(); |
| 400 | 407 | |
| 401 | 408 | retval.description = json["description"]; |
| 409 | + if (!intp(json["height"])) error("Expected integer"); | |
| 402 | 410 | retval.height = json["height"]; |
| 403 | 411 | retval.html = json["html"]; |
| 404 | 412 | retval.provider_name = json["provider_name"]; |
| 405 | 413 | retval.provider_url = json["provider_url"]; |
| 414 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 406 | 415 | retval.thumbnail_height = json["thumbnail_height"]; |
| 407 | 416 | retval.thumbnail_url = json["thumbnail_url"]; |
| 417 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 408 | 418 | retval.thumbnail_width = json["thumbnail_width"]; |
| 409 | 419 | retval.title = json["title"]; |
| 410 | 420 | retval.type = json["type"]; |
| 411 | 421 | retval.version = json["version"]; |
| 422 | + if (!intp(json["width"])) error("Expected integer"); | |
| 412 | 423 | retval.width = json["width"]; |
| 413 | 424 | |
| 414 | 425 | return retval; |
| @@ -527,8 +538,10 @@ class Source { | ||
| 527 | 538 | Source Source_from_JSON(mixed json) { |
| 528 | 539 | Source retval = Source(); |
| 529 | 540 | |
| 541 | + if (!intp(json["height"])) error("Expected integer"); | |
| 530 | 542 | retval.height = json["height"]; |
| 531 | 543 | retval.url = json["url"]; |
| 544 | + if (!intp(json["width"])) error("Expected integer"); | |
| 532 | 545 | retval.width = json["width"]; |
| 533 | 546 | |
| 534 | 547 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/c0356.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -79,6 +79,7 @@ Description Description_from_JSON(mixed json) { | ||
| 79 | 79 | Description retval = Description(); |
| 80 | 80 | |
| 81 | 81 | retval.base_period = json["base_period"]; |
| 82 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 82 | 83 | retval.missing = json["missing"]; |
| 83 | 84 | retval.title = json["title"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/c3303.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -430,6 +431,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 430 | 431 | |
| 431 | 432 | retval.msg = json["msg"]; |
| 432 | 433 | retval.response_id = json["response_id"]; |
| 434 | + if (!intp(json["status"])) error("Expected integer"); | |
| 433 | 435 | retval.status = json["status"]; |
| 434 | 436 | |
| 435 | 437 | return retval; |
| @@ -454,8 +456,11 @@ class Pagination { | ||
| 454 | 456 | Pagination Pagination_from_JSON(mixed json) { |
| 455 | 457 | Pagination retval = Pagination(); |
| 456 | 458 | |
| 459 | + if (!intp(json["count"])) error("Expected integer"); | |
| 457 | 460 | retval.count = json["count"]; |
| 461 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 458 | 462 | retval.offset = json["offset"]; |
| 463 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 459 | 464 | retval.total_count = json["total_count"]; |
| 460 | 465 | |
| 461 | 466 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/c8c7e.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -120,9 +120,12 @@ class FluffyTopLevel { | ||
| 120 | 120 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 121 | 121 | FluffyTopLevel retval = FluffyTopLevel(); |
| 122 | 122 | |
| 123 | + if (!intp(json["page"])) error("Expected integer"); | |
| 123 | 124 | retval.page = json["page"]; |
| 125 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 124 | 126 | retval.pages = json["pages"]; |
| 125 | 127 | retval.per_page = json["per_page"]; |
| 128 | + if (!intp(json["total"])) error("Expected integer"); | |
| 126 | 129 | retval.total = json["total"]; |
| 127 | 130 | |
| 128 | 131 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/cda6c.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -120,9 +120,12 @@ class FluffyTopLevel { | ||
| 120 | 120 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 121 | 121 | FluffyTopLevel retval = FluffyTopLevel(); |
| 122 | 122 | |
| 123 | + if (!intp(json["page"])) error("Expected integer"); | |
| 123 | 124 | retval.page = json["page"]; |
| 125 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 124 | 126 | retval.pages = json["pages"]; |
| 125 | 127 | retval.per_page = json["per_page"]; |
| 128 | + if (!intp(json["total"])) error("Expected integer"); | |
| 126 | 129 | retval.total = json["total"]; |
| 127 | 130 | |
| 128 | 131 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/cf0d8.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/d0908.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) { | ||
| 50 | 50 | TotalPopulation retval = TotalPopulation(); |
| 51 | 51 | |
| 52 | 52 | retval.date = json["date"]; |
| 53 | + if (!intp(json["population"])) error("Expected integer"); | |
| 53 | 54 | retval.population = json["population"]; |
| 54 | 55 | |
| 55 | 56 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/d23d5.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -39,11 +39,14 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["count"])) error("Expected integer"); | |
| 42 | 43 | retval.count = json["count"]; |
| 43 | 44 | Facets_from_JSON(json["facets"]); |
| 44 | 45 | retval.facets = json["facets"]; |
| 46 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 45 | 47 | retval.limit = json["limit"]; |
| 46 | 48 | retval.next = json["next"]; |
| 49 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 47 | 50 | retval.offset = json["offset"]; |
| 48 | 51 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 49 | 52 | retval.previous = json["previous"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/dbfb3.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/dc44f.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 53 | 53 | retval.code = json["code"]; |
| 54 | 54 | retval.gatherer_code = json["gathererCode"]; |
| 55 | 55 | retval.magic_cards_info_code = json["magicCardsInfoCode"]; |
| 56 | + if (!intp(json["mkm_id"])) error("Expected integer"); | |
| 56 | 57 | retval.mkm_id = json["mkm_id"]; |
| 57 | 58 | retval.mkm_name = json["mkm_name"]; |
| 58 | 59 | retval.name = json["name"]; |
| @@ -140,6 +141,7 @@ Card Card_from_JSON(mixed json) { | ||
| 140 | 141 | Card retval = Card(); |
| 141 | 142 | |
| 142 | 143 | retval.artist = json["artist"]; |
| 144 | + if (!intp(json["cmc"])) error("Expected integer"); | |
| 143 | 145 | retval.cmc = json["cmc"]; |
| 144 | 146 | retval.color_identity = json["colorIdentity"]; |
| 145 | 147 | retval.colors = json["colors"]; |
| @@ -150,6 +152,7 @@ Card Card_from_JSON(mixed json) { | ||
| 150 | 152 | retval.legalities = json["legalities"]; |
| 151 | 153 | retval.mana_cost = json["manaCost"]; |
| 152 | 154 | retval.mci_number = json["mciNumber"]; |
| 155 | + if (!intp(json["multiverseid"])) error("Expected integer"); | |
| 153 | 156 | retval.multiverseid = json["multiverseid"]; |
| 154 | 157 | retval.name = json["name"]; |
| 155 | 158 | retval.original_text = json["originalText"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/dd1ce.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 53 | 53 | retval.code = json["code"]; |
| 54 | 54 | retval.gatherer_code = json["gathererCode"]; |
| 55 | 55 | retval.magic_cards_info_code = json["magicCardsInfoCode"]; |
| 56 | + if (!intp(json["mkm_id"])) error("Expected integer"); | |
| 56 | 57 | retval.mkm_id = json["mkm_id"]; |
| 57 | 58 | retval.mkm_name = json["mkm_name"]; |
| 58 | 59 | retval.name = json["name"]; |
| @@ -140,6 +141,7 @@ Card Card_from_JSON(mixed json) { | ||
| 140 | 141 | Card retval = Card(); |
| 141 | 142 | |
| 142 | 143 | retval.artist = json["artist"]; |
| 144 | + if (!intp(json["cmc"])) error("Expected integer"); | |
| 143 | 145 | retval.cmc = json["cmc"]; |
| 144 | 146 | retval.color_identity = json["colorIdentity"]; |
| 145 | 147 | retval.colors = json["colors"]; |
| @@ -150,6 +152,7 @@ Card Card_from_JSON(mixed json) { | ||
| 150 | 152 | retval.legalities = json["legalities"]; |
| 151 | 153 | retval.mana_cost = json["manaCost"]; |
| 152 | 154 | retval.mci_number = json["mciNumber"]; |
| 155 | + if (!intp(json["multiverseid"])) error("Expected integer"); | |
| 153 | 156 | retval.multiverseid = json["multiverseid"]; |
| 154 | 157 | retval.name = json["name"]; |
| 155 | 158 | retval.original_text = json["originalText"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/dec3a.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 82 | 82 | ResponseInfo retval = ResponseInfo(); |
| 83 | 83 | |
| 84 | 84 | retval.developer_message = json["developerMessage"]; |
| 85 | + if (!intp(json["status"])) error("Expected integer"); | |
| 85 | 86 | retval.status = json["status"]; |
| 86 | 87 | |
| 87 | 88 | return retval; |
| @@ -106,8 +107,11 @@ class Resultset { | ||
| 106 | 107 | Resultset Resultset_from_JSON(mixed json) { |
| 107 | 108 | Resultset retval = Resultset(); |
| 108 | 109 | |
| 110 | + if (!intp(json["count"])) error("Expected integer"); | |
| 109 | 111 | retval.count = json["count"]; |
| 112 | + if (!intp(json["page"])) error("Expected integer"); | |
| 110 | 113 | retval.page = json["page"]; |
| 114 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 111 | 115 | retval.pagesize = json["pagesize"]; |
| 112 | 116 | |
| 113 | 117 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/df957.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/e0ac7.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -424,6 +425,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 424 | 425 | |
| 425 | 426 | retval.msg = json["msg"]; |
| 426 | 427 | retval.response_id = json["response_id"]; |
| 428 | + if (!intp(json["status"])) error("Expected integer"); | |
| 427 | 429 | retval.status = json["status"]; |
| 428 | 430 | |
| 429 | 431 | return retval; |
| @@ -448,8 +450,11 @@ class Pagination { | ||
| 448 | 450 | Pagination Pagination_from_JSON(mixed json) { |
| 449 | 451 | Pagination retval = Pagination(); |
| 450 | 452 | |
| 453 | + if (!intp(json["count"])) error("Expected integer"); | |
| 451 | 454 | retval.count = json["count"]; |
| 455 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 452 | 456 | retval.offset = json["offset"]; |
| 457 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 453 | 458 | retval.total_count = json["total_count"]; |
| 454 | 459 | |
| 455 | 460 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/e2915.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -54,6 +54,7 @@ class Query { | ||
| 54 | 54 | Query Query_from_JSON(mixed json) { |
| 55 | 55 | Query retval = Query(); |
| 56 | 56 | |
| 57 | + if (!intp(json["count"])) error("Expected integer"); | |
| 57 | 58 | retval.count = json["count"]; |
| 58 | 59 | retval.created = json["created"]; |
| 59 | 60 | retval.lang = json["lang"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/e53b5.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -120,9 +120,12 @@ class FluffyTopLevel { | ||
| 120 | 120 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 121 | 121 | FluffyTopLevel retval = FluffyTopLevel(); |
| 122 | 122 | |
| 123 | + if (!intp(json["page"])) error("Expected integer"); | |
| 123 | 124 | retval.page = json["page"]; |
| 125 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 124 | 126 | retval.pages = json["pages"]; |
| 125 | 127 | retval.per_page = json["per_page"]; |
| 128 | + if (!intp(json["total"])) error("Expected integer"); | |
| 126 | 129 | retval.total = json["total"]; |
| 127 | 130 | |
| 128 | 131 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/e8a0b.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +13 −0test/inputs/json/misc/e8b04.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -111,11 +111,14 @@ class TopLevelElement { | ||
| 111 | 111 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 112 | 112 | TopLevelElement retval = TopLevelElement(); |
| 113 | 113 | |
| 114 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 114 | 115 | retval.average_rating = json["averageRating"]; |
| 115 | 116 | retval.category = json["category"]; |
| 117 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 116 | 118 | retval.created_at = json["createdAt"]; |
| 117 | 119 | retval.description = json["description"]; |
| 118 | 120 | retval.display_type = DisplayType_from_JSON(json["displayType"]); |
| 121 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 119 | 122 | retval.download_count = json["downloadCount"]; |
| 120 | 123 | retval.flags = json["flags"]; |
| 121 | 124 | retval.grants = json["grants"]; |
| @@ -133,7 +136,9 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 133 | 136 | retval.name = json["name"]; |
| 134 | 137 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 135 | 138 | retval.new_backend = json["newBackend"]; |
| 139 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 136 | 140 | retval.number_of_comments = json["numberOfComments"]; |
| 141 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 137 | 142 | retval.oid = json["oid"]; |
| 138 | 143 | Owner_from_JSON(json["owner"]); |
| 139 | 144 | retval.owner = json["owner"]; |
| @@ -141,6 +146,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 141 | 146 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 142 | 147 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 143 | 148 | retval.publication_date = json["publicationDate"]; |
| 149 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 144 | 150 | retval.publication_group = json["publicationGroup"]; |
| 145 | 151 | retval.publication_stage = PublicationStage_from_JSON(json["publicationStage"]); |
| 146 | 152 | if (has_index(json, "ratings") && json["ratings"] != Val.null) Ratings_from_JSON(json["ratings"]); |
| @@ -153,10 +159,14 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 153 | 159 | retval.rows_updated_by = RowsUpdatedBy_from_JSON(json["rowsUpdatedBy"]); |
| 154 | 160 | TableAuthor_from_JSON(json["tableAuthor"]); |
| 155 | 161 | retval.table_author = json["tableAuthor"]; |
| 162 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 156 | 163 | retval.table_id = json["tableId"]; |
| 157 | 164 | retval.tags = json["tags"]; |
| 165 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 158 | 166 | retval.total_times_rated = json["totalTimesRated"]; |
| 167 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 159 | 168 | retval.view_count = json["viewCount"]; |
| 169 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 160 | 170 | retval.view_last_modified = json["viewLastModified"]; |
| 161 | 171 | retval.view_type = ViewType_from_JSON(json["viewType"]); |
| 162 | 172 | |
| @@ -561,6 +571,7 @@ class TableColumnId { | ||
| 561 | 571 | TableColumnId TableColumnId_from_JSON(mixed json) { |
| 562 | 572 | TableColumnId retval = TableColumnId(); |
| 563 | 573 | |
| 574 | + if (!intp(json["2819740"])) error("Expected integer"); | |
| 564 | 575 | retval.the_2819740 = json["2819740"]; |
| 565 | 576 | |
| 566 | 577 | return retval; |
| @@ -730,6 +741,7 @@ class Field { | ||
| 730 | 741 | Field Field_from_JSON(mixed json) { |
| 731 | 742 | Field retval = Field(); |
| 732 | 743 | |
| 744 | + if (!intp(json["tableColumnId"])) error("Expected integer"); | |
| 733 | 745 | retval.table_column_id = json["tableColumnId"]; |
| 734 | 746 | retval.type = FieldType_from_JSON(json["type"]); |
| 735 | 747 | |
| @@ -961,6 +973,7 @@ class Ratings { | ||
| 961 | 973 | Ratings Ratings_from_JSON(mixed json) { |
| 962 | 974 | Ratings retval = Ratings(); |
| 963 | 975 | |
| 976 | + if (!intp(json["rating"])) error("Expected integer"); | |
| 964 | 977 | retval.rating = json["rating"]; |
| 965 | 978 | |
| 966 | 979 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/f22f5.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -245,9 +245,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 245 | 245 | retval.created_utc = (float)json["created_utc"]; |
| 246 | 246 | retval.distinguished = json["distinguished"]; |
| 247 | 247 | retval.domain = json["domain"]; |
| 248 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 248 | 249 | retval.downs = json["downs"]; |
| 249 | 250 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 250 | 251 | retval.edited = json["edited"]; |
| 252 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 251 | 253 | retval.gilded = json["gilded"]; |
| 252 | 254 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 253 | 255 | retval.hidden = json["hidden"]; |
| @@ -270,6 +272,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 270 | 272 | retval.media_embed = json["media_embed"]; |
| 271 | 273 | retval.mod_reports = json["mod_reports"]; |
| 272 | 274 | retval.name = json["name"]; |
| 275 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 273 | 276 | retval.num_comments = json["num_comments"]; |
| 274 | 277 | retval.num_reports = json["num_reports"]; |
| 275 | 278 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -281,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 281 | 284 | retval.report_reasons = json["report_reasons"]; |
| 282 | 285 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 283 | 286 | retval.saved = json["saved"]; |
| 287 | + if (!intp(json["score"])) error("Expected integer"); | |
| 284 | 288 | retval.score = json["score"]; |
| 285 | 289 | retval.secure_media = json["secure_media"]; |
| 286 | 290 | MediaEmbed_from_JSON(json["secure_media_embed"]); |
| @@ -298,6 +302,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 298 | 302 | retval.suggested_sort = json["suggested_sort"]; |
| 299 | 303 | retval.thumbnail = json["thumbnail"]; |
| 300 | 304 | retval.title = json["title"]; |
| 305 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 301 | 306 | retval.ups = json["ups"]; |
| 302 | 307 | retval.url = json["url"]; |
| 303 | 308 | retval.user_reports = json["user_reports"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/f3edf.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/f466a.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -43,11 +43,16 @@ class TopLevelElement { | ||
| 43 | 43 | TopLevelElement TopLevelElement_from_JSON(mixed json) { |
| 44 | 44 | TopLevelElement retval = TopLevelElement(); |
| 45 | 45 | |
| 46 | + if (!intp(json["age"])) error("Expected integer"); | |
| 46 | 47 | retval.age = json["age"]; |
| 47 | 48 | retval.country = Country_from_JSON(json["country"]); |
| 49 | + if (!intp(json["females"])) error("Expected integer"); | |
| 48 | 50 | retval.females = json["females"]; |
| 51 | + if (!intp(json["males"])) error("Expected integer"); | |
| 49 | 52 | retval.males = json["males"]; |
| 53 | + if (!intp(json["total"])) error("Expected integer"); | |
| 50 | 54 | retval.total = json["total"]; |
| 55 | + if (!intp(json["year"])) error("Expected integer"); | |
| 51 | 56 | retval.year = json["year"]; |
| 52 | 57 | |
| 53 | 58 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/f6a65.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 97 | 97 | Images_from_JSON(json["images"]); |
| 98 | 98 | retval.images = json["images"]; |
| 99 | 99 | retval.import_datetime = json["import_datetime"]; |
| 100 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 100 | 101 | retval.is_indexable = json["is_indexable"]; |
| 101 | 102 | retval.rating = Rating_from_JSON(json["rating"]); |
| 102 | 103 | retval.slug = json["slug"]; |
| @@ -436,6 +437,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 436 | 437 | |
| 437 | 438 | retval.msg = json["msg"]; |
| 438 | 439 | retval.response_id = json["response_id"]; |
| 440 | + if (!intp(json["status"])) error("Expected integer"); | |
| 439 | 441 | retval.status = json["status"]; |
| 440 | 442 | |
| 441 | 443 | return retval; |
| @@ -460,8 +462,11 @@ class Pagination { | ||
| 460 | 462 | Pagination Pagination_from_JSON(mixed json) { |
| 461 | 463 | Pagination retval = Pagination(); |
| 462 | 464 | |
| 465 | + if (!intp(json["count"])) error("Expected integer"); | |
| 463 | 466 | retval.count = json["count"]; |
| 467 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 464 | 468 | retval.offset = json["offset"]; |
| 469 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 465 | 470 | retval.total_count = json["total_count"]; |
| 466 | 471 | |
| 467 | 472 | return retval; |
Test case
1 generated file · +18 −0test/inputs/json/misc/f74d5.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -150,11 +150,14 @@ class View { | ||
| 150 | 150 | View View_from_JSON(mixed json) { |
| 151 | 151 | View retval = View(); |
| 152 | 152 | |
| 153 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 153 | 154 | retval.average_rating = json["averageRating"]; |
| 154 | 155 | retval.category = json["category"]; |
| 155 | 156 | retval.columns = json["columns"]; |
| 157 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 156 | 158 | retval.created_at = json["createdAt"]; |
| 157 | 159 | retval.display_type = json["displayType"]; |
| 160 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 158 | 161 | retval.download_count = json["downloadCount"]; |
| 159 | 162 | retval.flags = json["flags"]; |
| 160 | 163 | retval.grants = json["grants"]; |
| @@ -163,6 +166,7 @@ View View_from_JSON(mixed json) { | ||
| 163 | 166 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 164 | 167 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 165 | 168 | retval.id = json["id"]; |
| 169 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 166 | 170 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 167 | 171 | License_from_JSON(json["license"]); |
| 168 | 172 | retval.license = json["license"]; |
| @@ -173,27 +177,36 @@ View View_from_JSON(mixed json) { | ||
| 173 | 177 | retval.name = json["name"]; |
| 174 | 178 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 175 | 179 | retval.new_backend = json["newBackend"]; |
| 180 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 176 | 181 | retval.number_of_comments = json["numberOfComments"]; |
| 182 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 177 | 183 | retval.oid = json["oid"]; |
| 178 | 184 | Owner_from_JSON(json["owner"]); |
| 179 | 185 | retval.owner = json["owner"]; |
| 180 | 186 | retval.provenance = json["provenance"]; |
| 181 | 187 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 182 | 188 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 189 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 183 | 190 | retval.publication_date = json["publicationDate"]; |
| 191 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 184 | 192 | retval.publication_group = json["publicationGroup"]; |
| 185 | 193 | retval.publication_stage = json["publicationStage"]; |
| 186 | 194 | Query_from_JSON(json["query"]); |
| 187 | 195 | retval.query = json["query"]; |
| 188 | 196 | retval.rights = json["rights"]; |
| 189 | 197 | retval.row_class = json["rowClass"]; |
| 198 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 190 | 199 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 191 | 200 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 192 | 201 | Owner_from_JSON(json["tableAuthor"]); |
| 193 | 202 | retval.table_author = json["tableAuthor"]; |
| 203 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 194 | 204 | retval.table_id = json["tableId"]; |
| 205 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 195 | 206 | retval.total_times_rated = json["totalTimesRated"]; |
| 207 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 196 | 208 | retval.view_count = json["viewCount"]; |
| 209 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 197 | 210 | retval.view_last_modified = json["viewLastModified"]; |
| 198 | 211 | retval.view_type = json["viewType"]; |
| 199 | 212 | |
| @@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) { | ||
| 242 | 255 | retval.flags = json["flags"]; |
| 243 | 256 | Query_from_JSON(json["format"]); |
| 244 | 257 | retval.format = json["format"]; |
| 258 | + if (!intp(json["id"])) error("Expected integer"); | |
| 245 | 259 | retval.id = json["id"]; |
| 246 | 260 | retval.name = json["name"]; |
| 261 | + if (!intp(json["position"])) error("Expected integer"); | |
| 247 | 262 | retval.position = json["position"]; |
| 248 | 263 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 249 | 264 | retval.table_column_id = json["tableColumnId"]; |
| @@ -281,7 +296,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 281 | 296 | |
| 282 | 297 | retval.average = json["average"]; |
| 283 | 298 | retval.largest = json["largest"]; |
| 299 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 284 | 300 | retval.non_null = json["non_null"]; |
| 301 | + if (!intp(json["null"])) error("Expected integer"); | |
| 285 | 302 | retval.null = json["null"]; |
| 286 | 303 | retval.smallest = json["smallest"]; |
| 287 | 304 | retval.sum = json["sum"]; |
| @@ -307,6 +324,7 @@ class Top { | ||
| 307 | 324 | Top Top_from_JSON(mixed json) { |
| 308 | 325 | Top retval = Top(); |
| 309 | 326 | |
| 327 | + if (!intp(json["count"])) error("Expected integer"); | |
| 310 | 328 | retval.count = json["count"]; |
| 311 | 329 | retval.item = json["item"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/f974d.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -35,9 +35,12 @@ class TopLevel { | ||
| 35 | 35 | TopLevel TopLevel_from_JSON(mixed json) { |
| 36 | 36 | TopLevel retval = TopLevel(); |
| 37 | 37 | |
| 38 | + if (!intp(json["block_index"])) error("Expected integer"); | |
| 38 | 39 | retval.block_index = json["block_index"]; |
| 39 | 40 | retval.hash = json["hash"]; |
| 41 | + if (!intp(json["height"])) error("Expected integer"); | |
| 40 | 42 | retval.height = json["height"]; |
| 43 | + if (!intp(json["time"])) error("Expected integer"); | |
| 41 | 44 | retval.time = json["time"]; |
| 42 | 45 | retval.tx_indexes = json["txIndexes"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/faff5.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -50,7 +50,9 @@ class Response { | ||
| 50 | 50 | Response Response_from_JSON(mixed json) { |
| 51 | 51 | Response retval = Response(); |
| 52 | 52 | |
| 53 | + if (!intp(json["player_count"])) error("Expected integer"); | |
| 53 | 54 | retval.player_count = json["player_count"]; |
| 55 | + if (!intp(json["result"])) error("Expected integer"); | |
| 54 | 56 | retval.result = json["result"]; |
| 55 | 57 | |
| 56 | 58 | return retval; |
Test case
1 generated file · +21 −0test/inputs/json/misc/fcca3.json
Mpikedefault / TopLevel.pmod+21 −0
| @@ -151,12 +151,15 @@ View View_from_JSON(mixed json) { | ||
| 151 | 151 | View retval = View(); |
| 152 | 152 | |
| 153 | 153 | retval.attribution = json["attribution"]; |
| 154 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 154 | 155 | retval.average_rating = json["averageRating"]; |
| 155 | 156 | retval.category = json["category"]; |
| 156 | 157 | retval.columns = json["columns"]; |
| 158 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 157 | 159 | retval.created_at = json["createdAt"]; |
| 158 | 160 | retval.description = json["description"]; |
| 159 | 161 | retval.display_type = json["displayType"]; |
| 162 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 160 | 163 | retval.download_count = json["downloadCount"]; |
| 161 | 164 | retval.flags = json["flags"]; |
| 162 | 165 | retval.grants = json["grants"]; |
| @@ -165,6 +168,7 @@ View View_from_JSON(mixed json) { | ||
| 165 | 168 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 166 | 169 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 167 | 170 | retval.id = json["id"]; |
| 171 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 168 | 172 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 169 | 173 | retval.locale = json["locale"]; |
| 170 | 174 | ViewMetadata_from_JSON(json["metadata"]); |
| @@ -172,27 +176,36 @@ View View_from_JSON(mixed json) { | ||
| 172 | 176 | retval.name = json["name"]; |
| 173 | 177 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 174 | 178 | retval.new_backend = json["newBackend"]; |
| 179 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 175 | 180 | retval.number_of_comments = json["numberOfComments"]; |
| 181 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 176 | 182 | retval.oid = json["oid"]; |
| 177 | 183 | Owner_from_JSON(json["owner"]); |
| 178 | 184 | retval.owner = json["owner"]; |
| 179 | 185 | retval.provenance = json["provenance"]; |
| 180 | 186 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 181 | 187 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 188 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 182 | 189 | retval.publication_date = json["publicationDate"]; |
| 190 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 183 | 191 | retval.publication_group = json["publicationGroup"]; |
| 184 | 192 | retval.publication_stage = json["publicationStage"]; |
| 185 | 193 | Query_from_JSON(json["query"]); |
| 186 | 194 | retval.query = json["query"]; |
| 187 | 195 | retval.rights = json["rights"]; |
| 196 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 188 | 197 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 189 | 198 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 190 | 199 | Owner_from_JSON(json["tableAuthor"]); |
| 191 | 200 | retval.table_author = json["tableAuthor"]; |
| 201 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 192 | 202 | retval.table_id = json["tableId"]; |
| 193 | 203 | retval.tags = json["tags"]; |
| 204 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 194 | 205 | retval.total_times_rated = json["totalTimesRated"]; |
| 206 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 195 | 207 | retval.view_count = json["viewCount"]; |
| 208 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 196 | 209 | retval.view_last_modified = json["viewLastModified"]; |
| 197 | 210 | retval.view_type = json["viewType"]; |
| 198 | 211 | |
| @@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) { | ||
| 244 | 257 | retval.flags = json["flags"]; |
| 245 | 258 | Format_from_JSON(json["format"]); |
| 246 | 259 | retval.format = json["format"]; |
| 260 | + if (!intp(json["id"])) error("Expected integer"); | |
| 247 | 261 | retval.id = json["id"]; |
| 248 | 262 | retval.name = json["name"]; |
| 263 | + if (!intp(json["position"])) error("Expected integer"); | |
| 249 | 264 | retval.position = json["position"]; |
| 250 | 265 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 251 | 266 | retval.table_column_id = json["tableColumnId"]; |
| @@ -283,7 +298,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 283 | 298 | |
| 284 | 299 | retval.average = json["average"]; |
| 285 | 300 | retval.largest = json["largest"]; |
| 301 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 286 | 302 | retval.non_null = json["non_null"]; |
| 303 | + if (!intp(json["null"])) error("Expected integer"); | |
| 287 | 304 | retval.null = json["null"]; |
| 288 | 305 | retval.smallest = json["smallest"]; |
| 289 | 306 | retval.sum = json["sum"]; |
| @@ -309,6 +326,7 @@ class Top { | ||
| 309 | 326 | Top Top_from_JSON(mixed json) { |
| 310 | 327 | Top retval = Top(); |
| 311 | 328 | |
| 329 | + if (!intp(json["count"])) error("Expected integer"); | |
| 312 | 330 | retval.count = json["count"]; |
| 313 | 331 | retval.item = json["item"]; |
| 314 | 332 | |
| @@ -688,6 +706,7 @@ class TableColumnId { | ||
| 688 | 706 | TableColumnId TableColumnId_from_JSON(mixed json) { |
| 689 | 707 | TableColumnId retval = TableColumnId(); |
| 690 | 708 | |
| 709 | + if (!intp(json["703610"])) error("Expected integer"); | |
| 691 | 710 | retval.the_703610 = json["703610"]; |
| 692 | 711 | |
| 693 | 712 | return retval; |
| @@ -712,6 +731,7 @@ FilterConditionMetadata FilterConditionMetadata_from_JSON(mixed json) { | ||
| 712 | 731 | |
| 713 | 732 | if (json["advanced"] != Standards.JSON.true && json["advanced"] != Standards.JSON.false) error("Expected bool"); |
| 714 | 733 | retval.advanced = json["advanced"]; |
| 734 | + if (!intp(json["unifiedVersion"])) error("Expected integer"); | |
| 715 | 735 | retval.unified_version = json["unifiedVersion"]; |
| 716 | 736 | |
| 717 | 737 | return retval; |
| @@ -906,6 +926,7 @@ class Expression { | ||
| 906 | 926 | Expression Expression_from_JSON(mixed json) { |
| 907 | 927 | Expression retval = Expression(); |
| 908 | 928 | |
| 929 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 909 | 930 | retval.column_id = json["columnId"]; |
| 910 | 931 | retval.type = json["type"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/fd329.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -81,6 +81,7 @@ Description Description_from_JSON(mixed json) { | ||
| 81 | 81 | Description retval = Description(); |
| 82 | 82 | |
| 83 | 83 | retval.base_period = json["base_period"]; |
| 84 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 84 | 85 | retval.missing = json["missing"]; |
| 85 | 86 | retval.title = json["title"]; |
| 86 | 87 | retval.units = json["units"]; |
Test case
1 generated file · +55 −0test/inputs/json/priority/bug427.json
Mpikedefault / TopLevel.pmod+55 −0
| @@ -41,7 +41,9 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 41 | 41 | GetSignatureFlags_from_JSON(json["flags"]); |
| 42 | 42 | retval.flags = json["flags"]; |
| 43 | 43 | retval.groups = json["groups"]; |
| 44 | + if (!intp(json["id"])) error("Expected integer"); | |
| 44 | 45 | retval.id = json["id"]; |
| 46 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 45 | 47 | retval.kind = json["kind"]; |
| 46 | 48 | retval.name = json["name"]; |
| 47 | 49 | |
| @@ -87,7 +89,9 @@ TopLevelChild TopLevelChild_from_JSON(mixed json) { | ||
| 87 | 89 | PurpleFlags_from_JSON(json["flags"]); |
| 88 | 90 | retval.flags = json["flags"]; |
| 89 | 91 | retval.groups = json["groups"]; |
| 92 | + if (!intp(json["id"])) error("Expected integer"); | |
| 90 | 93 | retval.id = json["id"]; |
| 94 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 91 | 95 | retval.kind = json["kind"]; |
| 92 | 96 | retval.kind_string = TentacledKindString_from_JSON(json["kindString"]); |
| 93 | 97 | retval.name = json["name"]; |
| @@ -153,9 +157,11 @@ PurpleChild PurpleChild_from_JSON(mixed json) { | ||
| 153 | 157 | IndecentFlags_from_JSON(json["flags"]); |
| 154 | 158 | retval.flags = json["flags"]; |
| 155 | 159 | retval.groups = json["groups"]; |
| 160 | + if (!intp(json["id"])) error("Expected integer"); | |
| 156 | 161 | retval.id = json["id"]; |
| 157 | 162 | retval.implemented_by = json["implementedBy"]; |
| 158 | 163 | retval.implemented_types = json["implementedTypes"]; |
| 164 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 159 | 165 | retval.kind = json["kind"]; |
| 160 | 166 | retval.kind_string = FluffyKindString_from_JSON(json["kindString"]); |
| 161 | 167 | retval.name = json["name"]; |
| @@ -224,11 +230,13 @@ FluffyChild FluffyChild_from_JSON(mixed json) { | ||
| 224 | 230 | if (has_index(json, "getSignature") && json["getSignature"] != Val.null) GetSignature_from_JSON(json["getSignature"]); |
| 225 | 231 | retval.get_signature = json["getSignature"]; |
| 226 | 232 | retval.groups = json["groups"]; |
| 233 | + if (!intp(json["id"])) error("Expected integer"); | |
| 227 | 234 | retval.id = json["id"]; |
| 228 | 235 | if (has_index(json, "implementationOf") && json["implementationOf"] != Val.null) ExtendedBy_from_JSON(json["implementationOf"]); |
| 229 | 236 | retval.implementation_of = json["implementationOf"]; |
| 230 | 237 | if (has_index(json, "inheritedFrom") && json["inheritedFrom"] != Val.null) ExtendedBy_from_JSON(json["inheritedFrom"]); |
| 231 | 238 | retval.inherited_from = json["inheritedFrom"]; |
| 239 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 232 | 240 | retval.kind = json["kind"]; |
| 233 | 241 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 234 | 242 | retval.name = json["name"]; |
| @@ -282,7 +290,9 @@ TentacledChild TentacledChild_from_JSON(mixed json) { | ||
| 282 | 290 | retval.default_value = json["defaultValue"]; |
| 283 | 291 | PurpleFlags_from_JSON(json["flags"]); |
| 284 | 292 | retval.flags = json["flags"]; |
| 293 | + if (!intp(json["id"])) error("Expected integer"); | |
| 285 | 294 | retval.id = json["id"]; |
| 295 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 286 | 296 | retval.kind = json["kind"]; |
| 287 | 297 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 288 | 298 | retval.name = json["name"]; |
| @@ -383,7 +393,9 @@ PurpleSignature PurpleSignature_from_JSON(mixed json) { | ||
| 383 | 393 | retval.comment = json["comment"]; |
| 384 | 394 | GetSignatureFlags_from_JSON(json["flags"]); |
| 385 | 395 | retval.flags = json["flags"]; |
| 396 | + if (!intp(json["id"])) error("Expected integer"); | |
| 386 | 397 | retval.id = json["id"]; |
| 398 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 387 | 399 | retval.kind = json["kind"]; |
| 388 | 400 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 389 | 401 | retval.name = json["name"]; |
| @@ -479,7 +491,9 @@ IndexSignatureElement IndexSignatureElement_from_JSON(mixed json) { | ||
| 479 | 491 | |
| 480 | 492 | GetSignatureFlags_from_JSON(json["flags"]); |
| 481 | 493 | retval.flags = json["flags"]; |
| 494 | + if (!intp(json["id"])) error("Expected integer"); | |
| 482 | 495 | retval.id = json["id"]; |
| 496 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 483 | 497 | retval.kind = json["kind"]; |
| 484 | 498 | retval.kind_string = json["kindString"]; |
| 485 | 499 | retval.name = json["name"]; |
| @@ -550,7 +564,9 @@ GetSignatureChild GetSignatureChild_from_JSON(mixed json) { | ||
| 550 | 564 | retval.comment = json["comment"]; |
| 551 | 565 | FluffyFlags_from_JSON(json["flags"]); |
| 552 | 566 | retval.flags = json["flags"]; |
| 567 | + if (!intp(json["id"])) error("Expected integer"); | |
| 553 | 568 | retval.id = json["id"]; |
| 569 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 554 | 570 | retval.kind = json["kind"]; |
| 555 | 571 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 556 | 572 | retval.name = json["name"]; |
| @@ -609,7 +625,9 @@ GetSignature GetSignature_from_JSON(mixed json) { | ||
| 609 | 625 | GetSignatureFlags_from_JSON(json["flags"]); |
| 610 | 626 | retval.flags = json["flags"]; |
| 611 | 627 | retval.groups = json["groups"]; |
| 628 | + if (!intp(json["id"])) error("Expected integer"); | |
| 612 | 629 | retval.id = json["id"]; |
| 630 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 613 | 631 | retval.kind = json["kind"]; |
| 614 | 632 | retval.kind_string = json["kindString"]; |
| 615 | 633 | retval.name = json["name"]; |
| @@ -736,8 +754,10 @@ class Source { | ||
| 736 | 754 | Source Source_from_JSON(mixed json) { |
| 737 | 755 | Source retval = Source(); |
| 738 | 756 | |
| 757 | + if (!intp(json["character"])) error("Expected integer"); | |
| 739 | 758 | retval.character = json["character"]; |
| 740 | 759 | retval.file_name = FileName_from_JSON(json["fileName"]); |
| 760 | + if (!intp(json["line"])) error("Expected integer"); | |
| 741 | 761 | retval.line = json["line"]; |
| 742 | 762 | |
| 743 | 763 | return retval; |
| @@ -809,6 +829,7 @@ Group Group_from_JSON(mixed json) { | ||
| 809 | 829 | Group retval = Group(); |
| 810 | 830 | |
| 811 | 831 | retval.children = json["children"]; |
| 832 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 812 | 833 | retval.kind = json["kind"]; |
| 813 | 834 | retval.title = json["title"]; |
| 814 | 835 | |
| @@ -846,7 +867,9 @@ GetSignatureParameter GetSignatureParameter_from_JSON(mixed json) { | ||
| 846 | 867 | retval.comment = json["comment"]; |
| 847 | 868 | TentacledFlags_from_JSON(json["flags"]); |
| 848 | 869 | retval.flags = json["flags"]; |
| 870 | + if (!intp(json["id"])) error("Expected integer"); | |
| 849 | 871 | retval.id = json["id"]; |
| 872 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 850 | 873 | retval.kind = json["kind"]; |
| 851 | 874 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 852 | 875 | retval.name = json["name"]; |
| @@ -998,7 +1021,9 @@ PurpleDeclaration PurpleDeclaration_from_JSON(mixed json) { | ||
| 998 | 1021 | GetSignatureFlags_from_JSON(json["flags"]); |
| 999 | 1022 | retval.flags = json["flags"]; |
| 1000 | 1023 | retval.groups = json["groups"]; |
| 1024 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1001 | 1025 | retval.id = json["id"]; |
| 1026 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1002 | 1027 | retval.kind = json["kind"]; |
| 1003 | 1028 | retval.kind_string = json["kindString"]; |
| 1004 | 1029 | retval.name = json["name"]; |
| @@ -1204,11 +1229,13 @@ FluffySignature FluffySignature_from_JSON(mixed json) { | ||
| 1204 | 1229 | retval.comment = json["comment"]; |
| 1205 | 1230 | IndigoFlags_from_JSON(json["flags"]); |
| 1206 | 1231 | retval.flags = json["flags"]; |
| 1232 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1207 | 1233 | retval.id = json["id"]; |
| 1208 | 1234 | if (has_index(json, "implementationOf") && json["implementationOf"] != Val.null) ExtendedBy_from_JSON(json["implementationOf"]); |
| 1209 | 1235 | retval.implementation_of = json["implementationOf"]; |
| 1210 | 1236 | if (has_index(json, "inheritedFrom") && json["inheritedFrom"] != Val.null) ExtendedBy_from_JSON(json["inheritedFrom"]); |
| 1211 | 1237 | retval.inherited_from = json["inheritedFrom"]; |
| 1238 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1212 | 1239 | retval.kind = json["kind"]; |
| 1213 | 1240 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1214 | 1241 | retval.name = json["name"]; |
| @@ -1276,7 +1303,9 @@ PurpleParameter PurpleParameter_from_JSON(mixed json) { | ||
| 1276 | 1303 | retval.comment = json["comment"]; |
| 1277 | 1304 | GetSignatureFlags_from_JSON(json["flags"]); |
| 1278 | 1305 | retval.flags = json["flags"]; |
| 1306 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1279 | 1307 | retval.id = json["id"]; |
| 1308 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1280 | 1309 | retval.kind = json["kind"]; |
| 1281 | 1310 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 1282 | 1311 | retval.name = json["name"]; |
| @@ -1414,9 +1443,11 @@ FluffyDeclaration FluffyDeclaration_from_JSON(mixed json) { | ||
| 1414 | 1443 | GetSignatureFlags_from_JSON(json["flags"]); |
| 1415 | 1444 | retval.flags = json["flags"]; |
| 1416 | 1445 | retval.groups = json["groups"]; |
| 1446 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1417 | 1447 | retval.id = json["id"]; |
| 1418 | 1448 | if (has_index(json, "indexSignature") && json["indexSignature"] != Val.null) IndexSignature_from_JSON(json["indexSignature"]); |
| 1419 | 1449 | retval.index_signature = json["indexSignature"]; |
| 1450 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1420 | 1451 | retval.kind = json["kind"]; |
| 1421 | 1452 | retval.kind_string = json["kindString"]; |
| 1422 | 1453 | retval.name = json["name"]; |
| @@ -1459,7 +1490,9 @@ StickyChild StickyChild_from_JSON(mixed json) { | ||
| 1459 | 1490 | retval.comment = json["comment"]; |
| 1460 | 1491 | FluffyFlags_from_JSON(json["flags"]); |
| 1461 | 1492 | retval.flags = json["flags"]; |
| 1493 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1462 | 1494 | retval.id = json["id"]; |
| 1495 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1463 | 1496 | retval.kind = json["kind"]; |
| 1464 | 1497 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 1465 | 1498 | retval.name = json["name"]; |
| @@ -1529,7 +1562,9 @@ IndexSignature IndexSignature_from_JSON(mixed json) { | ||
| 1529 | 1562 | |
| 1530 | 1563 | GetSignatureFlags_from_JSON(json["flags"]); |
| 1531 | 1564 | retval.flags = json["flags"]; |
| 1565 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1532 | 1566 | retval.id = json["id"]; |
| 1567 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1533 | 1568 | retval.kind = json["kind"]; |
| 1534 | 1569 | retval.kind_string = json["kindString"]; |
| 1535 | 1570 | retval.name = json["name"]; |
| @@ -1597,7 +1632,9 @@ TentacledSignature TentacledSignature_from_JSON(mixed json) { | ||
| 1597 | 1632 | retval.comment = json["comment"]; |
| 1598 | 1633 | GetSignatureFlags_from_JSON(json["flags"]); |
| 1599 | 1634 | retval.flags = json["flags"]; |
| 1635 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1600 | 1636 | retval.id = json["id"]; |
| 1637 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1601 | 1638 | retval.kind = json["kind"]; |
| 1602 | 1639 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1603 | 1640 | retval.name = json["name"]; |
| @@ -1664,7 +1701,9 @@ FluffyParameter FluffyParameter_from_JSON(mixed json) { | ||
| 1664 | 1701 | retval.comment = json["comment"]; |
| 1665 | 1702 | FluffyFlags_from_JSON(json["flags"]); |
| 1666 | 1703 | retval.flags = json["flags"]; |
| 1704 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1667 | 1705 | retval.id = json["id"]; |
| 1706 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1668 | 1707 | retval.kind = json["kind"]; |
| 1669 | 1708 | retval.kind_string = json["kindString"]; |
| 1670 | 1709 | retval.name = json["name"]; |
| @@ -1790,7 +1829,9 @@ StickySignature StickySignature_from_JSON(mixed json) { | ||
| 1790 | 1829 | retval.comment = json["comment"]; |
| 1791 | 1830 | IndigoFlags_from_JSON(json["flags"]); |
| 1792 | 1831 | retval.flags = json["flags"]; |
| 1832 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1793 | 1833 | retval.id = json["id"]; |
| 1834 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1794 | 1835 | retval.kind = json["kind"]; |
| 1795 | 1836 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1796 | 1837 | retval.name = json["name"]; |
| @@ -1838,7 +1879,9 @@ TentacledParameter TentacledParameter_from_JSON(mixed json) { | ||
| 1838 | 1879 | retval.default_value = json["defaultValue"]; |
| 1839 | 1880 | TentacledFlags_from_JSON(json["flags"]); |
| 1840 | 1881 | retval.flags = json["flags"]; |
| 1882 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1841 | 1883 | retval.id = json["id"]; |
| 1884 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1842 | 1885 | retval.kind = json["kind"]; |
| 1843 | 1886 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 1844 | 1887 | retval.name = json["name"]; |
| @@ -1923,9 +1966,11 @@ TentacledDeclaration TentacledDeclaration_from_JSON(mixed json) { | ||
| 1923 | 1966 | GetSignatureFlags_from_JSON(json["flags"]); |
| 1924 | 1967 | retval.flags = json["flags"]; |
| 1925 | 1968 | retval.groups = json["groups"]; |
| 1969 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1926 | 1970 | retval.id = json["id"]; |
| 1927 | 1971 | if (has_index(json, "indexSignature") && json["indexSignature"] != Val.null) IndexSignatureElement_from_JSON(json["indexSignature"]); |
| 1928 | 1972 | retval.index_signature = json["indexSignature"]; |
| 1973 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1929 | 1974 | retval.kind = json["kind"]; |
| 1930 | 1975 | retval.kind_string = json["kindString"]; |
| 1931 | 1976 | retval.name = json["name"]; |
| @@ -1971,7 +2016,9 @@ IndigoChild IndigoChild_from_JSON(mixed json) { | ||
| 1971 | 2016 | retval.default_value = json["defaultValue"]; |
| 1972 | 2017 | FluffyFlags_from_JSON(json["flags"]); |
| 1973 | 2018 | retval.flags = json["flags"]; |
| 2019 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1974 | 2020 | retval.id = json["id"]; |
| 2021 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1975 | 2022 | retval.kind = json["kind"]; |
| 1976 | 2023 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 1977 | 2024 | retval.name = json["name"]; |
| @@ -2096,7 +2143,9 @@ StickyDeclaration StickyDeclaration_from_JSON(mixed json) { | ||
| 2096 | 2143 | GetSignatureFlags_from_JSON(json["flags"]); |
| 2097 | 2144 | retval.flags = json["flags"]; |
| 2098 | 2145 | retval.groups = json["groups"]; |
| 2146 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2099 | 2147 | retval.id = json["id"]; |
| 2148 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2100 | 2149 | retval.kind = json["kind"]; |
| 2101 | 2150 | retval.kind_string = json["kindString"]; |
| 2102 | 2151 | retval.name = json["name"]; |
| @@ -2135,7 +2184,9 @@ IndecentChild IndecentChild_from_JSON(mixed json) { | ||
| 2135 | 2184 | |
| 2136 | 2185 | FluffyFlags_from_JSON(json["flags"]); |
| 2137 | 2186 | retval.flags = json["flags"]; |
| 2187 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2138 | 2188 | retval.id = json["id"]; |
| 2189 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2139 | 2190 | retval.kind = json["kind"]; |
| 2140 | 2191 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 2141 | 2192 | retval.name = json["name"]; |
| @@ -2208,7 +2259,9 @@ IndigoDeclaration IndigoDeclaration_from_JSON(mixed json) { | ||
| 2208 | 2259 | GetSignatureFlags_from_JSON(json["flags"]); |
| 2209 | 2260 | retval.flags = json["flags"]; |
| 2210 | 2261 | retval.groups = json["groups"]; |
| 2262 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2211 | 2263 | retval.id = json["id"]; |
| 2264 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2212 | 2265 | retval.kind = json["kind"]; |
| 2213 | 2266 | retval.kind_string = json["kindString"]; |
| 2214 | 2267 | retval.name = json["name"]; |
| @@ -2272,7 +2325,9 @@ TypeParameter TypeParameter_from_JSON(mixed json) { | ||
| 2272 | 2325 | retval.comment = json["comment"]; |
| 2273 | 2326 | GetSignatureFlags_from_JSON(json["flags"]); |
| 2274 | 2327 | retval.flags = json["flags"]; |
| 2328 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2275 | 2329 | retval.id = json["id"]; |
| 2330 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2276 | 2331 | retval.kind = json["kind"]; |
| 2277 | 2332 | retval.kind_string = json["kindString"]; |
| 2278 | 2333 | retval.name = json["name"]; |
Test case
1 generated file · +5 −0test/inputs/json/priority/bug790.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -42,13 +42,18 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 42 | 42 | TopLevel retval = TopLevel(); |
| 43 | 43 | |
| 44 | 44 | retval.children_data = json["children_data"]; |
| 45 | + if (!intp(json["id"])) error("Expected integer"); | |
| 45 | 46 | retval.id = json["id"]; |
| 46 | 47 | if (json["is_active"] != Standards.JSON.true && json["is_active"] != Standards.JSON.false) error("Expected bool"); |
| 47 | 48 | retval.is_active = json["is_active"]; |
| 49 | + if (!intp(json["level"])) error("Expected integer"); | |
| 48 | 50 | retval.level = json["level"]; |
| 49 | 51 | retval.name = json["name"]; |
| 52 | + if (!intp(json["parent_id"])) error("Expected integer"); | |
| 50 | 53 | retval.parent_id = json["parent_id"]; |
| 54 | + if (!intp(json["position"])) error("Expected integer"); | |
| 51 | 55 | retval.position = json["position"]; |
| 56 | + if (!intp(json["product_count"])) error("Expected integer"); | |
| 52 | 57 | retval.product_count = json["product_count"]; |
| 53 | 58 | |
| 54 | 59 | return retval; |
Test case
1 generated file · +2 −0test/inputs/json/priority/bug855-short.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -48,7 +48,9 @@ TopLevelValue TopLevelValue_from_JSON(mixed json) { | ||
| 48 | 48 | retval.channel_id = json["channel_id"]; |
| 49 | 49 | retval.channel_name = json["channel_name"]; |
| 50 | 50 | retval.code = json["code"]; |
| 51 | + if (!intp(json["emoticon_set"])) error("Expected integer"); | |
| 51 | 52 | retval.emoticon_set = json["emoticon_set"]; |
| 53 | + if (!intp(json["id"])) error("Expected integer"); | |
| 52 | 54 | retval.id = json["id"]; |
| 53 | 55 | |
| 54 | 56 | return retval; |
Test case
1 generated file · +35 −0test/inputs/json/priority/bug863.json
Mpikedefault / TopLevel.pmod+35 −0
| @@ -71,20 +71,27 @@ class PurpleTopLevel { | ||
| 71 | 71 | PurpleTopLevel PurpleTopLevel_from_JSON(mixed json) { |
| 72 | 72 | PurpleTopLevel retval = PurpleTopLevel(); |
| 73 | 73 | |
| 74 | + if (!intp(json["ALIENLEVEL"])) error("Expected integer"); | |
| 74 | 75 | retval.alienlevel = json["ALIENLEVEL"]; |
| 75 | 76 | retval.breed = Breed_from_JSON(json["BREED"]); |
| 77 | + if (!intp(json["CHAR_DIMENSION"])) error("Expected integer"); | |
| 76 | 78 | retval.char_dimension = json["CHAR_DIMENSION"]; |
| 79 | + if (!intp(json["CHAR_INSTANCE"])) error("Expected integer"); | |
| 77 | 80 | retval.char_instance = json["CHAR_INSTANCE"]; |
| 78 | 81 | retval.defender_rank_title = json["DEFENDER_RANK_TITLE"]; |
| 79 | 82 | retval.firstname = Firstname_from_JSON(json["FIRSTNAME"]); |
| 83 | + if (!intp(json["HEADID"])) error("Expected integer"); | |
| 80 | 84 | retval.headid = json["HEADID"]; |
| 81 | 85 | retval.lastname = Lastname_from_JSON(json["LASTNAME"]); |
| 86 | + if (!intp(json["LEVELX"])) error("Expected integer"); | |
| 82 | 87 | retval.levelx = json["LEVELX"]; |
| 83 | 88 | retval.name = json["NAME"]; |
| 84 | 89 | retval.prof = json["PROF"]; |
| 85 | 90 | retval.prof_title = json["PROF_TITLE"]; |
| 91 | + if (!intp(json["PVPRATING"])) error("Expected integer"); | |
| 86 | 92 | retval.pvprating = json["PVPRATING"]; |
| 87 | 93 | retval.pvptitle = Pvptitle_from_JSON(json["PVPTITLE"]); |
| 94 | + if (!intp(json["RANK"])) error("Expected integer"); | |
| 88 | 95 | retval.rank = json["RANK"]; |
| 89 | 96 | retval.rank_title = RankTitle_from_JSON(json["RANK_TITLE"]); |
| 90 | 97 | retval.sex = Sex_from_JSON(json["SEX"]); |
| @@ -233,40 +240,68 @@ class FluffyTopLevel { | ||
| 233 | 240 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 234 | 241 | FluffyTopLevel retval = FluffyTopLevel(); |
| 235 | 242 | |
| 243 | + if (!intp(json["ADVENTURERCOUNT"])) error("Expected integer"); | |
| 236 | 244 | retval.adventurercount = json["ADVENTURERCOUNT"]; |
| 245 | + if (!intp(json["AGENTCOUNT"])) error("Expected integer"); | |
| 237 | 246 | retval.agentcount = json["AGENTCOUNT"]; |
| 247 | + if (!intp(json["ATROXCOUNT"])) error("Expected integer"); | |
| 238 | 248 | retval.atroxcount = json["ATROXCOUNT"]; |
| 239 | 249 | retval.avglvl = (float)json["AVGLVL"]; |
| 250 | + if (!intp(json["BTCOUNT"])) error("Expected integer"); | |
| 240 | 251 | retval.btcount = json["BTCOUNT"]; |
| 241 | 252 | retval.description = json["DESCRIPTION"]; |
| 253 | + if (!intp(json["DOCTORCOUNT"])) error("Expected integer"); | |
| 242 | 254 | retval.doctorcount = json["DOCTORCOUNT"]; |
| 255 | + if (!intp(json["ENFCOUNT"])) error("Expected integer"); | |
| 243 | 256 | retval.enfcount = json["ENFCOUNT"]; |
| 257 | + if (!intp(json["ENGINEEERCOUNT"])) error("Expected integer"); | |
| 244 | 258 | retval.engineeercount = json["ENGINEEERCOUNT"]; |
| 259 | + if (!intp(json["FEMALECOUNT"])) error("Expected integer"); | |
| 245 | 260 | retval.femalecount = json["FEMALECOUNT"]; |
| 261 | + if (!intp(json["FIXERCOUNT"])) error("Expected integer"); | |
| 246 | 262 | retval.fixercount = json["FIXERCOUNT"]; |
| 247 | 263 | retval.governingname = json["GOVERNINGNAME"]; |
| 248 | 264 | retval.history = json["HISTORY"]; |
| 265 | + if (!intp(json["KEEPERCOUNT"])) error("Expected integer"); | |
| 249 | 266 | retval.keepercount = json["KEEPERCOUNT"]; |
| 267 | + if (!intp(json["MACOUNT"])) error("Expected integer"); | |
| 250 | 268 | retval.macount = json["MACOUNT"]; |
| 269 | + if (!intp(json["MALECOUNT"])) error("Expected integer"); | |
| 251 | 270 | retval.malecount = json["MALECOUNT"]; |
| 271 | + if (!intp(json["MAXLVL"])) error("Expected integer"); | |
| 252 | 272 | retval.maxlvl = json["MAXLVL"]; |
| 273 | + if (!intp(json["METACOUNT"])) error("Expected integer"); | |
| 253 | 274 | retval.metacount = json["METACOUNT"]; |
| 275 | + if (!intp(json["MINLVL"])) error("Expected integer"); | |
| 254 | 276 | retval.minlvl = json["MINLVL"]; |
| 277 | + if (!intp(json["MONSTERCOUNT"])) error("Expected integer"); | |
| 255 | 278 | retval.monstercount = json["MONSTERCOUNT"]; |
| 256 | 279 | retval.name = json["NAME"]; |
| 280 | + if (!intp(json["NANOCOUNT"])) error("Expected integer"); | |
| 257 | 281 | retval.nanocount = json["NANOCOUNT"]; |
| 282 | + if (!intp(json["NANORACECOUNT"])) error("Expected integer"); | |
| 258 | 283 | retval.nanoracecount = json["NANORACECOUNT"]; |
| 284 | + if (!intp(json["NEUTERCOUNT"])) error("Expected integer"); | |
| 259 | 285 | retval.neutercount = json["NEUTERCOUNT"]; |
| 286 | + if (!intp(json["NUMMEMBERS"])) error("Expected integer"); | |
| 260 | 287 | retval.nummembers = json["NUMMEMBERS"]; |
| 261 | 288 | retval.objective = json["OBJECTIVE"]; |
| 289 | + if (!intp(json["OPIFEXCOUNT"])) error("Expected integer"); | |
| 262 | 290 | retval.opifexcount = json["OPIFEXCOUNT"]; |
| 291 | + if (!intp(json["ORG_DIMENSION"])) error("Expected integer"); | |
| 263 | 292 | retval.org_dimension = json["ORG_DIMENSION"]; |
| 293 | + if (!intp(json["ORG_INSTANCE"])) error("Expected integer"); | |
| 264 | 294 | retval.org_instance = json["ORG_INSTANCE"]; |
| 295 | + if (!intp(json["SHADECOUNT"])) error("Expected integer"); | |
| 265 | 296 | retval.shadecount = json["SHADECOUNT"]; |
| 297 | + if (!intp(json["SIDE"])) error("Expected integer"); | |
| 266 | 298 | retval.side = json["SIDE"]; |
| 267 | 299 | retval.side_name = json["SIDE_NAME"]; |
| 300 | + if (!intp(json["SOLIDERCOUNT"])) error("Expected integer"); | |
| 268 | 301 | retval.solidercount = json["SOLIDERCOUNT"]; |
| 302 | + if (!intp(json["SOLITUSCOUNT"])) error("Expected integer"); | |
| 269 | 303 | retval.solituscount = json["SOLITUSCOUNT"]; |
| 304 | + if (!intp(json["TRADERCOUNT"])) error("Expected integer"); | |
| 270 | 305 | retval.tradercount = json["TRADERCOUNT"]; |
| 271 | 306 | |
| 272 | 307 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/priority/coin-pairs.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -30,6 +30,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 30 | 30 | TopLevel retval = TopLevel(); |
| 31 | 31 | |
| 32 | 32 | retval.pairs = json["pairs"]; |
| 33 | + if (!intp(json["server_time"])) error("Expected integer"); | |
| 33 | 34 | retval.server_time = json["server_time"]; |
| 34 | 35 | |
| 35 | 36 | return retval; |
| @@ -64,10 +65,14 @@ class Pair { | ||
| 64 | 65 | Pair Pair_from_JSON(mixed json) { |
| 65 | 66 | Pair retval = Pair(); |
| 66 | 67 | |
| 68 | + if (!intp(json["decimal_places"])) error("Expected integer"); | |
| 67 | 69 | retval.decimal_places = json["decimal_places"]; |
| 68 | 70 | retval.fee = (float)json["fee"]; |
| 71 | + if (!intp(json["hidden"])) error("Expected integer"); | |
| 69 | 72 | retval.hidden = json["hidden"]; |
| 73 | + if (!intp(json["max_amount"])) error("Expected integer"); | |
| 70 | 74 | retval.max_amount = json["max_amount"]; |
| 75 | + if (!intp(json["max_price"])) error("Expected integer"); | |
| 71 | 76 | retval.max_price = json["max_price"]; |
| 72 | 77 | retval.min_amount = (float)json["min_amount"]; |
| 73 | 78 | retval.min_price = (float)json["min_price"]; |
Test case
1 generated file · +3 −0test/inputs/json/priority/combinations1.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -115,6 +115,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 115 | 115 | retval.cerograph = json["cerograph"]; |
| 116 | 116 | retval.chemotherapeutics = json["chemotherapeutics"]; |
| 117 | 117 | retval.cimelia = json["cimelia"]; |
| 118 | + if (!intp(json["citrated"])) error("Expected integer"); | |
| 118 | 119 | retval.citrated = json["citrated"]; |
| 119 | 120 | retval.clinodome = json["clinodome"]; |
| 120 | 121 | retval.coadjust = json["coadjust"]; |
| @@ -371,6 +372,7 @@ CimeliaClass CimeliaClass_from_JSON(mixed json) { | ||
| 371 | 372 | CimeliaClass retval = CimeliaClass(); |
| 372 | 373 | |
| 373 | 374 | retval.catharticalness = (float)json["catharticalness"]; |
| 375 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 374 | 376 | retval.chirotherium = json["Chirotherium"]; |
| 375 | 377 | retval.disdiapason = json["disdiapason"]; |
| 376 | 378 | if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool"); |
| @@ -1304,6 +1306,7 @@ Interacinar Interacinar_from_JSON(mixed json) { | ||
| 1304 | 1306 | if (json["benefactorship"] != Standards.JSON.true && json["benefactorship"] != Standards.JSON.false) error("Expected bool"); |
| 1305 | 1307 | retval.benefactorship = json["benefactorship"]; |
| 1306 | 1308 | retval.triseriatim = json["triseriatim"]; |
| 1309 | + if (!intp(json["tubbing"])) error("Expected integer"); | |
| 1307 | 1310 | retval.tubbing = json["tubbing"]; |
| 1308 | 1311 | retval.untrimmed = json["untrimmed"]; |
Test case
1 generated file · +1 −0test/inputs/json/priority/combinations2.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -309,6 +309,7 @@ Rebecca Rebecca_from_JSON(mixed json) { | ||
| 309 | 309 | Rebecca retval = Rebecca(); |
| 310 | 310 | |
| 311 | 311 | retval.catharticalness = (float)json["catharticalness"]; |
| 312 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 312 | 313 | retval.chirotherium = json["Chirotherium"]; |
| 313 | 314 | retval.disdiapason = json["disdiapason"]; |
| 314 | 315 | if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool"); |
Test case
1 generated file · +2 −0test/inputs/json/priority/combinations3.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -696,6 +696,7 @@ MonaziteClass MonaziteClass_from_JSON(mixed json) { | ||
| 696 | 696 | MonaziteClass retval = MonaziteClass(); |
| 697 | 697 | |
| 698 | 698 | retval.catharticalness = (float)json["catharticalness"]; |
| 699 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 699 | 700 | retval.chirotherium = json["Chirotherium"]; |
| 700 | 701 | retval.disdiapason = json["disdiapason"]; |
| 701 | 702 | if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool"); |
| @@ -864,6 +865,7 @@ Noncontributing Noncontributing_from_JSON(mixed json) { | ||
| 864 | 865 | |
| 865 | 866 | retval.estevin = json["estevin"]; |
| 866 | 867 | retval.jolterhead = (float)json["jolterhead"]; |
| 868 | + if (!intp(json["sauternes"])) error("Expected integer"); | |
| 867 | 869 | retval.sauternes = json["sauternes"]; |
| 868 | 870 | if (json["sparsely"] != Standards.JSON.true && json["sparsely"] != Standards.JSON.false) error("Expected bool"); |
| 869 | 871 | retval.sparsely = json["sparsely"]; |
Test case
1 generated file · +1 −0test/inputs/json/priority/combinations4.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -388,6 +388,7 @@ QuebrachineClass QuebrachineClass_from_JSON(mixed json) { | ||
| 388 | 388 | QuebrachineClass retval = QuebrachineClass(); |
| 389 | 389 | |
| 390 | 390 | retval.catharticalness = (float)json["catharticalness"]; |
| 391 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 391 | 392 | retval.chirotherium = json["Chirotherium"]; |
| 392 | 393 | retval.disdiapason = json["disdiapason"]; |
| 393 | 394 | if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool"); |
Test case
1 generated file · +1 −0test/inputs/json/priority/direct-recursive.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -39,6 +39,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 39 | 39 | retval.also = json["also"]; |
| 40 | 40 | if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool"); |
| 41 | 41 | retval.bar = json["bar"]; |
| 42 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 42 | 43 | retval.foo = json["foo"]; |
| 43 | 44 | retval.moo = (float)json["moo"]; |
| 44 | 45 | retval.quux = json["quux"]; |
Test case
1 generated file · +8 −0test/inputs/json/priority/identifiers.json
Mpikedefault / TopLevel.pmod+8 −0
| @@ -45,6 +45,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 45 | 45 | retval.foo = json["foo"]; |
| 46 | 46 | ThisIsAToughOne_from_JSON(json["ThisIsA\U0001f61cTough\"\n\nOne"]); |
| 47 | 47 | retval.this_is_a_tough_one = json["ThisIsA\U0001f61cTough\"\n\nOne"]; |
| 48 | + if (!intp(json["!"])) error("Expected integer"); | |
| 48 | 49 | retval.top_level = json["!"]; |
| 49 | 50 | EmptyClass_from_JSON(json["Empty"]); |
| 50 | 51 | retval.top_level_empty = json["Empty"]; |
| @@ -67,6 +68,7 @@ class TopLevelBla { | ||
| 67 | 68 | TopLevelBla TopLevelBla_from_JSON(mixed json) { |
| 68 | 69 | TopLevelBla retval = TopLevelBla(); |
| 69 | 70 | |
| 71 | + if (!intp(json["bar"])) error("Expected integer"); | |
| 70 | 72 | retval.bar = json["bar"]; |
| 71 | 73 | |
| 72 | 74 | return retval; |
| @@ -87,6 +89,7 @@ class Empty { | ||
| 87 | 89 | Empty Empty_from_JSON(mixed json) { |
| 88 | 90 | Empty retval = Empty(); |
| 89 | 91 | |
| 92 | + if (!intp(json["x"])) error("Expected integer"); | |
| 90 | 93 | retval.x = json["x"]; |
| 91 | 94 | |
| 92 | 95 | return retval; |
| @@ -113,7 +116,9 @@ Foo Foo_from_JSON(mixed json) { | ||
| 113 | 116 | |
| 114 | 117 | FooBla_from_JSON(json["bla"]); |
| 115 | 118 | retval.bla = json["bla"]; |
| 119 | + if (!intp(json["_"])) error("Expected integer"); | |
| 116 | 120 | retval.empty = json["_"]; |
| 121 | + if (!intp(json["__"])) error("Expected integer"); | |
| 117 | 122 | retval.foo = json["__"]; |
| 118 | 123 | |
| 119 | 124 | return retval; |
| @@ -152,7 +157,9 @@ class ThisIsAToughOne { | ||
| 152 | 157 | ThisIsAToughOne ThisIsAToughOne_from_JSON(mixed json) { |
| 153 | 158 | ThisIsAToughOne retval = ThisIsAToughOne(); |
| 154 | 159 | |
| 160 | + if (!intp(json["\n\n\n"])) error("Expected integer"); | |
| 155 | 161 | retval.empty = json["\n\n\n"]; |
| 162 | + if (!intp(json["\""])) error("Expected integer"); | |
| 156 | 163 | retval.this_is_a_tough_one = json["\""]; |
| 157 | 164 | |
| 158 | 165 | return retval; |
| @@ -173,6 +180,7 @@ class EmptyClass { | ||
| 173 | 180 | EmptyClass EmptyClass_from_JSON(mixed json) { |
| 174 | 181 | EmptyClass retval = EmptyClass(); |
| 175 | 182 | |
| 183 | + if (!intp(json["y"])) error("Expected integer"); | |
| 176 | 184 | retval.y = json["y"]; |
| 177 | 185 | |
| 178 | 186 | return retval; |
Test case
1 generated file · +285 −0test/inputs/json/priority/keywords.json
Mpikedefault / TopLevel.pmod+285 −0
| @@ -37,6 +37,7 @@ class TopLevel { | ||
| 37 | 37 | TopLevel TopLevel_from_JSON(mixed json) { |
| 38 | 38 | TopLevel retval = TopLevel(); |
| 39 | 39 | |
| 40 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 40 | 41 | retval.dummy = json["dummy"]; |
| 41 | 42 | Obj1_from_JSON(json["obj1"]); |
| 42 | 43 | retval.obj1 = json["obj1"]; |
| @@ -299,6 +300,7 @@ Obj1 Obj1_from_JSON(mixed json) { | ||
| 299 | 300 | retval.decltype = json["decltype"]; |
| 300 | 301 | DecodeString_from_JSON(json["decode_string"]); |
| 301 | 302 | retval.decode_string = json["decode_string"]; |
| 303 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 302 | 304 | retval.dummy = json["dummy"]; |
| 303 | 305 | Empty_from_JSON(json["_"]); |
| 304 | 306 | retval.empty = json["_"]; |
| @@ -347,6 +349,7 @@ class Abstract { | ||
| 347 | 349 | Abstract Abstract_from_JSON(mixed json) { |
| 348 | 350 | Abstract retval = Abstract(); |
| 349 | 351 | |
| 352 | + if (!intp(json["abstract"])) error("Expected integer"); | |
| 350 | 353 | retval.abstract = json["abstract"]; |
| 351 | 354 | |
| 352 | 355 | return retval; |
| @@ -367,6 +370,7 @@ class Alignas { | ||
| 367 | 370 | Alignas Alignas_from_JSON(mixed json) { |
| 368 | 371 | Alignas retval = Alignas(); |
| 369 | 372 | |
| 373 | + if (!intp(json["alignas"])) error("Expected integer"); | |
| 370 | 374 | retval.alignas = json["alignas"]; |
| 371 | 375 | |
| 372 | 376 | return retval; |
| @@ -387,6 +391,7 @@ class Alignof { | ||
| 387 | 391 | Alignof Alignof_from_JSON(mixed json) { |
| 388 | 392 | Alignof retval = Alignof(); |
| 389 | 393 | |
| 394 | + if (!intp(json["alignof"])) error("Expected integer"); | |
| 390 | 395 | retval.alignof = json["alignof"]; |
| 391 | 396 | |
| 392 | 397 | return retval; |
| @@ -407,6 +412,7 @@ class And { | ||
| 407 | 412 | And And_from_JSON(mixed json) { |
| 408 | 413 | And retval = And(); |
| 409 | 414 | |
| 415 | + if (!intp(json["and"])) error("Expected integer"); | |
| 410 | 416 | retval.and = json["and"]; |
| 411 | 417 | |
| 412 | 418 | return retval; |
| @@ -427,6 +433,7 @@ class AndEq { | ||
| 427 | 433 | AndEq AndEq_from_JSON(mixed json) { |
| 428 | 434 | AndEq retval = AndEq(); |
| 429 | 435 | |
| 436 | + if (!intp(json["and_eq"])) error("Expected integer"); | |
| 430 | 437 | retval.and_eq = json["and_eq"]; |
| 431 | 438 | |
| 432 | 439 | return retval; |
| @@ -447,6 +454,7 @@ class Any { | ||
| 447 | 454 | Any Any_from_JSON(mixed json) { |
| 448 | 455 | Any retval = Any(); |
| 449 | 456 | |
| 457 | + if (!intp(json["Any"])) error("Expected integer"); | |
| 450 | 458 | retval.any = json["Any"]; |
| 451 | 459 | |
| 452 | 460 | return retval; |
| @@ -467,6 +475,7 @@ class As { | ||
| 467 | 475 | As As_from_JSON(mixed json) { |
| 468 | 476 | As retval = As(); |
| 469 | 477 | |
| 478 | + if (!intp(json["as"])) error("Expected integer"); | |
| 470 | 479 | retval.as = json["as"]; |
| 471 | 480 | |
| 472 | 481 | return retval; |
| @@ -487,6 +496,7 @@ class Asm { | ||
| 487 | 496 | Asm Asm_from_JSON(mixed json) { |
| 488 | 497 | Asm retval = Asm(); |
| 489 | 498 | |
| 499 | + if (!intp(json["asm"])) error("Expected integer"); | |
| 490 | 500 | retval.asm = json["asm"]; |
| 491 | 501 | |
| 492 | 502 | return retval; |
| @@ -507,6 +517,7 @@ class Assert { | ||
| 507 | 517 | Assert Assert_from_JSON(mixed json) { |
| 508 | 518 | Assert retval = Assert(); |
| 509 | 519 | |
| 520 | + if (!intp(json["assert"])) error("Expected integer"); | |
| 510 | 521 | retval.assert = json["assert"]; |
| 511 | 522 | |
| 512 | 523 | return retval; |
| @@ -527,6 +538,7 @@ class Associatedtype { | ||
| 527 | 538 | Associatedtype Associatedtype_from_JSON(mixed json) { |
| 528 | 539 | Associatedtype retval = Associatedtype(); |
| 529 | 540 | |
| 541 | + if (!intp(json["associatedtype"])) error("Expected integer"); | |
| 530 | 542 | retval.associatedtype = json["associatedtype"]; |
| 531 | 543 | |
| 532 | 544 | return retval; |
| @@ -547,6 +559,7 @@ class Associativity { | ||
| 547 | 559 | Associativity Associativity_from_JSON(mixed json) { |
| 548 | 560 | Associativity retval = Associativity(); |
| 549 | 561 | |
| 562 | + if (!intp(json["associativity"])) error("Expected integer"); | |
| 550 | 563 | retval.associativity = json["associativity"]; |
| 551 | 564 | |
| 552 | 565 | return retval; |
| @@ -567,6 +580,7 @@ class Async { | ||
| 567 | 580 | Async Async_from_JSON(mixed json) { |
| 568 | 581 | Async retval = Async(); |
| 569 | 582 | |
| 583 | + if (!intp(json["async"])) error("Expected integer"); | |
| 570 | 584 | retval.async = json["async"]; |
| 571 | 585 | |
| 572 | 586 | return retval; |
| @@ -587,6 +601,7 @@ class Atomic { | ||
| 587 | 601 | Atomic Atomic_from_JSON(mixed json) { |
| 588 | 602 | Atomic retval = Atomic(); |
| 589 | 603 | |
| 604 | + if (!intp(json["atomic"])) error("Expected integer"); | |
| 590 | 605 | retval.atomic = json["atomic"]; |
| 591 | 606 | |
| 592 | 607 | return retval; |
| @@ -607,6 +622,7 @@ class AtomicCancel { | ||
| 607 | 622 | AtomicCancel AtomicCancel_from_JSON(mixed json) { |
| 608 | 623 | AtomicCancel retval = AtomicCancel(); |
| 609 | 624 | |
| 625 | + if (!intp(json["atomic_cancel"])) error("Expected integer"); | |
| 610 | 626 | retval.atomic_cancel = json["atomic_cancel"]; |
| 611 | 627 | |
| 612 | 628 | return retval; |
| @@ -627,6 +643,7 @@ class AtomicCommit { | ||
| 627 | 643 | AtomicCommit AtomicCommit_from_JSON(mixed json) { |
| 628 | 644 | AtomicCommit retval = AtomicCommit(); |
| 629 | 645 | |
| 646 | + if (!intp(json["atomic_commit"])) error("Expected integer"); | |
| 630 | 647 | retval.atomic_commit = json["atomic_commit"]; |
| 631 | 648 | |
| 632 | 649 | return retval; |
| @@ -647,6 +664,7 @@ class AtomicNoexcept { | ||
| 647 | 664 | AtomicNoexcept AtomicNoexcept_from_JSON(mixed json) { |
| 648 | 665 | AtomicNoexcept retval = AtomicNoexcept(); |
| 649 | 666 | |
| 667 | + if (!intp(json["atomic_noexcept"])) error("Expected integer"); | |
| 650 | 668 | retval.atomic_noexcept = json["atomic_noexcept"]; |
| 651 | 669 | |
| 652 | 670 | return retval; |
| @@ -667,6 +685,7 @@ class Await { | ||
| 667 | 685 | Await Await_from_JSON(mixed json) { |
| 668 | 686 | Await retval = Await(); |
| 669 | 687 | |
| 688 | + if (!intp(json["await"])) error("Expected integer"); | |
| 670 | 689 | retval.await = json["await"]; |
| 671 | 690 | |
| 672 | 691 | return retval; |
| @@ -687,6 +706,7 @@ class Base { | ||
| 687 | 706 | Base Base_from_JSON(mixed json) { |
| 688 | 707 | Base retval = Base(); |
| 689 | 708 | |
| 709 | + if (!intp(json["base"])) error("Expected integer"); | |
| 690 | 710 | retval.base = json["base"]; |
| 691 | 711 | |
| 692 | 712 | return retval; |
| @@ -707,6 +727,7 @@ class Bitand { | ||
| 707 | 727 | Bitand Bitand_from_JSON(mixed json) { |
| 708 | 728 | Bitand retval = Bitand(); |
| 709 | 729 | |
| 730 | + if (!intp(json["bitand"])) error("Expected integer"); | |
| 710 | 731 | retval.bitand = json["bitand"]; |
| 711 | 732 | |
| 712 | 733 | return retval; |
| @@ -727,6 +748,7 @@ class Bitor { | ||
| 727 | 748 | Bitor Bitor_from_JSON(mixed json) { |
| 728 | 749 | Bitor retval = Bitor(); |
| 729 | 750 | |
| 751 | + if (!intp(json["bitor"])) error("Expected integer"); | |
| 730 | 752 | retval.bitor = json["bitor"]; |
| 731 | 753 | |
| 732 | 754 | return retval; |
| @@ -747,6 +769,7 @@ class Bool { | ||
| 747 | 769 | Bool Bool_from_JSON(mixed json) { |
| 748 | 770 | Bool retval = Bool(); |
| 749 | 771 | |
| 772 | + if (!intp(json["BOOL"])) error("Expected integer"); | |
| 750 | 773 | retval.bool = json["BOOL"]; |
| 751 | 774 | |
| 752 | 775 | return retval; |
| @@ -767,6 +790,7 @@ class Boolean { | ||
| 767 | 790 | Boolean Boolean_from_JSON(mixed json) { |
| 768 | 791 | Boolean retval = Boolean(); |
| 769 | 792 | |
| 793 | + if (!intp(json["boolean"])) error("Expected integer"); | |
| 770 | 794 | retval.boolean = json["boolean"]; |
| 771 | 795 | |
| 772 | 796 | return retval; |
| @@ -787,6 +811,7 @@ class Bycopy { | ||
| 787 | 811 | Bycopy Bycopy_from_JSON(mixed json) { |
| 788 | 812 | Bycopy retval = Bycopy(); |
| 789 | 813 | |
| 814 | + if (!intp(json["bycopy"])) error("Expected integer"); | |
| 790 | 815 | retval.bycopy = json["bycopy"]; |
| 791 | 816 | |
| 792 | 817 | return retval; |
| @@ -807,6 +832,7 @@ class Byref { | ||
| 807 | 832 | Byref Byref_from_JSON(mixed json) { |
| 808 | 833 | Byref retval = Byref(); |
| 809 | 834 | |
| 835 | + if (!intp(json["byref"])) error("Expected integer"); | |
| 810 | 836 | retval.byref = json["byref"]; |
| 811 | 837 | |
| 812 | 838 | return retval; |
| @@ -827,6 +853,7 @@ class Byte { | ||
| 827 | 853 | Byte Byte_from_JSON(mixed json) { |
| 828 | 854 | Byte retval = Byte(); |
| 829 | 855 | |
| 856 | + if (!intp(json["byte"])) error("Expected integer"); | |
| 830 | 857 | retval.byte = json["byte"]; |
| 831 | 858 | |
| 832 | 859 | return retval; |
| @@ -847,6 +874,7 @@ class Chan { | ||
| 847 | 874 | Chan Chan_from_JSON(mixed json) { |
| 848 | 875 | Chan retval = Chan(); |
| 849 | 876 | |
| 877 | + if (!intp(json["chan"])) error("Expected integer"); | |
| 850 | 878 | retval.chan = json["chan"]; |
| 851 | 879 | |
| 852 | 880 | return retval; |
| @@ -867,6 +895,7 @@ class Char { | ||
| 867 | 895 | Char Char_from_JSON(mixed json) { |
| 868 | 896 | Char retval = Char(); |
| 869 | 897 | |
| 898 | + if (!intp(json["char"])) error("Expected integer"); | |
| 870 | 899 | retval.char = json["char"]; |
| 871 | 900 | |
| 872 | 901 | return retval; |
| @@ -887,6 +916,7 @@ class Char16T { | ||
| 887 | 916 | Char16T Char16T_from_JSON(mixed json) { |
| 888 | 917 | Char16T retval = Char16T(); |
| 889 | 918 | |
| 919 | + if (!intp(json["char16_t"])) error("Expected integer"); | |
| 890 | 920 | retval.char16_t = json["char16_t"]; |
| 891 | 921 | |
| 892 | 922 | return retval; |
| @@ -907,6 +937,7 @@ class Char32T { | ||
| 907 | 937 | Char32T Char32T_from_JSON(mixed json) { |
| 908 | 938 | Char32T retval = Char32T(); |
| 909 | 939 | |
| 940 | + if (!intp(json["char32_t"])) error("Expected integer"); | |
| 910 | 941 | retval.char32_t = json["char32_t"]; |
| 911 | 942 | |
| 912 | 943 | return retval; |
| @@ -927,6 +958,7 @@ class Checked { | ||
| 927 | 958 | Checked Checked_from_JSON(mixed json) { |
| 928 | 959 | Checked retval = Checked(); |
| 929 | 960 | |
| 961 | + if (!intp(json["checked"])) error("Expected integer"); | |
| 930 | 962 | retval.checked = json["checked"]; |
| 931 | 963 | |
| 932 | 964 | return retval; |
| @@ -947,6 +979,7 @@ class Clone { | ||
| 947 | 979 | Clone Clone_from_JSON(mixed json) { |
| 948 | 980 | Clone retval = Clone(); |
| 949 | 981 | |
| 982 | + if (!intp(json["clone"])) error("Expected integer"); | |
| 950 | 983 | retval.clone = json["clone"]; |
| 951 | 984 | |
| 952 | 985 | return retval; |
| @@ -967,6 +1000,7 @@ class CoAwait { | ||
| 967 | 1000 | CoAwait CoAwait_from_JSON(mixed json) { |
| 968 | 1001 | CoAwait retval = CoAwait(); |
| 969 | 1002 | |
| 1003 | + if (!intp(json["co_await"])) error("Expected integer"); | |
| 970 | 1004 | retval.co_await = json["co_await"]; |
| 971 | 1005 | |
| 972 | 1006 | return retval; |
| @@ -987,6 +1021,7 @@ class CoReturn { | ||
| 987 | 1021 | CoReturn CoReturn_from_JSON(mixed json) { |
| 988 | 1022 | CoReturn retval = CoReturn(); |
| 989 | 1023 | |
| 1024 | + if (!intp(json["co_return"])) error("Expected integer"); | |
| 990 | 1025 | retval.co_return = json["co_return"]; |
| 991 | 1026 | |
| 992 | 1027 | return retval; |
| @@ -1007,6 +1042,7 @@ class CoYield { | ||
| 1007 | 1042 | CoYield CoYield_from_JSON(mixed json) { |
| 1008 | 1043 | CoYield retval = CoYield(); |
| 1009 | 1044 | |
| 1045 | + if (!intp(json["co_yield"])) error("Expected integer"); | |
| 1010 | 1046 | retval.co_yield = json["co_yield"]; |
| 1011 | 1047 | |
| 1012 | 1048 | return retval; |
| @@ -1027,6 +1063,7 @@ class Compl { | ||
| 1027 | 1063 | Compl Compl_from_JSON(mixed json) { |
| 1028 | 1064 | Compl retval = Compl(); |
| 1029 | 1065 | |
| 1066 | + if (!intp(json["compl"])) error("Expected integer"); | |
| 1030 | 1067 | retval.compl = json["compl"]; |
| 1031 | 1068 | |
| 1032 | 1069 | return retval; |
| @@ -1047,6 +1084,7 @@ class Complex { | ||
| 1047 | 1084 | Complex Complex_from_JSON(mixed json) { |
| 1048 | 1085 | Complex retval = Complex(); |
| 1049 | 1086 | |
| 1087 | + if (!intp(json["_Complex"])) error("Expected integer"); | |
| 1050 | 1088 | retval.complex = json["_Complex"]; |
| 1051 | 1089 | |
| 1052 | 1090 | return retval; |
| @@ -1067,6 +1105,7 @@ class Concept { | ||
| 1067 | 1105 | Concept Concept_from_JSON(mixed json) { |
| 1068 | 1106 | Concept retval = Concept(); |
| 1069 | 1107 | |
| 1108 | + if (!intp(json["concept"])) error("Expected integer"); | |
| 1070 | 1109 | retval.concept = json["concept"]; |
| 1071 | 1110 | |
| 1072 | 1111 | return retval; |
| @@ -1087,6 +1126,7 @@ class Console { | ||
| 1087 | 1126 | Console Console_from_JSON(mixed json) { |
| 1088 | 1127 | Console retval = Console(); |
| 1089 | 1128 | |
| 1129 | + if (!intp(json["console"])) error("Expected integer"); | |
| 1090 | 1130 | retval.console = json["console"]; |
| 1091 | 1131 | |
| 1092 | 1132 | return retval; |
| @@ -1107,6 +1147,7 @@ class ConstCast { | ||
| 1107 | 1147 | ConstCast ConstCast_from_JSON(mixed json) { |
| 1108 | 1148 | ConstCast retval = ConstCast(); |
| 1109 | 1149 | |
| 1150 | + if (!intp(json["const_cast"])) error("Expected integer"); | |
| 1110 | 1151 | retval.const_cast = json["const_cast"]; |
| 1111 | 1152 | |
| 1112 | 1153 | return retval; |
| @@ -1127,6 +1168,7 @@ class Constexpr { | ||
| 1127 | 1168 | Constexpr Constexpr_from_JSON(mixed json) { |
| 1128 | 1169 | Constexpr retval = Constexpr(); |
| 1129 | 1170 | |
| 1171 | + if (!intp(json["constexpr"])) error("Expected integer"); | |
| 1130 | 1172 | retval.constexpr = json["constexpr"]; |
| 1131 | 1173 | |
| 1132 | 1174 | return retval; |
| @@ -1147,6 +1189,7 @@ class Constructor { | ||
| 1147 | 1189 | Constructor Constructor_from_JSON(mixed json) { |
| 1148 | 1190 | Constructor retval = Constructor(); |
| 1149 | 1191 | |
| 1192 | + if (!intp(json["constructor"])) error("Expected integer"); | |
| 1150 | 1193 | retval.constructor = json["constructor"]; |
| 1151 | 1194 | |
| 1152 | 1195 | return retval; |
| @@ -1167,6 +1210,7 @@ class Convenience { | ||
| 1167 | 1210 | Convenience Convenience_from_JSON(mixed json) { |
| 1168 | 1211 | Convenience retval = Convenience(); |
| 1169 | 1212 | |
| 1213 | + if (!intp(json["convenience"])) error("Expected integer"); | |
| 1170 | 1214 | retval.convenience = json["convenience"]; |
| 1171 | 1215 | |
| 1172 | 1216 | return retval; |
| @@ -1187,6 +1231,7 @@ class Convert { | ||
| 1187 | 1231 | Convert Convert_from_JSON(mixed json) { |
| 1188 | 1232 | Convert retval = Convert(); |
| 1189 | 1233 | |
| 1234 | + if (!intp(json["convert"])) error("Expected integer"); | |
| 1190 | 1235 | retval.convert = json["convert"]; |
| 1191 | 1236 | |
| 1192 | 1237 | return retval; |
| @@ -1207,6 +1252,7 @@ class Converter { | ||
| 1207 | 1252 | Converter Converter_from_JSON(mixed json) { |
| 1208 | 1253 | Converter retval = Converter(); |
| 1209 | 1254 | |
| 1255 | + if (!intp(json["converter"])) error("Expected integer"); | |
| 1210 | 1256 | retval.converter = json["converter"]; |
| 1211 | 1257 | |
| 1212 | 1258 | return retval; |
| @@ -1227,6 +1273,7 @@ class Date { | ||
| 1227 | 1273 | Date Date_from_JSON(mixed json) { |
| 1228 | 1274 | Date retval = Date(); |
| 1229 | 1275 | |
| 1276 | + if (!intp(json["date"])) error("Expected integer"); | |
| 1230 | 1277 | retval.date = json["date"]; |
| 1231 | 1278 | |
| 1232 | 1279 | return retval; |
| @@ -1247,6 +1294,7 @@ class DateParseHandling { | ||
| 1247 | 1294 | DateParseHandling DateParseHandling_from_JSON(mixed json) { |
| 1248 | 1295 | DateParseHandling retval = DateParseHandling(); |
| 1249 | 1296 | |
| 1297 | + if (!intp(json["date_parse_handling"])) error("Expected integer"); | |
| 1250 | 1298 | retval.date_parse_handling = json["date_parse_handling"]; |
| 1251 | 1299 | |
| 1252 | 1300 | return retval; |
| @@ -1267,6 +1315,7 @@ class Debugger { | ||
| 1267 | 1315 | Debugger Debugger_from_JSON(mixed json) { |
| 1268 | 1316 | Debugger retval = Debugger(); |
| 1269 | 1317 | |
| 1318 | + if (!intp(json["debugger"])) error("Expected integer"); | |
| 1270 | 1319 | retval.debugger = json["debugger"]; |
| 1271 | 1320 | |
| 1272 | 1321 | return retval; |
| @@ -1287,6 +1336,7 @@ class Decimal { | ||
| 1287 | 1336 | Decimal Decimal_from_JSON(mixed json) { |
| 1288 | 1337 | Decimal retval = Decimal(); |
| 1289 | 1338 | |
| 1339 | + if (!intp(json["decimal"])) error("Expected integer"); | |
| 1290 | 1340 | retval.decimal = json["decimal"]; |
| 1291 | 1341 | |
| 1292 | 1342 | return retval; |
| @@ -1307,6 +1357,7 @@ class Declare { | ||
| 1307 | 1357 | Declare Declare_from_JSON(mixed json) { |
| 1308 | 1358 | Declare retval = Declare(); |
| 1309 | 1359 | |
| 1360 | + if (!intp(json["declare"])) error("Expected integer"); | |
| 1310 | 1361 | retval.declare = json["declare"]; |
| 1311 | 1362 | |
| 1312 | 1363 | return retval; |
| @@ -1327,6 +1378,7 @@ class Decltype { | ||
| 1327 | 1378 | Decltype Decltype_from_JSON(mixed json) { |
| 1328 | 1379 | Decltype retval = Decltype(); |
| 1329 | 1380 | |
| 1381 | + if (!intp(json["decltype"])) error("Expected integer"); | |
| 1330 | 1382 | retval.decltype = json["decltype"]; |
| 1331 | 1383 | |
| 1332 | 1384 | return retval; |
| @@ -1347,6 +1399,7 @@ class DecodeString { | ||
| 1347 | 1399 | DecodeString DecodeString_from_JSON(mixed json) { |
| 1348 | 1400 | DecodeString retval = DecodeString(); |
| 1349 | 1401 | |
| 1402 | + if (!intp(json["decode_string"])) error("Expected integer"); | |
| 1350 | 1403 | retval.decode_string = json["decode_string"]; |
| 1351 | 1404 | |
| 1352 | 1405 | return retval; |
| @@ -1367,6 +1420,7 @@ class Empty { | ||
| 1367 | 1420 | Empty Empty_from_JSON(mixed json) { |
| 1368 | 1421 | Empty retval = Empty(); |
| 1369 | 1422 | |
| 1423 | + if (!intp(json["_"])) error("Expected integer"); | |
| 1370 | 1424 | retval.empty = json["_"]; |
| 1371 | 1425 | |
| 1372 | 1426 | return retval; |
| @@ -1387,6 +1441,7 @@ class Imaginery { | ||
| 1387 | 1441 | Imaginery Imaginery_from_JSON(mixed json) { |
| 1388 | 1442 | Imaginery retval = Imaginery(); |
| 1389 | 1443 | |
| 1444 | + if (!intp(json["_Imaginery"])) error("Expected integer"); | |
| 1390 | 1445 | retval.imaginery = json["_Imaginery"]; |
| 1391 | 1446 | |
| 1392 | 1447 | return retval; |
| @@ -1407,6 +1462,7 @@ class AnyClass { | ||
| 1407 | 1462 | AnyClass AnyClass_from_JSON(mixed json) { |
| 1408 | 1463 | AnyClass retval = AnyClass(); |
| 1409 | 1464 | |
| 1465 | + if (!intp(json["any"])) error("Expected integer"); | |
| 1410 | 1466 | retval.any = json["any"]; |
| 1411 | 1467 | |
| 1412 | 1468 | return retval; |
| @@ -1427,6 +1483,7 @@ class Array { | ||
| 1427 | 1483 | Array Array_from_JSON(mixed json) { |
| 1428 | 1484 | Array retval = Array(); |
| 1429 | 1485 | |
| 1486 | + if (!intp(json["array"])) error("Expected integer"); | |
| 1430 | 1487 | retval.array_array = json["array"]; |
| 1431 | 1488 | |
| 1432 | 1489 | return retval; |
| @@ -1447,6 +1504,7 @@ class Auto { | ||
| 1447 | 1504 | Auto Auto_from_JSON(mixed json) { |
| 1448 | 1505 | Auto retval = Auto(); |
| 1449 | 1506 | |
| 1507 | + if (!intp(json["auto"])) error("Expected integer"); | |
| 1450 | 1508 | retval.auto_auto = json["auto"]; |
| 1451 | 1509 | |
| 1452 | 1510 | return retval; |
| @@ -1467,6 +1525,7 @@ class BoolClass { | ||
| 1467 | 1525 | BoolClass BoolClass_from_JSON(mixed json) { |
| 1468 | 1526 | BoolClass retval = BoolClass(); |
| 1469 | 1527 | |
| 1528 | + if (!intp(json["_Bool"])) error("Expected integer"); | |
| 1470 | 1529 | retval.bool = json["_Bool"]; |
| 1471 | 1530 | |
| 1472 | 1531 | return retval; |
| @@ -1487,6 +1546,7 @@ class Break { | ||
| 1487 | 1546 | Break Break_from_JSON(mixed json) { |
| 1488 | 1547 | Break retval = Break(); |
| 1489 | 1548 | |
| 1549 | + if (!intp(json["break"])) error("Expected integer"); | |
| 1490 | 1550 | retval.break_break = json["break"]; |
| 1491 | 1551 | |
| 1492 | 1552 | return retval; |
| @@ -1507,6 +1567,7 @@ class Case { | ||
| 1507 | 1567 | Case Case_from_JSON(mixed json) { |
| 1508 | 1568 | Case retval = Case(); |
| 1509 | 1569 | |
| 1570 | + if (!intp(json["case"])) error("Expected integer"); | |
| 1510 | 1571 | retval.case_case = json["case"]; |
| 1511 | 1572 | |
| 1512 | 1573 | return retval; |
| @@ -1527,6 +1588,7 @@ class Catch { | ||
| 1527 | 1588 | Catch Catch_from_JSON(mixed json) { |
| 1528 | 1589 | Catch retval = Catch(); |
| 1529 | 1590 | |
| 1591 | + if (!intp(json["catch"])) error("Expected integer"); | |
| 1530 | 1592 | retval.catch_catch = json["catch"]; |
| 1531 | 1593 | |
| 1532 | 1594 | return retval; |
| @@ -1547,6 +1609,7 @@ class Class { | ||
| 1547 | 1609 | Class Class_from_JSON(mixed json) { |
| 1548 | 1610 | Class retval = Class(); |
| 1549 | 1611 | |
| 1612 | + if (!intp(json["Class"])) error("Expected integer"); | |
| 1550 | 1613 | retval.class_class = json["Class"]; |
| 1551 | 1614 | |
| 1552 | 1615 | return retval; |
| @@ -1567,6 +1630,7 @@ class Const { | ||
| 1567 | 1630 | Const Const_from_JSON(mixed json) { |
| 1568 | 1631 | Const retval = Const(); |
| 1569 | 1632 | |
| 1633 | + if (!intp(json["const"])) error("Expected integer"); | |
| 1570 | 1634 | retval.const_const = json["const"]; |
| 1571 | 1635 | |
| 1572 | 1636 | return retval; |
| @@ -1587,6 +1651,7 @@ class Continue { | ||
| 1587 | 1651 | Continue Continue_from_JSON(mixed json) { |
| 1588 | 1652 | Continue retval = Continue(); |
| 1589 | 1653 | |
| 1654 | + if (!intp(json["continue"])) error("Expected integer"); | |
| 1590 | 1655 | retval.continue_continue = json["continue"]; |
| 1591 | 1656 | |
| 1592 | 1657 | return retval; |
| @@ -1607,6 +1672,7 @@ class Obj1Bool { | ||
| 1607 | 1672 | Obj1Bool Obj1Bool_from_JSON(mixed json) { |
| 1608 | 1673 | Obj1Bool retval = Obj1Bool(); |
| 1609 | 1674 | |
| 1675 | + if (!intp(json["bool"])) error("Expected integer"); | |
| 1610 | 1676 | retval.bool = json["bool"]; |
| 1611 | 1677 | |
| 1612 | 1678 | return retval; |
| @@ -1627,6 +1693,7 @@ class ClassClass { | ||
| 1627 | 1693 | ClassClass ClassClass_from_JSON(mixed json) { |
| 1628 | 1694 | ClassClass retval = ClassClass(); |
| 1629 | 1695 | |
| 1696 | + if (!intp(json["class"])) error("Expected integer"); | |
| 1630 | 1697 | retval.class_class = json["class"]; |
| 1631 | 1698 | |
| 1632 | 1699 | return retval; |
| @@ -1797,6 +1864,7 @@ Obj2 Obj2_from_JSON(mixed json) { | ||
| 1797 | 1864 | retval.did_set = json["didSet"]; |
| 1798 | 1865 | Double_from_JSON(json["double"]); |
| 1799 | 1866 | retval.double = json["double"]; |
| 1867 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 1800 | 1868 | retval.dummy = json["dummy"]; |
| 1801 | 1869 | Dynamic_from_JSON(json["dynamic"]); |
| 1802 | 1870 | retval.dynamic = json["dynamic"]; |
| @@ -1927,6 +1995,7 @@ class Def { | ||
| 1927 | 1995 | Def Def_from_JSON(mixed json) { |
| 1928 | 1996 | Def retval = Def(); |
| 1929 | 1997 | |
| 1998 | + if (!intp(json["def"])) error("Expected integer"); | |
| 1930 | 1999 | retval.def = json["def"]; |
| 1931 | 2000 | |
| 1932 | 2001 | return retval; |
| @@ -1947,6 +2016,7 @@ class Defer { | ||
| 1947 | 2016 | Defer Defer_from_JSON(mixed json) { |
| 1948 | 2017 | Defer retval = Defer(); |
| 1949 | 2018 | |
| 2019 | + if (!intp(json["defer"])) error("Expected integer"); | |
| 1950 | 2020 | retval.defer = json["defer"]; |
| 1951 | 2021 | |
| 1952 | 2022 | return retval; |
| @@ -1967,6 +2037,7 @@ class Deinit { | ||
| 1967 | 2037 | Deinit Deinit_from_JSON(mixed json) { |
| 1968 | 2038 | Deinit retval = Deinit(); |
| 1969 | 2039 | |
| 2040 | + if (!intp(json["deinit"])) error("Expected integer"); | |
| 1970 | 2041 | retval.deinit = json["deinit"]; |
| 1971 | 2042 | |
| 1972 | 2043 | return retval; |
| @@ -1987,6 +2058,7 @@ class Del { | ||
| 1987 | 2058 | Del Del_from_JSON(mixed json) { |
| 1988 | 2059 | Del retval = Del(); |
| 1989 | 2060 | |
| 2061 | + if (!intp(json["del"])) error("Expected integer"); | |
| 1990 | 2062 | retval.del = json["del"]; |
| 1991 | 2063 | |
| 1992 | 2064 | return retval; |
| @@ -2007,6 +2079,7 @@ class Delegate { | ||
| 2007 | 2079 | Delegate Delegate_from_JSON(mixed json) { |
| 2008 | 2080 | Delegate retval = Delegate(); |
| 2009 | 2081 | |
| 2082 | + if (!intp(json["delegate"])) error("Expected integer"); | |
| 2010 | 2083 | retval.delegate = json["delegate"]; |
| 2011 | 2084 | |
| 2012 | 2085 | return retval; |
| @@ -2027,6 +2100,7 @@ class Delete { | ||
| 2027 | 2100 | Delete Delete_from_JSON(mixed json) { |
| 2028 | 2101 | Delete retval = Delete(); |
| 2029 | 2102 | |
| 2103 | + if (!intp(json["delete"])) error("Expected integer"); | |
| 2030 | 2104 | retval.delete = json["delete"]; |
| 2031 | 2105 | |
| 2032 | 2106 | return retval; |
| @@ -2047,6 +2121,7 @@ class Dict { | ||
| 2047 | 2121 | Dict Dict_from_JSON(mixed json) { |
| 2048 | 2122 | Dict retval = Dict(); |
| 2049 | 2123 | |
| 2124 | + if (!intp(json["dict"])) error("Expected integer"); | |
| 2050 | 2125 | retval.dict = json["dict"]; |
| 2051 | 2126 | |
| 2052 | 2127 | return retval; |
| @@ -2067,6 +2142,7 @@ class Dictionary { | ||
| 2067 | 2142 | Dictionary Dictionary_from_JSON(mixed json) { |
| 2068 | 2143 | Dictionary retval = Dictionary(); |
| 2069 | 2144 | |
| 2145 | + if (!intp(json["dictionary"])) error("Expected integer"); | |
| 2070 | 2146 | retval.dictionary = json["dictionary"]; |
| 2071 | 2147 | |
| 2072 | 2148 | return retval; |
| @@ -2087,6 +2163,7 @@ class DidSet { | ||
| 2087 | 2163 | DidSet DidSet_from_JSON(mixed json) { |
| 2088 | 2164 | DidSet retval = DidSet(); |
| 2089 | 2165 | |
| 2166 | + if (!intp(json["didSet"])) error("Expected integer"); | |
| 2090 | 2167 | retval.did_set = json["didSet"]; |
| 2091 | 2168 | |
| 2092 | 2169 | return retval; |
| @@ -2107,6 +2184,7 @@ class Double { | ||
| 2107 | 2184 | Double Double_from_JSON(mixed json) { |
| 2108 | 2185 | Double retval = Double(); |
| 2109 | 2186 | |
| 2187 | + if (!intp(json["double"])) error("Expected integer"); | |
| 2110 | 2188 | retval.double = json["double"]; |
| 2111 | 2189 | |
| 2112 | 2190 | return retval; |
| @@ -2127,6 +2205,7 @@ class Dynamic { | ||
| 2127 | 2205 | Dynamic Dynamic_from_JSON(mixed json) { |
| 2128 | 2206 | Dynamic retval = Dynamic(); |
| 2129 | 2207 | |
| 2208 | + if (!intp(json["dynamic"])) error("Expected integer"); | |
| 2130 | 2209 | retval.dynamic = json["dynamic"]; |
| 2131 | 2210 | |
| 2132 | 2211 | return retval; |
| @@ -2147,6 +2226,7 @@ class DynamicCast { | ||
| 2147 | 2226 | DynamicCast DynamicCast_from_JSON(mixed json) { |
| 2148 | 2227 | DynamicCast retval = DynamicCast(); |
| 2149 | 2228 | |
| 2229 | + if (!intp(json["dynamic_cast"])) error("Expected integer"); | |
| 2150 | 2230 | retval.dynamic_cast = json["dynamic_cast"]; |
| 2151 | 2231 | |
| 2152 | 2232 | return retval; |
| @@ -2167,6 +2247,7 @@ class Elif { | ||
| 2167 | 2247 | Elif Elif_from_JSON(mixed json) { |
| 2168 | 2248 | Elif retval = Elif(); |
| 2169 | 2249 | |
| 2250 | + if (!intp(json["elif"])) error("Expected integer"); | |
| 2170 | 2251 | retval.elif = json["elif"]; |
| 2171 | 2252 | |
| 2172 | 2253 | return retval; |
| @@ -2187,6 +2268,7 @@ class EncodeQuickType { | ||
| 2187 | 2268 | EncodeQuickType EncodeQuickType_from_JSON(mixed json) { |
| 2188 | 2269 | EncodeQuickType retval = EncodeQuickType(); |
| 2189 | 2270 | |
| 2271 | + if (!intp(json["encode_quick_type"])) error("Expected integer"); | |
| 2190 | 2272 | retval.encode_quick_type = json["encode_quick_type"]; |
| 2191 | 2273 | |
| 2192 | 2274 | return retval; |
| @@ -2207,6 +2289,7 @@ class EqualityContract { | ||
| 2207 | 2289 | EqualityContract EqualityContract_from_JSON(mixed json) { |
| 2208 | 2290 | EqualityContract retval = EqualityContract(); |
| 2209 | 2291 | |
| 2292 | + if (!intp(json["equalityContract"])) error("Expected integer"); | |
| 2210 | 2293 | retval.equality_contract = json["equalityContract"]; |
| 2211 | 2294 | |
| 2212 | 2295 | return retval; |
| @@ -2227,6 +2310,7 @@ class Event { | ||
| 2227 | 2310 | Event Event_from_JSON(mixed json) { |
| 2228 | 2311 | Event retval = Event(); |
| 2229 | 2312 | |
| 2313 | + if (!intp(json["event"])) error("Expected integer"); | |
| 2230 | 2314 | retval.event = json["event"]; |
| 2231 | 2315 | |
| 2232 | 2316 | return retval; |
| @@ -2247,6 +2331,7 @@ class Except { | ||
| 2247 | 2331 | Except Except_from_JSON(mixed json) { |
| 2248 | 2332 | Except retval = Except(); |
| 2249 | 2333 | |
| 2334 | + if (!intp(json["except"])) error("Expected integer"); | |
| 2250 | 2335 | retval.except = json["except"]; |
| 2251 | 2336 | |
| 2252 | 2337 | return retval; |
| @@ -2267,6 +2352,7 @@ class Exception { | ||
| 2267 | 2352 | Exception Exception_from_JSON(mixed json) { |
| 2268 | 2353 | Exception retval = Exception(); |
| 2269 | 2354 | |
| 2355 | + if (!intp(json["exception"])) error("Expected integer"); | |
| 2270 | 2356 | retval.exception = json["exception"]; |
| 2271 | 2357 | |
| 2272 | 2358 | return retval; |
| @@ -2287,6 +2373,7 @@ class Explicit { | ||
| 2287 | 2373 | Explicit Explicit_from_JSON(mixed json) { |
| 2288 | 2374 | Explicit retval = Explicit(); |
| 2289 | 2375 | |
| 2376 | + if (!intp(json["explicit"])) error("Expected integer"); | |
| 2290 | 2377 | retval.explicit = json["explicit"]; |
| 2291 | 2378 | |
| 2292 | 2379 | return retval; |
| @@ -2307,6 +2394,7 @@ class Export { | ||
| 2307 | 2394 | Export Export_from_JSON(mixed json) { |
| 2308 | 2395 | Export retval = Export(); |
| 2309 | 2396 | |
| 2397 | + if (!intp(json["export"])) error("Expected integer"); | |
| 2310 | 2398 | retval.export = json["export"]; |
| 2311 | 2399 | |
| 2312 | 2400 | return retval; |
| @@ -2327,6 +2415,7 @@ class Exposing { | ||
| 2327 | 2415 | Exposing Exposing_from_JSON(mixed json) { |
| 2328 | 2416 | Exposing retval = Exposing(); |
| 2329 | 2417 | |
| 2418 | + if (!intp(json["exposing"])) error("Expected integer"); | |
| 2330 | 2419 | retval.exposing = json["exposing"]; |
| 2331 | 2420 | |
| 2332 | 2421 | return retval; |
| @@ -2347,6 +2436,7 @@ class Extends { | ||
| 2347 | 2436 | Extends Extends_from_JSON(mixed json) { |
| 2348 | 2437 | Extends retval = Extends(); |
| 2349 | 2438 | |
| 2439 | + if (!intp(json["extends"])) error("Expected integer"); | |
| 2350 | 2440 | retval.extends = json["extends"]; |
| 2351 | 2441 | |
| 2352 | 2442 | return retval; |
| @@ -2367,6 +2457,7 @@ class Extension { | ||
| 2367 | 2457 | Extension Extension_from_JSON(mixed json) { |
| 2368 | 2458 | Extension retval = Extension(); |
| 2369 | 2459 | |
| 2460 | + if (!intp(json["extension"])) error("Expected integer"); | |
| 2370 | 2461 | retval.extension = json["extension"]; |
| 2371 | 2462 | |
| 2372 | 2463 | return retval; |
| @@ -2387,6 +2478,7 @@ class Fallthrough { | ||
| 2387 | 2478 | Fallthrough Fallthrough_from_JSON(mixed json) { |
| 2388 | 2479 | Fallthrough retval = Fallthrough(); |
| 2389 | 2480 | |
| 2481 | + if (!intp(json["fallthrough"])) error("Expected integer"); | |
| 2390 | 2482 | retval.fallthrough = json["fallthrough"]; |
| 2391 | 2483 | |
| 2392 | 2484 | return retval; |
| @@ -2407,6 +2499,7 @@ class False { | ||
| 2407 | 2499 | False False_from_JSON(mixed json) { |
| 2408 | 2500 | False retval = False(); |
| 2409 | 2501 | |
| 2502 | + if (!intp(json["False"])) error("Expected integer"); | |
| 2410 | 2503 | retval.false = json["False"]; |
| 2411 | 2504 | |
| 2412 | 2505 | return retval; |
| @@ -2427,6 +2520,7 @@ class Fileprivate { | ||
| 2427 | 2520 | Fileprivate Fileprivate_from_JSON(mixed json) { |
| 2428 | 2521 | Fileprivate retval = Fileprivate(); |
| 2429 | 2522 | |
| 2523 | + if (!intp(json["fileprivate"])) error("Expected integer"); | |
| 2430 | 2524 | retval.fileprivate = json["fileprivate"]; |
| 2431 | 2525 | |
| 2432 | 2526 | return retval; |
| @@ -2447,6 +2541,7 @@ class Finally { | ||
| 2447 | 2541 | Finally Finally_from_JSON(mixed json) { |
| 2448 | 2542 | Finally retval = Finally(); |
| 2449 | 2543 | |
| 2544 | + if (!intp(json["finally"])) error("Expected integer"); | |
| 2450 | 2545 | retval.finally = json["finally"]; |
| 2451 | 2546 | |
| 2452 | 2547 | return retval; |
| @@ -2467,6 +2562,7 @@ class Fixed { | ||
| 2467 | 2562 | Fixed Fixed_from_JSON(mixed json) { |
| 2468 | 2563 | Fixed retval = Fixed(); |
| 2469 | 2564 | |
| 2565 | + if (!intp(json["fixed"])) error("Expected integer"); | |
| 2470 | 2566 | retval.fixed = json["fixed"]; |
| 2471 | 2567 | |
| 2472 | 2568 | return retval; |
| @@ -2487,6 +2583,7 @@ class Friend { | ||
| 2487 | 2583 | Friend Friend_from_JSON(mixed json) { |
| 2488 | 2584 | Friend retval = Friend(); |
| 2489 | 2585 | |
| 2586 | + if (!intp(json["friend"])) error("Expected integer"); | |
| 2490 | 2587 | retval.friend = json["friend"]; |
| 2491 | 2588 | |
| 2492 | 2589 | return retval; |
| @@ -2507,6 +2604,7 @@ class From { | ||
| 2507 | 2604 | From From_from_JSON(mixed json) { |
| 2508 | 2605 | From retval = From(); |
| 2509 | 2606 | |
| 2607 | + if (!intp(json["from"])) error("Expected integer"); | |
| 2510 | 2608 | retval.from = json["from"]; |
| 2511 | 2609 | |
| 2512 | 2610 | return retval; |
| @@ -2527,6 +2625,7 @@ class FromJson { | ||
| 2527 | 2625 | FromJson FromJson_from_JSON(mixed json) { |
| 2528 | 2626 | FromJson retval = FromJson(); |
| 2529 | 2627 | |
| 2628 | + if (!intp(json["from_json"])) error("Expected integer"); | |
| 2530 | 2629 | retval.from_json = json["from_json"]; |
| 2531 | 2630 | |
| 2532 | 2631 | return retval; |
| @@ -2547,6 +2646,7 @@ class Func { | ||
| 2547 | 2646 | Func Func_from_JSON(mixed json) { |
| 2548 | 2647 | Func retval = Func(); |
| 2549 | 2648 | |
| 2649 | + if (!intp(json["func"])) error("Expected integer"); | |
| 2550 | 2650 | retval.func = json["func"]; |
| 2551 | 2651 | |
| 2552 | 2652 | return retval; |
| @@ -2567,6 +2667,7 @@ class Get { | ||
| 2567 | 2667 | Get Get_from_JSON(mixed json) { |
| 2568 | 2668 | Get retval = Get(); |
| 2569 | 2669 | |
| 2670 | + if (!intp(json["get"])) error("Expected integer"); | |
| 2570 | 2671 | retval.get = json["get"]; |
| 2571 | 2672 | |
| 2572 | 2673 | return retval; |
| @@ -2587,6 +2688,7 @@ class Go { | ||
| 2587 | 2688 | Go Go_from_JSON(mixed json) { |
| 2588 | 2689 | Go retval = Go(); |
| 2589 | 2690 | |
| 2691 | + if (!intp(json["go"])) error("Expected integer"); | |
| 2590 | 2692 | retval.go = json["go"]; |
| 2591 | 2693 | |
| 2592 | 2694 | return retval; |
| @@ -2607,6 +2709,7 @@ class Goto { | ||
| 2607 | 2709 | Goto Goto_from_JSON(mixed json) { |
| 2608 | 2710 | Goto retval = Goto(); |
| 2609 | 2711 | |
| 2712 | + if (!intp(json["goto"])) error("Expected integer"); | |
| 2610 | 2713 | retval.goto = json["goto"]; |
| 2611 | 2714 | |
| 2612 | 2715 | return retval; |
| @@ -2627,6 +2730,7 @@ class Guard { | ||
| 2627 | 2730 | Guard Guard_from_JSON(mixed json) { |
| 2628 | 2731 | Guard retval = Guard(); |
| 2629 | 2732 | |
| 2733 | + if (!intp(json["guard"])) error("Expected integer"); | |
| 2630 | 2734 | retval.guard = json["guard"]; |
| 2631 | 2735 | |
| 2632 | 2736 | return retval; |
| @@ -2647,6 +2751,7 @@ class HasOwnProperty { | ||
| 2647 | 2751 | HasOwnProperty HasOwnProperty_from_JSON(mixed json) { |
| 2648 | 2752 | HasOwnProperty retval = HasOwnProperty(); |
| 2649 | 2753 | |
| 2754 | + if (!intp(json["hasOwnProperty"])) error("Expected integer"); | |
| 2650 | 2755 | retval.has_own_property = json["hasOwnProperty"]; |
| 2651 | 2756 | |
| 2652 | 2757 | return retval; |
| @@ -2667,6 +2772,7 @@ class Id { | ||
| 2667 | 2772 | Id Id_from_JSON(mixed json) { |
| 2668 | 2773 | Id retval = Id(); |
| 2669 | 2774 | |
| 2775 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2670 | 2776 | retval.id = json["id"]; |
| 2671 | 2777 | |
| 2672 | 2778 | return retval; |
| @@ -2687,6 +2793,7 @@ class Imp { | ||
| 2687 | 2793 | Imp Imp_from_JSON(mixed json) { |
| 2688 | 2794 | Imp retval = Imp(); |
| 2689 | 2795 | |
| 2796 | + if (!intp(json["IMP"])) error("Expected integer"); | |
| 2690 | 2797 | retval.imp = json["IMP"]; |
| 2691 | 2798 | |
| 2692 | 2799 | return retval; |
| @@ -2707,6 +2814,7 @@ class Implements { | ||
| 2707 | 2814 | Implements Implements_from_JSON(mixed json) { |
| 2708 | 2815 | Implements retval = Implements(); |
| 2709 | 2816 | |
| 2817 | + if (!intp(json["implements"])) error("Expected integer"); | |
| 2710 | 2818 | retval.implements = json["implements"]; |
| 2711 | 2819 | |
| 2712 | 2820 | return retval; |
| @@ -2727,6 +2835,7 @@ class Implicit { | ||
| 2727 | 2835 | Implicit Implicit_from_JSON(mixed json) { |
| 2728 | 2836 | Implicit retval = Implicit(); |
| 2729 | 2837 | |
| 2838 | + if (!intp(json["implicit"])) error("Expected integer"); | |
| 2730 | 2839 | retval.implicit = json["implicit"]; |
| 2731 | 2840 | |
| 2732 | 2841 | return retval; |
| @@ -2747,6 +2856,7 @@ class In { | ||
| 2747 | 2856 | In In_from_JSON(mixed json) { |
| 2748 | 2857 | In retval = In(); |
| 2749 | 2858 | |
| 2859 | + if (!intp(json["in"])) error("Expected integer"); | |
| 2750 | 2860 | retval.in = json["in"]; |
| 2751 | 2861 | |
| 2752 | 2862 | return retval; |
| @@ -2767,6 +2877,7 @@ class Indirect { | ||
| 2767 | 2877 | Indirect Indirect_from_JSON(mixed json) { |
| 2768 | 2878 | Indirect retval = Indirect(); |
| 2769 | 2879 | |
| 2880 | + if (!intp(json["indirect"])) error("Expected integer"); | |
| 2770 | 2881 | retval.indirect = json["indirect"]; |
| 2771 | 2882 | |
| 2772 | 2883 | return retval; |
| @@ -2787,6 +2898,7 @@ class Infix { | ||
| 2787 | 2898 | Infix Infix_from_JSON(mixed json) { |
| 2788 | 2899 | Infix retval = Infix(); |
| 2789 | 2900 | |
| 2901 | + if (!intp(json["infix"])) error("Expected integer"); | |
| 2790 | 2902 | retval.infix = json["infix"]; |
| 2791 | 2903 | |
| 2792 | 2904 | return retval; |
| @@ -2807,6 +2919,7 @@ class Init { | ||
| 2807 | 2919 | Init Init_from_JSON(mixed json) { |
| 2808 | 2920 | Init retval = Init(); |
| 2809 | 2921 | |
| 2922 | + if (!intp(json["init"])) error("Expected integer"); | |
| 2810 | 2923 | retval.init = json["init"]; |
| 2811 | 2924 | |
| 2812 | 2925 | return retval; |
| @@ -2827,6 +2940,7 @@ class Inout { | ||
| 2827 | 2940 | Inout Inout_from_JSON(mixed json) { |
| 2828 | 2941 | Inout retval = Inout(); |
| 2829 | 2942 | |
| 2943 | + if (!intp(json["inout"])) error("Expected integer"); | |
| 2830 | 2944 | retval.inout = json["inout"]; |
| 2831 | 2945 | |
| 2832 | 2946 | return retval; |
| @@ -2847,6 +2961,7 @@ class Instanceof { | ||
| 2847 | 2961 | Instanceof Instanceof_from_JSON(mixed json) { |
| 2848 | 2962 | Instanceof retval = Instanceof(); |
| 2849 | 2963 | |
| 2964 | + if (!intp(json["instanceof"])) error("Expected integer"); | |
| 2850 | 2965 | retval.instanceof = json["instanceof"]; |
| 2851 | 2966 | |
| 2852 | 2967 | return retval; |
| @@ -2867,6 +2982,7 @@ class Interface { | ||
| 2867 | 2982 | Interface Interface_from_JSON(mixed json) { |
| 2868 | 2983 | Interface retval = Interface(); |
| 2869 | 2984 | |
| 2985 | + if (!intp(json["interface"])) error("Expected integer"); | |
| 2870 | 2986 | retval.interface = json["interface"]; |
| 2871 | 2987 | |
| 2872 | 2988 | return retval; |
| @@ -2887,6 +3003,7 @@ class Internal { | ||
| 2887 | 3003 | Internal Internal_from_JSON(mixed json) { |
| 2888 | 3004 | Internal retval = Internal(); |
| 2889 | 3005 | |
| 3006 | + if (!intp(json["internal"])) error("Expected integer"); | |
| 2890 | 3007 | retval.internal = json["internal"]; |
| 2891 | 3008 | |
| 2892 | 3009 | return retval; |
| @@ -2907,6 +3024,7 @@ class Default { | ||
| 2907 | 3024 | Default Default_from_JSON(mixed json) { |
| 2908 | 3025 | Default retval = Default(); |
| 2909 | 3026 | |
| 3027 | + if (!intp(json["default"])) error("Expected integer"); | |
| 2910 | 3028 | retval.default_default = json["default"]; |
| 2911 | 3029 | |
| 2912 | 3030 | return retval; |
| @@ -2927,6 +3045,7 @@ class Do { | ||
| 2927 | 3045 | Do Do_from_JSON(mixed json) { |
| 2928 | 3046 | Do retval = Do(); |
| 2929 | 3047 | |
| 3048 | + if (!intp(json["do"])) error("Expected integer"); | |
| 2930 | 3049 | retval.do_do = json["do"]; |
| 2931 | 3050 | |
| 2932 | 3051 | return retval; |
| @@ -2947,6 +3066,7 @@ class Else { | ||
| 2947 | 3066 | Else Else_from_JSON(mixed json) { |
| 2948 | 3067 | Else retval = Else(); |
| 2949 | 3068 | |
| 3069 | + if (!intp(json["else"])) error("Expected integer"); | |
| 2950 | 3070 | retval.else_else = json["else"]; |
| 2951 | 3071 | |
| 2952 | 3072 | return retval; |
| @@ -2967,6 +3087,7 @@ class Enum { | ||
| 2967 | 3087 | Enum Enum_from_JSON(mixed json) { |
| 2968 | 3088 | Enum retval = Enum(); |
| 2969 | 3089 | |
| 3090 | + if (!intp(json["enum"])) error("Expected integer"); | |
| 2970 | 3091 | retval.enum_enum = json["enum"]; |
| 2971 | 3092 | |
| 2972 | 3093 | return retval; |
| @@ -2987,6 +3108,7 @@ class Extern { | ||
| 2987 | 3108 | Extern Extern_from_JSON(mixed json) { |
| 2988 | 3109 | Extern retval = Extern(); |
| 2989 | 3110 | |
| 3111 | + if (!intp(json["extern"])) error("Expected integer"); | |
| 2990 | 3112 | retval.extern_extern = json["extern"]; |
| 2991 | 3113 | |
| 2992 | 3114 | return retval; |
| @@ -3007,6 +3129,7 @@ class FalseClass { | ||
| 3007 | 3129 | FalseClass FalseClass_from_JSON(mixed json) { |
| 3008 | 3130 | FalseClass retval = FalseClass(); |
| 3009 | 3131 | |
| 3132 | + if (!intp(json["false"])) error("Expected integer"); | |
| 3010 | 3133 | retval.false = json["false"]; |
| 3011 | 3134 | |
| 3012 | 3135 | return retval; |
| @@ -3027,6 +3150,7 @@ class Final { | ||
| 3027 | 3150 | Final Final_from_JSON(mixed json) { |
| 3028 | 3151 | Final retval = Final(); |
| 3029 | 3152 | |
| 3153 | + if (!intp(json["final"])) error("Expected integer"); | |
| 3030 | 3154 | retval.final_final = json["final"]; |
| 3031 | 3155 | |
| 3032 | 3156 | return retval; |
| @@ -3047,6 +3171,7 @@ class Float { | ||
| 3047 | 3171 | Float Float_from_JSON(mixed json) { |
| 3048 | 3172 | Float retval = Float(); |
| 3049 | 3173 | |
| 3174 | + if (!intp(json["float"])) error("Expected integer"); | |
| 3050 | 3175 | retval.float_float = json["float"]; |
| 3051 | 3176 | |
| 3052 | 3177 | return retval; |
| @@ -3067,6 +3192,7 @@ class For { | ||
| 3067 | 3192 | For For_from_JSON(mixed json) { |
| 3068 | 3193 | For retval = For(); |
| 3069 | 3194 | |
| 3195 | + if (!intp(json["for"])) error("Expected integer"); | |
| 3070 | 3196 | retval.for_for = json["for"]; |
| 3071 | 3197 | |
| 3072 | 3198 | return retval; |
| @@ -3087,6 +3213,7 @@ class Foreach { | ||
| 3087 | 3213 | Foreach Foreach_from_JSON(mixed json) { |
| 3088 | 3214 | Foreach retval = Foreach(); |
| 3089 | 3215 | |
| 3216 | + if (!intp(json["foreach"])) error("Expected integer"); | |
| 3090 | 3217 | retval.foreach_foreach = json["foreach"]; |
| 3091 | 3218 | |
| 3092 | 3219 | return retval; |
| @@ -3107,6 +3234,7 @@ class Function { | ||
| 3107 | 3234 | Function Function_from_JSON(mixed json) { |
| 3108 | 3235 | Function retval = Function(); |
| 3109 | 3236 | |
| 3237 | + if (!intp(json["function"])) error("Expected integer"); | |
| 3110 | 3238 | retval.function_function = json["function"]; |
| 3111 | 3239 | |
| 3112 | 3240 | return retval; |
| @@ -3127,6 +3255,7 @@ class Global { | ||
| 3127 | 3255 | Global Global_from_JSON(mixed json) { |
| 3128 | 3256 | Global retval = Global(); |
| 3129 | 3257 | |
| 3258 | + if (!intp(json["global"])) error("Expected integer"); | |
| 3130 | 3259 | retval.global_global = json["global"]; |
| 3131 | 3260 | |
| 3132 | 3261 | return retval; |
| @@ -3147,6 +3276,7 @@ class If { | ||
| 3147 | 3276 | If If_from_JSON(mixed json) { |
| 3148 | 3277 | If retval = If(); |
| 3149 | 3278 | |
| 3279 | + if (!intp(json["if"])) error("Expected integer"); | |
| 3150 | 3280 | retval.if_if = json["if"]; |
| 3151 | 3281 | |
| 3152 | 3282 | return retval; |
| @@ -3167,6 +3297,7 @@ class Import { | ||
| 3167 | 3297 | Import Import_from_JSON(mixed json) { |
| 3168 | 3298 | Import retval = Import(); |
| 3169 | 3299 | |
| 3300 | + if (!intp(json["import"])) error("Expected integer"); | |
| 3170 | 3301 | retval.import_import = json["import"]; |
| 3171 | 3302 | |
| 3172 | 3303 | return retval; |
| @@ -3187,6 +3318,7 @@ class Inline { | ||
| 3187 | 3318 | Inline Inline_from_JSON(mixed json) { |
| 3188 | 3319 | Inline retval = Inline(); |
| 3189 | 3320 | |
| 3321 | + if (!intp(json["inline"])) error("Expected integer"); | |
| 3190 | 3322 | retval.inline_inline = json["inline"]; |
| 3191 | 3323 | |
| 3192 | 3324 | return retval; |
| @@ -3207,6 +3339,7 @@ class Int { | ||
| 3207 | 3339 | Int Int_from_JSON(mixed json) { |
| 3208 | 3340 | Int retval = Int(); |
| 3209 | 3341 | |
| 3342 | + if (!intp(json["int"])) error("Expected integer"); | |
| 3210 | 3343 | retval.int_int = json["int"]; |
| 3211 | 3344 | |
| 3212 | 3345 | return retval; |
| @@ -3357,6 +3490,7 @@ class Obj3 { | ||
| 3357 | 3490 | Obj3 Obj3_from_JSON(mixed json) { |
| 3358 | 3491 | Obj3 retval = Obj3(); |
| 3359 | 3492 | |
| 3493 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 3360 | 3494 | retval.dummy = json["dummy"]; |
| 3361 | 3495 | Is_from_JSON(json["is"]); |
| 3362 | 3496 | retval.is = json["is"]; |
| @@ -3507,6 +3641,7 @@ class Is { | ||
| 3507 | 3641 | Is Is_from_JSON(mixed json) { |
| 3508 | 3642 | Is retval = Is(); |
| 3509 | 3643 | |
| 3644 | + if (!intp(json["is"])) error("Expected integer"); | |
| 3510 | 3645 | retval.is = json["is"]; |
| 3511 | 3646 | |
| 3512 | 3647 | return retval; |
| @@ -3527,6 +3662,7 @@ class Iterable { | ||
| 3527 | 3662 | Iterable Iterable_from_JSON(mixed json) { |
| 3528 | 3663 | Iterable retval = Iterable(); |
| 3529 | 3664 | |
| 3665 | + if (!intp(json["iterable"])) error("Expected integer"); | |
| 3530 | 3666 | retval.iterable = json["iterable"]; |
| 3531 | 3667 | |
| 3532 | 3668 | return retval; |
| @@ -3547,6 +3683,7 @@ class Jdec { | ||
| 3547 | 3683 | Jdec Jdec_from_JSON(mixed json) { |
| 3548 | 3684 | Jdec retval = Jdec(); |
| 3549 | 3685 | |
| 3686 | + if (!intp(json["jdec"])) error("Expected integer"); | |
| 3550 | 3687 | retval.jdec = json["jdec"]; |
| 3551 | 3688 | |
| 3552 | 3689 | return retval; |
| @@ -3567,6 +3704,7 @@ class Jenc { | ||
| 3567 | 3704 | Jenc Jenc_from_JSON(mixed json) { |
| 3568 | 3705 | Jenc retval = Jenc(); |
| 3569 | 3706 | |
| 3707 | + if (!intp(json["jenc"])) error("Expected integer"); | |
| 3570 | 3708 | retval.jenc = json["jenc"]; |
| 3571 | 3709 | |
| 3572 | 3710 | return retval; |
| @@ -3587,6 +3725,7 @@ class Jpipe { | ||
| 3587 | 3725 | Jpipe Jpipe_from_JSON(mixed json) { |
| 3588 | 3726 | Jpipe retval = Jpipe(); |
| 3589 | 3727 | |
| 3728 | + if (!intp(json["jpipe"])) error("Expected integer"); | |
| 3590 | 3729 | retval.jpipe = json["jpipe"]; |
| 3591 | 3730 | |
| 3592 | 3731 | return retval; |
| @@ -3607,6 +3746,7 @@ class Json { | ||
| 3607 | 3746 | Json Json_from_JSON(mixed json) { |
| 3608 | 3747 | Json retval = Json(); |
| 3609 | 3748 | |
| 3749 | + if (!intp(json["json"])) error("Expected integer"); | |
| 3610 | 3750 | retval.json = json["json"]; |
| 3611 | 3751 | |
| 3612 | 3752 | return retval; |
| @@ -3627,6 +3767,7 @@ class JsonConverter { | ||
| 3627 | 3767 | JsonConverter JsonConverter_from_JSON(mixed json) { |
| 3628 | 3768 | JsonConverter retval = JsonConverter(); |
| 3629 | 3769 | |
| 3770 | + if (!intp(json["json_converter"])) error("Expected integer"); | |
| 3630 | 3771 | retval.json_converter = json["json_converter"]; |
| 3631 | 3772 | |
| 3632 | 3773 | return retval; |
| @@ -3647,6 +3788,7 @@ class JsonSerializer { | ||
| 3647 | 3788 | JsonSerializer JsonSerializer_from_JSON(mixed json) { |
| 3648 | 3789 | JsonSerializer retval = JsonSerializer(); |
| 3649 | 3790 | |
| 3791 | + if (!intp(json["json_serializer"])) error("Expected integer"); | |
| 3650 | 3792 | retval.json_serializer = json["json_serializer"]; |
| 3651 | 3793 | |
| 3652 | 3794 | return retval; |
| @@ -3667,6 +3809,7 @@ class JsonToken { | ||
| 3667 | 3809 | JsonToken JsonToken_from_JSON(mixed json) { |
| 3668 | 3810 | JsonToken retval = JsonToken(); |
| 3669 | 3811 | |
| 3812 | + if (!intp(json["json_token"])) error("Expected integer"); | |
| 3670 | 3813 | retval.json_token = json["json_token"]; |
| 3671 | 3814 | |
| 3672 | 3815 | return retval; |
| @@ -3687,6 +3830,7 @@ class JsonWriter { | ||
| 3687 | 3830 | JsonWriter JsonWriter_from_JSON(mixed json) { |
| 3688 | 3831 | JsonWriter retval = JsonWriter(); |
| 3689 | 3832 | |
| 3833 | + if (!intp(json["json_writer"])) error("Expected integer"); | |
| 3690 | 3834 | retval.json_writer = json["json_writer"]; |
| 3691 | 3835 | |
| 3692 | 3836 | return retval; |
| @@ -3707,6 +3851,7 @@ class Lazy { | ||
| 3707 | 3851 | Lazy Lazy_from_JSON(mixed json) { |
| 3708 | 3852 | Lazy retval = Lazy(); |
| 3709 | 3853 | |
| 3854 | + if (!intp(json["lazy"])) error("Expected integer"); | |
| 3710 | 3855 | retval.lazy = json["lazy"]; |
| 3711 | 3856 | |
| 3712 | 3857 | return retval; |
| @@ -3727,6 +3872,7 @@ class Left { | ||
| 3727 | 3872 | Left Left_from_JSON(mixed json) { |
| 3728 | 3873 | Left retval = Left(); |
| 3729 | 3874 | |
| 3875 | + if (!intp(json["left"])) error("Expected integer"); | |
| 3730 | 3876 | retval.left = json["left"]; |
| 3731 | 3877 | |
| 3732 | 3878 | return retval; |
| @@ -3747,6 +3893,7 @@ class Let { | ||
| 3747 | 3893 | Let Let_from_JSON(mixed json) { |
| 3748 | 3894 | Let retval = Let(); |
| 3749 | 3895 | |
| 3896 | + if (!intp(json["let"])) error("Expected integer"); | |
| 3750 | 3897 | retval.let = json["let"]; |
| 3751 | 3898 | |
| 3752 | 3899 | return retval; |
| @@ -3767,6 +3914,7 @@ class List { | ||
| 3767 | 3914 | List List_from_JSON(mixed json) { |
| 3768 | 3915 | List retval = List(); |
| 3769 | 3916 | |
| 3917 | + if (!intp(json["list"])) error("Expected integer"); | |
| 3770 | 3918 | retval.list = json["list"]; |
| 3771 | 3919 | |
| 3772 | 3920 | return retval; |
| @@ -3787,6 +3935,7 @@ class Lock { | ||
| 3787 | 3935 | Lock Lock_from_JSON(mixed json) { |
| 3788 | 3936 | Lock retval = Lock(); |
| 3789 | 3937 | |
| 3938 | + if (!intp(json["lock"])) error("Expected integer"); | |
| 3790 | 3939 | retval.lock = json["lock"]; |
| 3791 | 3940 | |
| 3792 | 3941 | return retval; |
| @@ -3807,6 +3956,7 @@ class Long { | ||
| 3807 | 3956 | Long Long_from_JSON(mixed json) { |
| 3808 | 3957 | Long retval = Long(); |
| 3809 | 3958 | |
| 3959 | + if (!intp(json["long"])) error("Expected integer"); | |
| 3810 | 3960 | retval.long = json["long"]; |
| 3811 | 3961 | |
| 3812 | 3962 | return retval; |
| @@ -3827,6 +3977,7 @@ class Map { | ||
| 3827 | 3977 | Map Map_from_JSON(mixed json) { |
| 3828 | 3978 | Map retval = Map(); |
| 3829 | 3979 | |
| 3980 | + if (!intp(json["map"])) error("Expected integer"); | |
| 3830 | 3981 | retval.map = json["map"]; |
| 3831 | 3982 | |
| 3832 | 3983 | return retval; |
| @@ -3847,6 +3998,7 @@ class MetadataPropertyHandling { | ||
| 3847 | 3998 | MetadataPropertyHandling MetadataPropertyHandling_from_JSON(mixed json) { |
| 3848 | 3999 | MetadataPropertyHandling retval = MetadataPropertyHandling(); |
| 3849 | 4000 | |
| 4001 | + if (!intp(json["metadata_property_handling"])) error("Expected integer"); | |
| 3850 | 4002 | retval.metadata_property_handling = json["metadata_property_handling"]; |
| 3851 | 4003 | |
| 3852 | 4004 | return retval; |
| @@ -3867,6 +4019,7 @@ class Module { | ||
| 3867 | 4019 | Module Module_from_JSON(mixed json) { |
| 3868 | 4020 | Module retval = Module(); |
| 3869 | 4021 | |
| 4022 | + if (!intp(json["module"])) error("Expected integer"); | |
| 3870 | 4023 | retval.module = json["module"]; |
| 3871 | 4024 | |
| 3872 | 4025 | return retval; |
| @@ -3887,6 +4040,7 @@ class Mutable { | ||
| 3887 | 4040 | Mutable Mutable_from_JSON(mixed json) { |
| 3888 | 4041 | Mutable retval = Mutable(); |
| 3889 | 4042 | |
| 4043 | + if (!intp(json["mutable"])) error("Expected integer"); | |
| 3890 | 4044 | retval.mutable = json["mutable"]; |
| 3891 | 4045 | |
| 3892 | 4046 | return retval; |
| @@ -3907,6 +4061,7 @@ class Mutating { | ||
| 3907 | 4061 | Mutating Mutating_from_JSON(mixed json) { |
| 3908 | 4062 | Mutating retval = Mutating(); |
| 3909 | 4063 | |
| 4064 | + if (!intp(json["mutating"])) error("Expected integer"); | |
| 3910 | 4065 | retval.mutating = json["mutating"]; |
| 3911 | 4066 | |
| 3912 | 4067 | return retval; |
| @@ -3927,6 +4082,7 @@ class Namespace { | ||
| 3927 | 4082 | Namespace Namespace_from_JSON(mixed json) { |
| 3928 | 4083 | Namespace retval = Namespace(); |
| 3929 | 4084 | |
| 4085 | + if (!intp(json["namespace"])) error("Expected integer"); | |
| 3930 | 4086 | retval.namespace = json["namespace"]; |
| 3931 | 4087 | |
| 3932 | 4088 | return retval; |
| @@ -3947,6 +4103,7 @@ class Native { | ||
| 3947 | 4103 | Native Native_from_JSON(mixed json) { |
| 3948 | 4104 | Native retval = Native(); |
| 3949 | 4105 | |
| 4106 | + if (!intp(json["native"])) error("Expected integer"); | |
| 3950 | 4107 | retval.native = json["native"]; |
| 3951 | 4108 | |
| 3952 | 4109 | return retval; |
| @@ -3967,6 +4124,7 @@ class New { | ||
| 3967 | 4124 | New New_from_JSON(mixed json) { |
| 3968 | 4125 | New retval = New(); |
| 3969 | 4126 | |
| 4127 | + if (!intp(json["new"])) error("Expected integer"); | |
| 3970 | 4128 | retval.new = json["new"]; |
| 3971 | 4129 | |
| 3972 | 4130 | return retval; |
| @@ -3987,6 +4145,7 @@ class Newtonsoft { | ||
| 3987 | 4145 | Newtonsoft Newtonsoft_from_JSON(mixed json) { |
| 3988 | 4146 | Newtonsoft retval = Newtonsoft(); |
| 3989 | 4147 | |
| 4148 | + if (!intp(json["newtonsoft"])) error("Expected integer"); | |
| 3990 | 4149 | retval.newtonsoft = json["newtonsoft"]; |
| 3991 | 4150 | |
| 3992 | 4151 | return retval; |
| @@ -4007,6 +4166,7 @@ class Nil { | ||
| 4007 | 4166 | Nil Nil_from_JSON(mixed json) { |
| 4008 | 4167 | Nil retval = Nil(); |
| 4009 | 4168 | |
| 4169 | + if (!intp(json["nil"])) error("Expected integer"); | |
| 4010 | 4170 | retval.nil = json["nil"]; |
| 4011 | 4171 | |
| 4012 | 4172 | return retval; |
| @@ -4027,6 +4187,7 @@ class No { | ||
| 4027 | 4187 | No No_from_JSON(mixed json) { |
| 4028 | 4188 | No retval = No(); |
| 4029 | 4189 | |
| 4190 | + if (!intp(json["NO"])) error("Expected integer"); | |
| 4030 | 4191 | retval.no = json["NO"]; |
| 4031 | 4192 | |
| 4032 | 4193 | return retval; |
| @@ -4047,6 +4208,7 @@ class Noexcept { | ||
| 4047 | 4208 | Noexcept Noexcept_from_JSON(mixed json) { |
| 4048 | 4209 | Noexcept retval = Noexcept(); |
| 4049 | 4210 | |
| 4211 | + if (!intp(json["noexcept"])) error("Expected integer"); | |
| 4050 | 4212 | retval.noexcept = json["noexcept"]; |
| 4051 | 4213 | |
| 4052 | 4214 | return retval; |
| @@ -4067,6 +4229,7 @@ class Nonatomic { | ||
| 4067 | 4229 | Nonatomic Nonatomic_from_JSON(mixed json) { |
| 4068 | 4230 | Nonatomic retval = Nonatomic(); |
| 4069 | 4231 | |
| 4232 | + if (!intp(json["nonatomic"])) error("Expected integer"); | |
| 4070 | 4233 | retval.nonatomic = json["nonatomic"]; |
| 4071 | 4234 | |
| 4072 | 4235 | return retval; |
| @@ -4087,6 +4250,7 @@ class None { | ||
| 4087 | 4250 | None None_from_JSON(mixed json) { |
| 4088 | 4251 | None retval = None(); |
| 4089 | 4252 | |
| 4253 | + if (!intp(json["None"])) error("Expected integer"); | |
| 4090 | 4254 | retval.none = json["None"]; |
| 4091 | 4255 | |
| 4092 | 4256 | return retval; |
| @@ -4107,6 +4271,7 @@ class Nonlocal { | ||
| 4107 | 4271 | Nonlocal Nonlocal_from_JSON(mixed json) { |
| 4108 | 4272 | Nonlocal retval = Nonlocal(); |
| 4109 | 4273 | |
| 4274 | + if (!intp(json["nonlocal"])) error("Expected integer"); | |
| 4110 | 4275 | retval.nonlocal = json["nonlocal"]; |
| 4111 | 4276 | |
| 4112 | 4277 | return retval; |
| @@ -4127,6 +4292,7 @@ class Nonmutating { | ||
| 4127 | 4292 | Nonmutating Nonmutating_from_JSON(mixed json) { |
| 4128 | 4293 | Nonmutating retval = Nonmutating(); |
| 4129 | 4294 | |
| 4295 | + if (!intp(json["nonmutating"])) error("Expected integer"); | |
| 4130 | 4296 | retval.nonmutating = json["nonmutating"]; |
| 4131 | 4297 | |
| 4132 | 4298 | return retval; |
| @@ -4147,6 +4313,7 @@ class Not { | ||
| 4147 | 4313 | Not Not_from_JSON(mixed json) { |
| 4148 | 4314 | Not retval = Not(); |
| 4149 | 4315 | |
| 4316 | + if (!intp(json["not"])) error("Expected integer"); | |
| 4150 | 4317 | retval.not = json["not"]; |
| 4151 | 4318 | |
| 4152 | 4319 | return retval; |
| @@ -4167,6 +4334,7 @@ class NotEq { | ||
| 4167 | 4334 | NotEq NotEq_from_JSON(mixed json) { |
| 4168 | 4335 | NotEq retval = NotEq(); |
| 4169 | 4336 | |
| 4337 | + if (!intp(json["not_eq"])) error("Expected integer"); | |
| 4170 | 4338 | retval.not_eq = json["not_eq"]; |
| 4171 | 4339 | |
| 4172 | 4340 | return retval; |
| @@ -4187,6 +4355,7 @@ class NsString { | ||
| 4187 | 4355 | NsString NsString_from_JSON(mixed json) { |
| 4188 | 4356 | NsString retval = NsString(); |
| 4189 | 4357 | |
| 4358 | + if (!intp(json["NSString"])) error("Expected integer"); | |
| 4190 | 4359 | retval.ns_string = json["NSString"]; |
| 4191 | 4360 | |
| 4192 | 4361 | return retval; |
| @@ -4207,6 +4376,7 @@ class Null { | ||
| 4207 | 4376 | Null Null_from_JSON(mixed json) { |
| 4208 | 4377 | Null retval = Null(); |
| 4209 | 4378 | |
| 4379 | + if (!intp(json["NULL"])) error("Expected integer"); | |
| 4210 | 4380 | retval.null = json["NULL"]; |
| 4211 | 4381 | |
| 4212 | 4382 | return retval; |
| @@ -4227,6 +4397,7 @@ class Nullptr { | ||
| 4227 | 4397 | Nullptr Nullptr_from_JSON(mixed json) { |
| 4228 | 4398 | Nullptr retval = Nullptr(); |
| 4229 | 4399 | |
| 4400 | + if (!intp(json["nullptr"])) error("Expected integer"); | |
| 4230 | 4401 | retval.nullptr = json["nullptr"]; |
| 4231 | 4402 | |
| 4232 | 4403 | return retval; |
| @@ -4247,6 +4418,7 @@ class Number { | ||
| 4247 | 4418 | Number Number_from_JSON(mixed json) { |
| 4248 | 4419 | Number retval = Number(); |
| 4249 | 4420 | |
| 4421 | + if (!intp(json["number"])) error("Expected integer"); | |
| 4250 | 4422 | retval.number = json["number"]; |
| 4251 | 4423 | |
| 4252 | 4424 | return retval; |
| @@ -4267,6 +4439,7 @@ class Lambda { | ||
| 4267 | 4439 | Lambda Lambda_from_JSON(mixed json) { |
| 4268 | 4440 | Lambda retval = Lambda(); |
| 4269 | 4441 | |
| 4442 | + if (!intp(json["lambda"])) error("Expected integer"); | |
| 4270 | 4443 | retval.lambda_lambda = json["lambda"]; |
| 4271 | 4444 | |
| 4272 | 4445 | return retval; |
| @@ -4287,6 +4460,7 @@ class NoneClass { | ||
| 4287 | 4460 | NoneClass NoneClass_from_JSON(mixed json) { |
| 4288 | 4461 | NoneClass retval = NoneClass(); |
| 4289 | 4462 | |
| 4463 | + if (!intp(json["none"])) error("Expected integer"); | |
| 4290 | 4464 | retval.none = json["none"]; |
| 4291 | 4465 | |
| 4292 | 4466 | return retval; |
| @@ -4307,6 +4481,7 @@ class NullClass { | ||
| 4307 | 4481 | NullClass NullClass_from_JSON(mixed json) { |
| 4308 | 4482 | NullClass retval = NullClass(); |
| 4309 | 4483 | |
| 4484 | + if (!intp(json["null"])) error("Expected integer"); | |
| 4310 | 4485 | retval.null = json["null"]; |
| 4311 | 4486 | |
| 4312 | 4487 | return retval; |
| @@ -4327,6 +4502,7 @@ class Object { | ||
| 4327 | 4502 | Object Object_from_JSON(mixed json) { |
| 4328 | 4503 | Object retval = Object(); |
| 4329 | 4504 | |
| 4505 | + if (!intp(json["object"])) error("Expected integer"); | |
| 4330 | 4506 | retval.object_object = json["object"]; |
| 4331 | 4507 | |
| 4332 | 4508 | return retval; |
| @@ -4347,6 +4523,7 @@ class Optional { | ||
| 4347 | 4523 | Optional Optional_from_JSON(mixed json) { |
| 4348 | 4524 | Optional retval = Optional(); |
| 4349 | 4525 | |
| 4526 | + if (!intp(json["optional"])) error("Expected integer"); | |
| 4350 | 4527 | retval.optional_optional = json["optional"]; |
| 4351 | 4528 | |
| 4352 | 4529 | return retval; |
| @@ -4367,6 +4544,7 @@ class Private { | ||
| 4367 | 4544 | Private Private_from_JSON(mixed json) { |
| 4368 | 4545 | Private retval = Private(); |
| 4369 | 4546 | |
| 4547 | + if (!intp(json["private"])) error("Expected integer"); | |
| 4370 | 4548 | retval.private_private = json["private"]; |
| 4371 | 4549 | |
| 4372 | 4550 | return retval; |
| @@ -4387,6 +4565,7 @@ class Protected { | ||
| 4387 | 4565 | Protected Protected_from_JSON(mixed json) { |
| 4388 | 4566 | Protected retval = Protected(); |
| 4389 | 4567 | |
| 4568 | + if (!intp(json["protected"])) error("Expected integer"); | |
| 4390 | 4569 | retval.protected_protected = json["protected"]; |
| 4391 | 4570 | |
| 4392 | 4571 | return retval; |
| @@ -4407,6 +4586,7 @@ class ProtocolClass { | ||
| 4407 | 4586 | ProtocolClass ProtocolClass_from_JSON(mixed json) { |
| 4408 | 4587 | ProtocolClass retval = ProtocolClass(); |
| 4409 | 4588 | |
| 4589 | + if (!intp(json["protocol"])) error("Expected integer"); | |
| 4410 | 4590 | retval.protocol = json["protocol"]; |
| 4411 | 4591 | |
| 4412 | 4592 | return retval; |
| @@ -4427,6 +4607,7 @@ class Of { | ||
| 4427 | 4607 | Of Of_from_JSON(mixed json) { |
| 4428 | 4608 | Of retval = Of(); |
| 4429 | 4609 | |
| 4610 | + if (!intp(json["of"])) error("Expected integer"); | |
| 4430 | 4611 | retval.of = json["of"]; |
| 4431 | 4612 | |
| 4432 | 4613 | return retval; |
| @@ -4447,6 +4628,7 @@ class Oneway { | ||
| 4447 | 4628 | Oneway Oneway_from_JSON(mixed json) { |
| 4448 | 4629 | Oneway retval = Oneway(); |
| 4449 | 4630 | |
| 4631 | + if (!intp(json["oneway"])) error("Expected integer"); | |
| 4450 | 4632 | retval.oneway = json["oneway"]; |
| 4451 | 4633 | |
| 4452 | 4634 | return retval; |
| @@ -4467,6 +4649,7 @@ class Open { | ||
| 4467 | 4649 | Open Open_from_JSON(mixed json) { |
| 4468 | 4650 | Open retval = Open(); |
| 4469 | 4651 | |
| 4652 | + if (!intp(json["open"])) error("Expected integer"); | |
| 4470 | 4653 | retval.open = json["open"]; |
| 4471 | 4654 | |
| 4472 | 4655 | return retval; |
| @@ -4487,6 +4670,7 @@ class Operator { | ||
| 4487 | 4670 | Operator Operator_from_JSON(mixed json) { |
| 4488 | 4671 | Operator retval = Operator(); |
| 4489 | 4672 | |
| 4673 | + if (!intp(json["operator"])) error("Expected integer"); | |
| 4490 | 4674 | retval.operator = json["operator"]; |
| 4491 | 4675 | |
| 4492 | 4676 | return retval; |
| @@ -4507,6 +4691,7 @@ class Or { | ||
| 4507 | 4691 | Or Or_from_JSON(mixed json) { |
| 4508 | 4692 | Or retval = Or(); |
| 4509 | 4693 | |
| 4694 | + if (!intp(json["or"])) error("Expected integer"); | |
| 4510 | 4695 | retval.or = json["or"]; |
| 4511 | 4696 | |
| 4512 | 4697 | return retval; |
| @@ -4527,6 +4712,7 @@ class OrEq { | ||
| 4527 | 4712 | OrEq OrEq_from_JSON(mixed json) { |
| 4528 | 4713 | OrEq retval = OrEq(); |
| 4529 | 4714 | |
| 4715 | + if (!intp(json["or_eq"])) error("Expected integer"); | |
| 4530 | 4716 | retval.or_eq = json["or_eq"]; |
| 4531 | 4717 | |
| 4532 | 4718 | return retval; |
| @@ -4547,6 +4733,7 @@ class Out { | ||
| 4547 | 4733 | Out Out_from_JSON(mixed json) { |
| 4548 | 4734 | Out retval = Out(); |
| 4549 | 4735 | |
| 4736 | + if (!intp(json["out"])) error("Expected integer"); | |
| 4550 | 4737 | retval.out = json["out"]; |
| 4551 | 4738 | |
| 4552 | 4739 | return retval; |
| @@ -4567,6 +4754,7 @@ class Override { | ||
| 4567 | 4754 | Override Override_from_JSON(mixed json) { |
| 4568 | 4755 | Override retval = Override(); |
| 4569 | 4756 | |
| 4757 | + if (!intp(json["override"])) error("Expected integer"); | |
| 4570 | 4758 | retval.override = json["override"]; |
| 4571 | 4759 | |
| 4572 | 4760 | return retval; |
| @@ -4587,6 +4775,7 @@ class Package { | ||
| 4587 | 4775 | Package Package_from_JSON(mixed json) { |
| 4588 | 4776 | Package retval = Package(); |
| 4589 | 4777 | |
| 4778 | + if (!intp(json["package"])) error("Expected integer"); | |
| 4590 | 4779 | retval.package = json["package"]; |
| 4591 | 4780 | |
| 4592 | 4781 | return retval; |
| @@ -4607,6 +4796,7 @@ class Params { | ||
| 4607 | 4796 | Params Params_from_JSON(mixed json) { |
| 4608 | 4797 | Params retval = Params(); |
| 4609 | 4798 | |
| 4799 | + if (!intp(json["params"])) error("Expected integer"); | |
| 4610 | 4800 | retval.params = json["params"]; |
| 4611 | 4801 | |
| 4612 | 4802 | return retval; |
| @@ -4627,6 +4817,7 @@ class Pass { | ||
| 4627 | 4817 | Pass Pass_from_JSON(mixed json) { |
| 4628 | 4818 | Pass retval = Pass(); |
| 4629 | 4819 | |
| 4820 | + if (!intp(json["pass"])) error("Expected integer"); | |
| 4630 | 4821 | retval.pass = json["pass"]; |
| 4631 | 4822 | |
| 4632 | 4823 | return retval; |
| @@ -4647,6 +4838,7 @@ class Port { | ||
| 4647 | 4838 | Port Port_from_JSON(mixed json) { |
| 4648 | 4839 | Port retval = Port(); |
| 4649 | 4840 | |
| 4841 | + if (!intp(json["port"])) error("Expected integer"); | |
| 4650 | 4842 | retval.port = json["port"]; |
| 4651 | 4843 | |
| 4652 | 4844 | return retval; |
| @@ -4667,6 +4859,7 @@ class Postfix { | ||
| 4667 | 4859 | Postfix Postfix_from_JSON(mixed json) { |
| 4668 | 4860 | Postfix retval = Postfix(); |
| 4669 | 4861 | |
| 4862 | + if (!intp(json["postfix"])) error("Expected integer"); | |
| 4670 | 4863 | retval.postfix = json["postfix"]; |
| 4671 | 4864 | |
| 4672 | 4865 | return retval; |
| @@ -4687,6 +4880,7 @@ class Precedence { | ||
| 4687 | 4880 | Precedence Precedence_from_JSON(mixed json) { |
| 4688 | 4881 | Precedence retval = Precedence(); |
| 4689 | 4882 | |
| 4883 | + if (!intp(json["precedence"])) error("Expected integer"); | |
| 4690 | 4884 | retval.precedence = json["precedence"]; |
| 4691 | 4885 | |
| 4692 | 4886 | return retval; |
| @@ -4707,6 +4901,7 @@ class Prefix { | ||
| 4707 | 4901 | Prefix Prefix_from_JSON(mixed json) { |
| 4708 | 4902 | Prefix retval = Prefix(); |
| 4709 | 4903 | |
| 4904 | + if (!intp(json["prefix"])) error("Expected integer"); | |
| 4710 | 4905 | retval.prefix = json["prefix"]; |
| 4711 | 4906 | |
| 4712 | 4907 | return retval; |
| @@ -4727,6 +4922,7 @@ class Print { | ||
| 4727 | 4922 | Print Print_from_JSON(mixed json) { |
| 4728 | 4923 | Print retval = Print(); |
| 4729 | 4924 | |
| 4925 | + if (!intp(json["print"])) error("Expected integer"); | |
| 4730 | 4926 | retval.print = json["print"]; |
| 4731 | 4927 | |
| 4732 | 4928 | return retval; |
| @@ -4747,6 +4943,7 @@ class PrintMembers { | ||
| 4747 | 4943 | PrintMembers PrintMembers_from_JSON(mixed json) { |
| 4748 | 4944 | PrintMembers retval = PrintMembers(); |
| 4749 | 4945 | |
| 4946 | + if (!intp(json["printMembers"])) error("Expected integer"); | |
| 4750 | 4947 | retval.print_members = json["printMembers"]; |
| 4751 | 4948 | |
| 4752 | 4949 | return retval; |
| @@ -4767,6 +4964,7 @@ class Printf { | ||
| 4767 | 4964 | Printf Printf_from_JSON(mixed json) { |
| 4768 | 4965 | Printf retval = Printf(); |
| 4769 | 4966 | |
| 4967 | + if (!intp(json["printf"])) error("Expected integer"); | |
| 4770 | 4968 | retval.printf = json["printf"]; |
| 4771 | 4969 | |
| 4772 | 4970 | return retval; |
| @@ -4787,6 +4985,7 @@ class Protocol { | ||
| 4787 | 4985 | Protocol Protocol_from_JSON(mixed json) { |
| 4788 | 4986 | Protocol retval = Protocol(); |
| 4789 | 4987 | |
| 4988 | + if (!intp(json["Protocol"])) error("Expected integer"); | |
| 4790 | 4989 | retval.protocol = json["Protocol"]; |
| 4791 | 4990 | |
| 4792 | 4991 | return retval; |
| @@ -4935,6 +5134,7 @@ class Obj4 { | ||
| 4935 | 5134 | Obj4 Obj4_from_JSON(mixed json) { |
| 4936 | 5135 | Obj4 retval = Obj4(); |
| 4937 | 5136 | |
| 5137 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 4938 | 5138 | retval.dummy = json["dummy"]; |
| 4939 | 5139 | Public_from_JSON(json["public"]); |
| 4940 | 5140 | retval.obj4_public = json["public"]; |
| @@ -5083,6 +5283,7 @@ class Public { | ||
| 5083 | 5283 | Public Public_from_JSON(mixed json) { |
| 5084 | 5284 | Public retval = Public(); |
| 5085 | 5285 | |
| 5286 | + if (!intp(json["public"])) error("Expected integer"); | |
| 5086 | 5287 | retval.public_public = json["public"]; |
| 5087 | 5288 | |
| 5088 | 5289 | return retval; |
| @@ -5103,6 +5304,7 @@ class Return { | ||
| 5103 | 5304 | Return Return_from_JSON(mixed json) { |
| 5104 | 5305 | Return retval = Return(); |
| 5105 | 5306 | |
| 5307 | + if (!intp(json["return"])) error("Expected integer"); | |
| 5106 | 5308 | retval.return_return = json["return"]; |
| 5107 | 5309 | |
| 5108 | 5310 | return retval; |
| @@ -5123,6 +5325,7 @@ class SelfClass { | ||
| 5123 | 5325 | SelfClass SelfClass_from_JSON(mixed json) { |
| 5124 | 5326 | SelfClass retval = SelfClass(); |
| 5125 | 5327 | |
| 5328 | + if (!intp(json["self"])) error("Expected integer"); | |
| 5126 | 5329 | retval.self = json["self"]; |
| 5127 | 5330 | |
| 5128 | 5331 | return retval; |
| @@ -5143,6 +5346,7 @@ class Static { | ||
| 5143 | 5346 | Static Static_from_JSON(mixed json) { |
| 5144 | 5347 | Static retval = Static(); |
| 5145 | 5348 | |
| 5349 | + if (!intp(json["static"])) error("Expected integer"); | |
| 5146 | 5350 | retval.static_static = json["static"]; |
| 5147 | 5351 | |
| 5148 | 5352 | return retval; |
| @@ -5163,6 +5367,7 @@ class String { | ||
| 5163 | 5367 | String String_from_JSON(mixed json) { |
| 5164 | 5368 | String retval = String(); |
| 5165 | 5369 | |
| 5370 | + if (!intp(json["string"])) error("Expected integer"); | |
| 5166 | 5371 | retval.string_string = json["string"]; |
| 5167 | 5372 | |
| 5168 | 5373 | return retval; |
| @@ -5183,6 +5388,7 @@ class Switch { | ||
| 5183 | 5388 | Switch Switch_from_JSON(mixed json) { |
| 5184 | 5389 | Switch retval = Switch(); |
| 5185 | 5390 | |
| 5391 | + if (!intp(json["switch"])) error("Expected integer"); | |
| 5186 | 5392 | retval.switch_switch = json["switch"]; |
| 5187 | 5393 | |
| 5188 | 5394 | return retval; |
| @@ -5203,6 +5409,7 @@ class TrueClass { | ||
| 5203 | 5409 | TrueClass TrueClass_from_JSON(mixed json) { |
| 5204 | 5410 | TrueClass retval = TrueClass(); |
| 5205 | 5411 | |
| 5412 | + if (!intp(json["true"])) error("Expected integer"); | |
| 5206 | 5413 | retval.true = json["true"]; |
| 5207 | 5414 | |
| 5208 | 5415 | return retval; |
| @@ -5223,6 +5430,7 @@ class TypeClass { | ||
| 5223 | 5430 | TypeClass TypeClass_from_JSON(mixed json) { |
| 5224 | 5431 | TypeClass retval = TypeClass(); |
| 5225 | 5432 | |
| 5433 | + if (!intp(json["type"])) error("Expected integer"); | |
| 5226 | 5434 | retval.type = json["type"]; |
| 5227 | 5435 | |
| 5228 | 5436 | return retval; |
| @@ -5243,6 +5451,7 @@ class Typedef { | ||
| 5243 | 5451 | Typedef Typedef_from_JSON(mixed json) { |
| 5244 | 5452 | Typedef retval = Typedef(); |
| 5245 | 5453 | |
| 5454 | + if (!intp(json["typedef"])) error("Expected integer"); | |
| 5246 | 5455 | retval.typedef_typedef = json["typedef"]; |
| 5247 | 5456 | |
| 5248 | 5457 | return retval; |
| @@ -5263,6 +5472,7 @@ class Typeof { | ||
| 5263 | 5472 | Typeof Typeof_from_JSON(mixed json) { |
| 5264 | 5473 | Typeof retval = Typeof(); |
| 5265 | 5474 | |
| 5475 | + if (!intp(json["typeof"])) error("Expected integer"); | |
| 5266 | 5476 | retval.typeof_typeof = json["typeof"]; |
| 5267 | 5477 | |
| 5268 | 5478 | return retval; |
| @@ -5283,6 +5493,7 @@ class Quicktype { | ||
| 5283 | 5493 | Quicktype Quicktype_from_JSON(mixed json) { |
| 5284 | 5494 | Quicktype retval = Quicktype(); |
| 5285 | 5495 | |
| 5496 | + if (!intp(json["quicktype"])) error("Expected integer"); | |
| 5286 | 5497 | retval.quicktype = json["quicktype"]; |
| 5287 | 5498 | |
| 5288 | 5499 | return retval; |
| @@ -5303,6 +5514,7 @@ class Raise { | ||
| 5303 | 5514 | Raise Raise_from_JSON(mixed json) { |
| 5304 | 5515 | Raise retval = Raise(); |
| 5305 | 5516 | |
| 5517 | + if (!intp(json["raise"])) error("Expected integer"); | |
| 5306 | 5518 | retval.raise = json["raise"]; |
| 5307 | 5519 | |
| 5308 | 5520 | return retval; |
| @@ -5323,6 +5535,7 @@ class Range { | ||
| 5323 | 5535 | Range Range_from_JSON(mixed json) { |
| 5324 | 5536 | Range retval = Range(); |
| 5325 | 5537 | |
| 5538 | + if (!intp(json["range"])) error("Expected integer"); | |
| 5326 | 5539 | retval.range = json["range"]; |
| 5327 | 5540 | |
| 5328 | 5541 | return retval; |
| @@ -5343,6 +5556,7 @@ class Readonly { | ||
| 5343 | 5556 | Readonly Readonly_from_JSON(mixed json) { |
| 5344 | 5557 | Readonly retval = Readonly(); |
| 5345 | 5558 | |
| 5559 | + if (!intp(json["readonly"])) error("Expected integer"); | |
| 5346 | 5560 | retval.readonly = json["readonly"]; |
| 5347 | 5561 | |
| 5348 | 5562 | return retval; |
| @@ -5363,6 +5577,7 @@ class Ref { | ||
| 5363 | 5577 | Ref Ref_from_JSON(mixed json) { |
| 5364 | 5578 | Ref retval = Ref(); |
| 5365 | 5579 | |
| 5580 | + if (!intp(json["ref"])) error("Expected integer"); | |
| 5366 | 5581 | retval.ref = json["ref"]; |
| 5367 | 5582 | |
| 5368 | 5583 | return retval; |
| @@ -5383,6 +5598,7 @@ class Register { | ||
| 5383 | 5598 | Register Register_from_JSON(mixed json) { |
| 5384 | 5599 | Register retval = Register(); |
| 5385 | 5600 | |
| 5601 | + if (!intp(json["register"])) error("Expected integer"); | |
| 5386 | 5602 | retval.register = json["register"]; |
| 5387 | 5603 | |
| 5388 | 5604 | return retval; |
| @@ -5403,6 +5619,7 @@ class ReinterpretCast { | ||
| 5403 | 5619 | ReinterpretCast ReinterpretCast_from_JSON(mixed json) { |
| 5404 | 5620 | ReinterpretCast retval = ReinterpretCast(); |
| 5405 | 5621 | |
| 5622 | + if (!intp(json["reinterpret_cast"])) error("Expected integer"); | |
| 5406 | 5623 | retval.reinterpret_cast = json["reinterpret_cast"]; |
| 5407 | 5624 | |
| 5408 | 5625 | return retval; |
| @@ -5423,6 +5640,7 @@ class Repeat { | ||
| 5423 | 5640 | Repeat Repeat_from_JSON(mixed json) { |
| 5424 | 5641 | Repeat retval = Repeat(); |
| 5425 | 5642 | |
| 5643 | + if (!intp(json["repeat"])) error("Expected integer"); | |
| 5426 | 5644 | retval.repeat = json["repeat"]; |
| 5427 | 5645 | |
| 5428 | 5646 | return retval; |
| @@ -5443,6 +5661,7 @@ class Require { | ||
| 5443 | 5661 | Require Require_from_JSON(mixed json) { |
| 5444 | 5662 | Require retval = Require(); |
| 5445 | 5663 | |
| 5664 | + if (!intp(json["require"])) error("Expected integer"); | |
| 5446 | 5665 | retval.require = json["require"]; |
| 5447 | 5666 | |
| 5448 | 5667 | return retval; |
| @@ -5463,6 +5682,7 @@ class Required { | ||
| 5463 | 5682 | Required Required_from_JSON(mixed json) { |
| 5464 | 5683 | Required retval = Required(); |
| 5465 | 5684 | |
| 5685 | + if (!intp(json["required"])) error("Expected integer"); | |
| 5466 | 5686 | retval.required = json["required"]; |
| 5467 | 5687 | |
| 5468 | 5688 | return retval; |
| @@ -5483,6 +5703,7 @@ class Requires { | ||
| 5483 | 5703 | Requires Requires_from_JSON(mixed json) { |
| 5484 | 5704 | Requires retval = Requires(); |
| 5485 | 5705 | |
| 5706 | + if (!intp(json["requires"])) error("Expected integer"); | |
| 5486 | 5707 | retval.requires = json["requires"]; |
| 5487 | 5708 | |
| 5488 | 5709 | return retval; |
| @@ -5503,6 +5724,7 @@ class Restrict { | ||
| 5503 | 5724 | Restrict Restrict_from_JSON(mixed json) { |
| 5504 | 5725 | Restrict retval = Restrict(); |
| 5505 | 5726 | |
| 5727 | + if (!intp(json["restrict"])) error("Expected integer"); | |
| 5506 | 5728 | retval.restrict = json["restrict"]; |
| 5507 | 5729 | |
| 5508 | 5730 | return retval; |
| @@ -5523,6 +5745,7 @@ class Retain { | ||
| 5523 | 5745 | Retain Retain_from_JSON(mixed json) { |
| 5524 | 5746 | Retain retval = Retain(); |
| 5525 | 5747 | |
| 5748 | + if (!intp(json["retain"])) error("Expected integer"); | |
| 5526 | 5749 | retval.retain = json["retain"]; |
| 5527 | 5750 | |
| 5528 | 5751 | return retval; |
| @@ -5543,6 +5766,7 @@ class Rethrows { | ||
| 5543 | 5766 | Rethrows Rethrows_from_JSON(mixed json) { |
| 5544 | 5767 | Rethrows retval = Rethrows(); |
| 5545 | 5768 | |
| 5769 | + if (!intp(json["rethrows"])) error("Expected integer"); | |
| 5546 | 5770 | retval.rethrows = json["rethrows"]; |
| 5547 | 5771 | |
| 5548 | 5772 | return retval; |
| @@ -5563,6 +5787,7 @@ class Right { | ||
| 5563 | 5787 | Right Right_from_JSON(mixed json) { |
| 5564 | 5788 | Right retval = Right(); |
| 5565 | 5789 | |
| 5790 | + if (!intp(json["right"])) error("Expected integer"); | |
| 5566 | 5791 | retval.right = json["right"]; |
| 5567 | 5792 | |
| 5568 | 5793 | return retval; |
| @@ -5583,6 +5808,7 @@ class Sbyte { | ||
| 5583 | 5808 | Sbyte Sbyte_from_JSON(mixed json) { |
| 5584 | 5809 | Sbyte retval = Sbyte(); |
| 5585 | 5810 | |
| 5811 | + if (!intp(json["sbyte"])) error("Expected integer"); | |
| 5586 | 5812 | retval.sbyte = json["sbyte"]; |
| 5587 | 5813 | |
| 5588 | 5814 | return retval; |
| @@ -5603,6 +5829,7 @@ class Sealed { | ||
| 5603 | 5829 | Sealed Sealed_from_JSON(mixed json) { |
| 5604 | 5830 | Sealed retval = Sealed(); |
| 5605 | 5831 | |
| 5832 | + if (!intp(json["sealed"])) error("Expected integer"); | |
| 5606 | 5833 | retval.sealed = json["sealed"]; |
| 5607 | 5834 | |
| 5608 | 5835 | return retval; |
| @@ -5623,6 +5850,7 @@ class Sel { | ||
| 5623 | 5850 | Sel Sel_from_JSON(mixed json) { |
| 5624 | 5851 | Sel retval = Sel(); |
| 5625 | 5852 | |
| 5853 | + if (!intp(json["SEL"])) error("Expected integer"); | |
| 5626 | 5854 | retval.sel = json["SEL"]; |
| 5627 | 5855 | |
| 5628 | 5856 | return retval; |
| @@ -5643,6 +5871,7 @@ class Select { | ||
| 5643 | 5871 | Select Select_from_JSON(mixed json) { |
| 5644 | 5872 | Select retval = Select(); |
| 5645 | 5873 | |
| 5874 | + if (!intp(json["select"])) error("Expected integer"); | |
| 5646 | 5875 | retval.select = json["select"]; |
| 5647 | 5876 | |
| 5648 | 5877 | return retval; |
| @@ -5663,6 +5892,7 @@ class Self { | ||
| 5663 | 5892 | Self Self_from_JSON(mixed json) { |
| 5664 | 5893 | Self retval = Self(); |
| 5665 | 5894 | |
| 5895 | + if (!intp(json["Self"])) error("Expected integer"); | |
| 5666 | 5896 | retval.self = json["Self"]; |
| 5667 | 5897 | |
| 5668 | 5898 | return retval; |
| @@ -5683,6 +5913,7 @@ class Serialize { | ||
| 5683 | 5913 | Serialize Serialize_from_JSON(mixed json) { |
| 5684 | 5914 | Serialize retval = Serialize(); |
| 5685 | 5915 | |
| 5916 | + if (!intp(json["serialize"])) error("Expected integer"); | |
| 5686 | 5917 | retval.serialize = json["serialize"]; |
| 5687 | 5918 | |
| 5688 | 5919 | return retval; |
| @@ -5703,6 +5934,7 @@ class Set { | ||
| 5703 | 5934 | Set Set_from_JSON(mixed json) { |
| 5704 | 5935 | Set retval = Set(); |
| 5705 | 5936 | |
| 5937 | + if (!intp(json["set"])) error("Expected integer"); | |
| 5706 | 5938 | retval.set = json["set"]; |
| 5707 | 5939 | |
| 5708 | 5940 | return retval; |
| @@ -5723,6 +5955,7 @@ class Short { | ||
| 5723 | 5955 | Short Short_from_JSON(mixed json) { |
| 5724 | 5956 | Short retval = Short(); |
| 5725 | 5957 | |
| 5958 | + if (!intp(json["short"])) error("Expected integer"); | |
| 5726 | 5959 | retval.short = json["short"]; |
| 5727 | 5960 | |
| 5728 | 5961 | return retval; |
| @@ -5743,6 +5976,7 @@ class Signed { | ||
| 5743 | 5976 | Signed Signed_from_JSON(mixed json) { |
| 5744 | 5977 | Signed retval = Signed(); |
| 5745 | 5978 | |
| 5979 | + if (!intp(json["signed"])) error("Expected integer"); | |
| 5746 | 5980 | retval.signed = json["signed"]; |
| 5747 | 5981 | |
| 5748 | 5982 | return retval; |
| @@ -5763,6 +5997,7 @@ class Sizeof { | ||
| 5763 | 5997 | Sizeof Sizeof_from_JSON(mixed json) { |
| 5764 | 5998 | Sizeof retval = Sizeof(); |
| 5765 | 5999 | |
| 6000 | + if (!intp(json["sizeof"])) error("Expected integer"); | |
| 5766 | 6001 | retval.sizeof = json["sizeof"]; |
| 5767 | 6002 | |
| 5768 | 6003 | return retval; |
| @@ -5783,6 +6018,7 @@ class Stackalloc { | ||
| 5783 | 6018 | Stackalloc Stackalloc_from_JSON(mixed json) { |
| 5784 | 6019 | Stackalloc retval = Stackalloc(); |
| 5785 | 6020 | |
| 6021 | + if (!intp(json["stackalloc"])) error("Expected integer"); | |
| 5786 | 6022 | retval.stackalloc = json["stackalloc"]; |
| 5787 | 6023 | |
| 5788 | 6024 | return retval; |
| @@ -5803,6 +6039,7 @@ class StaticAssert { | ||
| 5803 | 6039 | StaticAssert StaticAssert_from_JSON(mixed json) { |
| 5804 | 6040 | StaticAssert retval = StaticAssert(); |
| 5805 | 6041 | |
| 6042 | + if (!intp(json["static_assert"])) error("Expected integer"); | |
| 5806 | 6043 | retval.static_assert = json["static_assert"]; |
| 5807 | 6044 | |
| 5808 | 6045 | return retval; |
| @@ -5823,6 +6060,7 @@ class StaticCast { | ||
| 5823 | 6060 | StaticCast StaticCast_from_JSON(mixed json) { |
| 5824 | 6061 | StaticCast retval = StaticCast(); |
| 5825 | 6062 | |
| 6063 | + if (!intp(json["static_cast"])) error("Expected integer"); | |
| 5826 | 6064 | retval.static_cast = json["static_cast"]; |
| 5827 | 6065 | |
| 5828 | 6066 | return retval; |
| @@ -5843,6 +6081,7 @@ class Strictfp { | ||
| 5843 | 6081 | Strictfp Strictfp_from_JSON(mixed json) { |
| 5844 | 6082 | Strictfp retval = Strictfp(); |
| 5845 | 6083 | |
| 6084 | + if (!intp(json["strictfp"])) error("Expected integer"); | |
| 5846 | 6085 | retval.strictfp = json["strictfp"]; |
| 5847 | 6086 | |
| 5848 | 6087 | return retval; |
| @@ -5863,6 +6102,7 @@ class Struct { | ||
| 5863 | 6102 | Struct Struct_from_JSON(mixed json) { |
| 5864 | 6103 | Struct retval = Struct(); |
| 5865 | 6104 | |
| 6105 | + if (!intp(json["struct"])) error("Expected integer"); | |
| 5866 | 6106 | retval.struct = json["struct"]; |
| 5867 | 6107 | |
| 5868 | 6108 | return retval; |
| @@ -5883,6 +6123,7 @@ class Subscript { | ||
| 5883 | 6123 | Subscript Subscript_from_JSON(mixed json) { |
| 5884 | 6124 | Subscript retval = Subscript(); |
| 5885 | 6125 | |
| 6126 | + if (!intp(json["subscript"])) error("Expected integer"); | |
| 5886 | 6127 | retval.subscript = json["subscript"]; |
| 5887 | 6128 | |
| 5888 | 6129 | return retval; |
| @@ -5903,6 +6144,7 @@ class Super { | ||
| 5903 | 6144 | Super Super_from_JSON(mixed json) { |
| 5904 | 6145 | Super retval = Super(); |
| 5905 | 6146 | |
| 6147 | + if (!intp(json["super"])) error("Expected integer"); | |
| 5906 | 6148 | retval.super = json["super"]; |
| 5907 | 6149 | |
| 5908 | 6150 | return retval; |
| @@ -5923,6 +6165,7 @@ class Symbol { | ||
| 5923 | 6165 | Symbol Symbol_from_JSON(mixed json) { |
| 5924 | 6166 | Symbol retval = Symbol(); |
| 5925 | 6167 | |
| 6168 | + if (!intp(json["symbol"])) error("Expected integer"); | |
| 5926 | 6169 | retval.symbol = json["symbol"]; |
| 5927 | 6170 | |
| 5928 | 6171 | return retval; |
| @@ -5943,6 +6186,7 @@ class Synchronized { | ||
| 5943 | 6186 | Synchronized Synchronized_from_JSON(mixed json) { |
| 5944 | 6187 | Synchronized retval = Synchronized(); |
| 5945 | 6188 | |
| 6189 | + if (!intp(json["synchronized"])) error("Expected integer"); | |
| 5946 | 6190 | retval.synchronized = json["synchronized"]; |
| 5947 | 6191 | |
| 5948 | 6192 | return retval; |
| @@ -5963,6 +6207,7 @@ class System { | ||
| 5963 | 6207 | System System_from_JSON(mixed json) { |
| 5964 | 6208 | System retval = System(); |
| 5965 | 6209 | |
| 6210 | + if (!intp(json["system"])) error("Expected integer"); | |
| 5966 | 6211 | retval.system = json["system"]; |
| 5967 | 6212 | |
| 5968 | 6213 | return retval; |
| @@ -5983,6 +6228,7 @@ class Template { | ||
| 5983 | 6228 | Template Template_from_JSON(mixed json) { |
| 5984 | 6229 | Template retval = Template(); |
| 5985 | 6230 | |
| 6231 | + if (!intp(json["template"])) error("Expected integer"); | |
| 5986 | 6232 | retval.template = json["template"]; |
| 5987 | 6233 | |
| 5988 | 6234 | return retval; |
| @@ -6003,6 +6249,7 @@ class Then { | ||
| 6003 | 6249 | Then Then_from_JSON(mixed json) { |
| 6004 | 6250 | Then retval = Then(); |
| 6005 | 6251 | |
| 6252 | + if (!intp(json["then"])) error("Expected integer"); | |
| 6006 | 6253 | retval.then = json["then"]; |
| 6007 | 6254 | |
| 6008 | 6255 | return retval; |
| @@ -6023,6 +6270,7 @@ class This { | ||
| 6023 | 6270 | This This_from_JSON(mixed json) { |
| 6024 | 6271 | This retval = This(); |
| 6025 | 6272 | |
| 6273 | + if (!intp(json["this"])) error("Expected integer"); | |
| 6026 | 6274 | retval.this = json["this"]; |
| 6027 | 6275 | |
| 6028 | 6276 | return retval; |
| @@ -6043,6 +6291,7 @@ class ThreadLocal { | ||
| 6043 | 6291 | ThreadLocal ThreadLocal_from_JSON(mixed json) { |
| 6044 | 6292 | ThreadLocal retval = ThreadLocal(); |
| 6045 | 6293 | |
| 6294 | + if (!intp(json["thread_local"])) error("Expected integer"); | |
| 6046 | 6295 | retval.thread_local = json["thread_local"]; |
| 6047 | 6296 | |
| 6048 | 6297 | return retval; |
| @@ -6063,6 +6312,7 @@ class Throw { | ||
| 6063 | 6312 | Throw Throw_from_JSON(mixed json) { |
| 6064 | 6313 | Throw retval = Throw(); |
| 6065 | 6314 | |
| 6315 | + if (!intp(json["throw"])) error("Expected integer"); | |
| 6066 | 6316 | retval.throw = json["throw"]; |
| 6067 | 6317 | |
| 6068 | 6318 | return retval; |
| @@ -6083,6 +6333,7 @@ class Throws { | ||
| 6083 | 6333 | Throws Throws_from_JSON(mixed json) { |
| 6084 | 6334 | Throws retval = Throws(); |
| 6085 | 6335 | |
| 6336 | + if (!intp(json["throws"])) error("Expected integer"); | |
| 6086 | 6337 | retval.throws = json["throws"]; |
| 6087 | 6338 | |
| 6088 | 6339 | return retval; |
| @@ -6103,6 +6354,7 @@ class ToJson { | ||
| 6103 | 6354 | ToJson ToJson_from_JSON(mixed json) { |
| 6104 | 6355 | ToJson retval = ToJson(); |
| 6105 | 6356 | |
| 6357 | + if (!intp(json["to_json"])) error("Expected integer"); | |
| 6106 | 6358 | retval.to_json = json["to_json"]; |
| 6107 | 6359 | |
| 6108 | 6360 | return retval; |
| @@ -6123,6 +6375,7 @@ class TopLevelClass { | ||
| 6123 | 6375 | TopLevelClass TopLevelClass_from_JSON(mixed json) { |
| 6124 | 6376 | TopLevelClass retval = TopLevelClass(); |
| 6125 | 6377 | |
| 6378 | + if (!intp(json["top_level"])) error("Expected integer"); | |
| 6126 | 6379 | retval.top_level = json["top_level"]; |
| 6127 | 6380 | |
| 6128 | 6381 | return retval; |
| @@ -6143,6 +6396,7 @@ class Transient { | ||
| 6143 | 6396 | Transient Transient_from_JSON(mixed json) { |
| 6144 | 6397 | Transient retval = Transient(); |
| 6145 | 6398 | |
| 6399 | + if (!intp(json["transient"])) error("Expected integer"); | |
| 6146 | 6400 | retval.transient = json["transient"]; |
| 6147 | 6401 | |
| 6148 | 6402 | return retval; |
| @@ -6163,6 +6417,7 @@ class True { | ||
| 6163 | 6417 | True True_from_JSON(mixed json) { |
| 6164 | 6418 | True retval = True(); |
| 6165 | 6419 | |
| 6420 | + if (!intp(json["True"])) error("Expected integer"); | |
| 6166 | 6421 | retval.true = json["True"]; |
| 6167 | 6422 | |
| 6168 | 6423 | return retval; |
| @@ -6183,6 +6438,7 @@ class Try { | ||
| 6183 | 6438 | Try Try_from_JSON(mixed json) { |
| 6184 | 6439 | Try retval = Try(); |
| 6185 | 6440 | |
| 6441 | + if (!intp(json["try"])) error("Expected integer"); | |
| 6186 | 6442 | retval.try = json["try"]; |
| 6187 | 6443 | |
| 6188 | 6444 | return retval; |
| @@ -6203,6 +6459,7 @@ class Type { | ||
| 6203 | 6459 | Type Type_from_JSON(mixed json) { |
| 6204 | 6460 | Type retval = Type(); |
| 6205 | 6461 | |
| 6462 | + if (!intp(json["Type"])) error("Expected integer"); | |
| 6206 | 6463 | retval.type = json["Type"]; |
| 6207 | 6464 | |
| 6208 | 6465 | return retval; |
| @@ -6223,6 +6480,7 @@ class Typealias { | ||
| 6223 | 6480 | Typealias Typealias_from_JSON(mixed json) { |
| 6224 | 6481 | Typealias retval = Typealias(); |
| 6225 | 6482 | |
| 6483 | + if (!intp(json["typealias"])) error("Expected integer"); | |
| 6226 | 6484 | retval.typealias = json["typealias"]; |
| 6227 | 6485 | |
| 6228 | 6486 | return retval; |
| @@ -6243,6 +6501,7 @@ class Typeid { | ||
| 6243 | 6501 | Typeid Typeid_from_JSON(mixed json) { |
| 6244 | 6502 | Typeid retval = Typeid(); |
| 6245 | 6503 | |
| 6504 | + if (!intp(json["typeid"])) error("Expected integer"); | |
| 6246 | 6505 | retval.typeid = json["typeid"]; |
| 6247 | 6506 | |
| 6248 | 6507 | return retval; |
| @@ -6263,6 +6522,7 @@ class Typename { | ||
| 6263 | 6522 | Typename Typename_from_JSON(mixed json) { |
| 6264 | 6523 | Typename retval = Typename(); |
| 6265 | 6524 | |
| 6525 | + if (!intp(json["typename"])) error("Expected integer"); | |
| 6266 | 6526 | retval.typename = json["typename"]; |
| 6267 | 6527 | |
| 6268 | 6528 | return retval; |
| @@ -6283,6 +6543,7 @@ class Uint { | ||
| 6283 | 6543 | Uint Uint_from_JSON(mixed json) { |
| 6284 | 6544 | Uint retval = Uint(); |
| 6285 | 6545 | |
| 6546 | + if (!intp(json["uint"])) error("Expected integer"); | |
| 6286 | 6547 | retval.uint = json["uint"]; |
| 6287 | 6548 | |
| 6288 | 6549 | return retval; |
| @@ -6303,6 +6564,7 @@ class Ulong { | ||
| 6303 | 6564 | Ulong Ulong_from_JSON(mixed json) { |
| 6304 | 6565 | Ulong retval = Ulong(); |
| 6305 | 6566 | |
| 6567 | + if (!intp(json["ulong"])) error("Expected integer"); | |
| 6306 | 6568 | retval.ulong = json["ulong"]; |
| 6307 | 6569 | |
| 6308 | 6570 | return retval; |
| @@ -6323,6 +6585,7 @@ class Unchecked { | ||
| 6323 | 6585 | Unchecked Unchecked_from_JSON(mixed json) { |
| 6324 | 6586 | Unchecked retval = Unchecked(); |
| 6325 | 6587 | |
| 6588 | + if (!intp(json["unchecked"])) error("Expected integer"); | |
| 6326 | 6589 | retval.unchecked = json["unchecked"]; |
| 6327 | 6590 | |
| 6328 | 6591 | return retval; |
| @@ -6343,6 +6606,7 @@ class Undefined { | ||
| 6343 | 6606 | Undefined Undefined_from_JSON(mixed json) { |
| 6344 | 6607 | Undefined retval = Undefined(); |
| 6345 | 6608 | |
| 6609 | + if (!intp(json["undefined"])) error("Expected integer"); | |
| 6346 | 6610 | retval.undefined = json["undefined"]; |
| 6347 | 6611 | |
| 6348 | 6612 | return retval; |
| @@ -6403,6 +6667,7 @@ class Obj5 { | ||
| 6403 | 6667 | Obj5 Obj5_from_JSON(mixed json) { |
| 6404 | 6668 | Obj5 retval = Obj5(); |
| 6405 | 6669 | |
| 6670 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 6406 | 6671 | retval.dummy = json["dummy"]; |
| 6407 | 6672 | Void_from_JSON(json["void"]); |
| 6408 | 6673 | retval.obj5_void = json["void"]; |
| @@ -6463,6 +6728,7 @@ class Void { | ||
| 6463 | 6728 | Void Void_from_JSON(mixed json) { |
| 6464 | 6729 | Void retval = Void(); |
| 6465 | 6730 | |
| 6731 | + if (!intp(json["void"])) error("Expected integer"); | |
| 6466 | 6732 | retval.void_void = json["void"]; |
| 6467 | 6733 | |
| 6468 | 6734 | return retval; |
| @@ -6483,6 +6749,7 @@ class While { | ||
| 6483 | 6749 | While While_from_JSON(mixed json) { |
| 6484 | 6750 | While retval = While(); |
| 6485 | 6751 | |
| 6752 | + if (!intp(json["while"])) error("Expected integer"); | |
| 6486 | 6753 | retval.while_while = json["while"]; |
| 6487 | 6754 | |
| 6488 | 6755 | return retval; |
| @@ -6503,6 +6770,7 @@ class Union { | ||
| 6503 | 6770 | Union Union_from_JSON(mixed json) { |
| 6504 | 6771 | Union retval = Union(); |
| 6505 | 6772 | |
| 6773 | + if (!intp(json["union"])) error("Expected integer"); | |
| 6506 | 6774 | retval.union = json["union"]; |
| 6507 | 6775 | |
| 6508 | 6776 | return retval; |
| @@ -6523,6 +6791,7 @@ class Unowned { | ||
| 6523 | 6791 | Unowned Unowned_from_JSON(mixed json) { |
| 6524 | 6792 | Unowned retval = Unowned(); |
| 6525 | 6793 | |
| 6794 | + if (!intp(json["unowned"])) error("Expected integer"); | |
| 6526 | 6795 | retval.unowned = json["unowned"]; |
| 6527 | 6796 | |
| 6528 | 6797 | return retval; |
| @@ -6543,6 +6812,7 @@ class Unsafe { | ||
| 6543 | 6812 | Unsafe Unsafe_from_JSON(mixed json) { |
| 6544 | 6813 | Unsafe retval = Unsafe(); |
| 6545 | 6814 | |
| 6815 | + if (!intp(json["unsafe"])) error("Expected integer"); | |
| 6546 | 6816 | retval.unsafe = json["unsafe"]; |
| 6547 | 6817 | |
| 6548 | 6818 | return retval; |
| @@ -6563,6 +6833,7 @@ class Unsigned { | ||
| 6563 | 6833 | Unsigned Unsigned_from_JSON(mixed json) { |
| 6564 | 6834 | Unsigned retval = Unsigned(); |
| 6565 | 6835 | |
| 6836 | + if (!intp(json["unsigned"])) error("Expected integer"); | |
| 6566 | 6837 | retval.unsigned = json["unsigned"]; |
| 6567 | 6838 | |
| 6568 | 6839 | return retval; |
| @@ -6583,6 +6854,7 @@ class Ushort { | ||
| 6583 | 6854 | Ushort Ushort_from_JSON(mixed json) { |
| 6584 | 6855 | Ushort retval = Ushort(); |
| 6585 | 6856 | |
| 6857 | + if (!intp(json["ushort"])) error("Expected integer"); | |
| 6586 | 6858 | retval.ushort = json["ushort"]; |
| 6587 | 6859 | |
| 6588 | 6860 | return retval; |
| @@ -6603,6 +6875,7 @@ class Using { | ||
| 6603 | 6875 | Using Using_from_JSON(mixed json) { |
| 6604 | 6876 | Using retval = Using(); |
| 6605 | 6877 | |
| 6878 | + if (!intp(json["using"])) error("Expected integer"); | |
| 6606 | 6879 | retval.using = json["using"]; |
| 6607 | 6880 | |
| 6608 | 6881 | return retval; |
| @@ -6623,6 +6896,7 @@ class Var { | ||
| 6623 | 6896 | Var Var_from_JSON(mixed json) { |
| 6624 | 6897 | Var retval = Var(); |
| 6625 | 6898 | |
| 6899 | + if (!intp(json["var"])) error("Expected integer"); | |
| 6626 | 6900 | retval.var = json["var"]; |
| 6627 | 6901 | |
| 6628 | 6902 | return retval; |
| @@ -6643,6 +6917,7 @@ class Virtual { | ||
| 6643 | 6917 | Virtual Virtual_from_JSON(mixed json) { |
| 6644 | 6918 | Virtual retval = Virtual(); |
| 6645 | 6919 | |
| 6920 | + if (!intp(json["virtual"])) error("Expected integer"); | |
| 6646 | 6921 | retval.virtual = json["virtual"]; |
| 6647 | 6922 | |
| 6648 | 6923 | return retval; |
| @@ -6663,6 +6938,7 @@ class Volatile { | ||
| 6663 | 6938 | Volatile Volatile_from_JSON(mixed json) { |
| 6664 | 6939 | Volatile retval = Volatile(); |
| 6665 | 6940 | |
| 6941 | + if (!intp(json["volatile"])) error("Expected integer"); | |
| 6666 | 6942 | retval.volatile = json["volatile"]; |
| 6667 | 6943 | |
| 6668 | 6944 | return retval; |
| @@ -6683,6 +6959,7 @@ class WcharT { | ||
| 6683 | 6959 | WcharT WcharT_from_JSON(mixed json) { |
| 6684 | 6960 | WcharT retval = WcharT(); |
| 6685 | 6961 | |
| 6962 | + if (!intp(json["wchar_t"])) error("Expected integer"); | |
| 6686 | 6963 | retval.wchar_t = json["wchar_t"]; |
| 6687 | 6964 | |
| 6688 | 6965 | return retval; |
| @@ -6703,6 +6980,7 @@ class Weak { | ||
| 6703 | 6980 | Weak Weak_from_JSON(mixed json) { |
| 6704 | 6981 | Weak retval = Weak(); |
| 6705 | 6982 | |
| 6983 | + if (!intp(json["weak"])) error("Expected integer"); | |
| 6706 | 6984 | retval.weak = json["weak"]; |
| 6707 | 6985 | |
| 6708 | 6986 | return retval; |
| @@ -6723,6 +7001,7 @@ class Where { | ||
| 6723 | 7001 | Where Where_from_JSON(mixed json) { |
| 6724 | 7002 | Where retval = Where(); |
| 6725 | 7003 | |
| 7004 | + if (!intp(json["where"])) error("Expected integer"); | |
| 6726 | 7005 | retval.where = json["where"]; |
| 6727 | 7006 | |
| 6728 | 7007 | return retval; |
| @@ -6743,6 +7022,7 @@ class WillSet { | ||
| 6743 | 7022 | WillSet WillSet_from_JSON(mixed json) { |
| 6744 | 7023 | WillSet retval = WillSet(); |
| 6745 | 7024 | |
| 7025 | + if (!intp(json["willSet"])) error("Expected integer"); | |
| 6746 | 7026 | retval.will_set = json["willSet"]; |
| 6747 | 7027 | |
| 6748 | 7028 | return retval; |
| @@ -6763,6 +7043,7 @@ class With { | ||
| 6763 | 7043 | With With_from_JSON(mixed json) { |
| 6764 | 7044 | With retval = With(); |
| 6765 | 7045 | |
| 7046 | + if (!intp(json["with"])) error("Expected integer"); | |
| 6766 | 7047 | retval.with = json["with"]; |
| 6767 | 7048 | |
| 6768 | 7049 | return retval; |
| @@ -6783,6 +7064,7 @@ class Xor { | ||
| 6783 | 7064 | Xor Xor_from_JSON(mixed json) { |
| 6784 | 7065 | Xor retval = Xor(); |
| 6785 | 7066 | |
| 7067 | + if (!intp(json["xor"])) error("Expected integer"); | |
| 6786 | 7068 | retval.xor = json["xor"]; |
| 6787 | 7069 | |
| 6788 | 7070 | return retval; |
| @@ -6803,6 +7085,7 @@ class XorEq { | ||
| 6803 | 7085 | XorEq XorEq_from_JSON(mixed json) { |
| 6804 | 7086 | XorEq retval = XorEq(); |
| 6805 | 7087 | |
| 7088 | + if (!intp(json["xor_eq"])) error("Expected integer"); | |
| 6806 | 7089 | retval.xor_eq = json["xor_eq"]; |
| 6807 | 7090 | |
| 6808 | 7091 | return retval; |
| @@ -6823,6 +7106,7 @@ class Yes { | ||
| 6823 | 7106 | Yes Yes_from_JSON(mixed json) { |
| 6824 | 7107 | Yes retval = Yes(); |
| 6825 | 7108 | |
| 7109 | + if (!intp(json["YES"])) error("Expected integer"); | |
| 6826 | 7110 | retval.yes = json["YES"]; |
| 6827 | 7111 | |
| 6828 | 7112 | return retval; |
| @@ -6843,6 +7127,7 @@ class Yield { | ||
| 6843 | 7127 | Yield Yield_from_JSON(mixed json) { |
| 6844 | 7128 | Yield retval = Yield(); |
| 6845 | 7129 | |
| 7130 | + if (!intp(json["yield"])) error("Expected integer"); | |
| 6846 | 7131 | retval.yield = json["yield"]; |
| 6847 | 7132 | |
| 6848 | 7133 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/priority/list.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -29,6 +29,7 @@ class TopLevel { | ||
| 29 | 29 | TopLevel TopLevel_from_JSON(mixed json) { |
| 30 | 30 | TopLevel retval = TopLevel(); |
| 31 | 31 | |
| 32 | + if (!intp(json["data"])) error("Expected integer"); | |
| 32 | 33 | retval.data = json["data"]; |
| 33 | 34 | if (!has_index(json, "next")) error("Missing required property"); |
| 34 | 35 | if (has_index(json, "next") && json["next"] != Val.null) TopLevel_from_JSON(json["next"]); |
Test case
1 generated file · +1 −0test/inputs/json/priority/name-style.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -39,6 +39,7 @@ class TopLevel { | ||
| 39 | 39 | TopLevel TopLevel_from_JSON(mixed json) { |
| 40 | 40 | TopLevel retval = TopLevel(); |
| 41 | 41 | |
| 42 | + if (!intp(json["anEasyOne"])) error("Expected integer"); | |
| 42 | 43 | retval.an_easy_one = json["anEasyOne"]; |
| 43 | 44 | if (json["isMNISTLetter"] != Standards.JSON.true && json["isMNISTLetter"] != Standards.JSON.false) error("Expected bool"); |
| 44 | 45 | retval.is_mnist_letter = json["isMNISTLetter"]; |
Test case
1 generated file · +115 −0test/inputs/json/priority/nbl-stats.json
Mpikedefault / TopLevel.pmod+115 −0
| @@ -65,9 +65,12 @@ class TopLevel { | ||
| 65 | 65 | TopLevel TopLevel_from_JSON(mixed json) { |
| 66 | 66 | TopLevel retval = TopLevel(); |
| 67 | 67 | |
| 68 | + if (!intp(json["attendance"])) error("Expected integer"); | |
| 68 | 69 | retval.attendance = json["attendance"]; |
| 69 | 70 | retval.clock = json["clock"]; |
| 71 | + if (!intp(json["disableMatch"])) error("Expected integer"); | |
| 70 | 72 | retval.disable_match = json["disableMatch"]; |
| 73 | + if (!intp(json["inOT"])) error("Expected integer"); | |
| 71 | 74 | retval.in_ot = json["inOT"]; |
| 72 | 75 | retval.leaddata = json["leaddata"]; |
| 73 | 76 | retval.officials_referee1 = json["officials_referee1"]; |
| @@ -75,15 +78,20 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 75 | 78 | retval.officials_referee3 = json["officials_referee3"]; |
| 76 | 79 | retval.othermatches = json["othermatches"]; |
| 77 | 80 | retval.pbp = json["pbp"]; |
| 81 | + if (!intp(json["period"])) error("Expected integer"); | |
| 78 | 82 | retval.period = json["period"]; |
| 83 | + if (!intp(json["periodLengthOVERTIME"])) error("Expected integer"); | |
| 79 | 84 | retval.period_length_overtime = json["periodLengthOVERTIME"]; |
| 85 | + if (!intp(json["periodLengthREGULAR"])) error("Expected integer"); | |
| 80 | 86 | retval.period_length_regular = json["periodLengthREGULAR"]; |
| 81 | 87 | retval.period_type = PerType_from_JSON(json["periodType"]); |
| 88 | + if (!intp(json["periodsMax"])) error("Expected integer"); | |
| 82 | 89 | retval.periods_max = json["periodsMax"]; |
| 83 | 90 | foreach (json["scorers"]; mixed _; mixed value) if (!arrayp(value)) error("Expected array"); |
| 84 | 91 | retval.scorers = json["scorers"]; |
| 85 | 92 | retval.timeline = json["timeline"]; |
| 86 | 93 | retval.tm = json["tm"]; |
| 94 | + if (!intp(json["totalTimeAdded"])) error("Expected integer"); | |
| 87 | 95 | retval.total_time_added = json["totalTimeAdded"]; |
| 88 | 96 | Totallds_from_JSON(json["totallds"]); |
| 89 | 97 | retval.totallds = json["totallds"]; |
| @@ -147,15 +155,18 @@ Othermatch Othermatch_from_JSON(mixed json) { | ||
| 147 | 155 | retval.clock = json["clock"]; |
| 148 | 156 | retval.competition_name = json["competitionName"]; |
| 149 | 157 | retval.id = json["id"]; |
| 158 | + if (!intp(json["period"])) error("Expected integer"); | |
| 150 | 159 | retval.period = json["period"]; |
| 151 | 160 | retval.period_type = PerType_from_JSON(json["periodType"]); |
| 152 | 161 | Team_from_JSON(json["team1"]); |
| 153 | 162 | retval.team1 = json["team1"]; |
| 154 | 163 | retval.team1_name = json["team1Name"]; |
| 164 | + if (!intp(json["team1Score"])) error("Expected integer"); | |
| 155 | 165 | retval.team1_score = json["team1Score"]; |
| 156 | 166 | Team_from_JSON(json["team2"]); |
| 157 | 167 | retval.team2 = json["team2"]; |
| 158 | 168 | retval.team2_name = json["team2Name"]; |
| 169 | + if (!intp(json["team2Score"])) error("Expected integer"); | |
| 159 | 170 | retval.team2_score = json["team2Score"]; |
| 160 | 171 | |
| 161 | 172 | return retval; |
| @@ -269,19 +280,27 @@ Pbp Pbp_from_JSON(mixed json) { | ||
| 269 | 280 | retval.international_family_name_initial = FamilyNameInitial_from_JSON(json["internationalFamilyNameInitial"]); |
| 270 | 281 | retval.international_first_name = json["internationalFirstName"]; |
| 271 | 282 | retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]); |
| 283 | + if (!intp(json["lead"])) error("Expected integer"); | |
| 272 | 284 | retval.lead = json["lead"]; |
| 285 | + if (!intp(json["period"])) error("Expected integer"); | |
| 273 | 286 | retval.period = json["period"]; |
| 274 | 287 | retval.period_type = PerType_from_JSON(json["periodType"]); |
| 275 | 288 | retval.player = json["player"]; |
| 289 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 276 | 290 | retval.pno = json["pno"]; |
| 277 | 291 | retval.qualifier = json["qualifier"]; |
| 292 | + if (!intp(json["s1"])) error("Expected integer"); | |
| 278 | 293 | retval.s1 = json["s1"]; |
| 294 | + if (!intp(json["s2"])) error("Expected integer"); | |
| 279 | 295 | retval.s2 = json["s2"]; |
| 280 | 296 | retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]); |
| 297 | + if (!intp(json["scoring"])) error("Expected integer"); | |
| 281 | 298 | retval.scoring = json["scoring"]; |
| 282 | 299 | retval.shirt_number = json["shirtNumber"]; |
| 283 | 300 | retval.sub_type = json["subType"]; |
| 301 | + if (!intp(json["success"])) error("Expected integer"); | |
| 284 | 302 | retval.success = json["success"]; |
| 303 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 285 | 304 | retval.tno = json["tno"]; |
| 286 | 305 | |
| 287 | 306 | return retval; |
| @@ -427,11 +446,13 @@ Scorer Scorer_from_JSON(mixed json) { | ||
| 427 | 446 | retval.per = json["per"]; |
| 428 | 447 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 429 | 448 | retval.player = json["player"]; |
| 449 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 430 | 450 | retval.pno = json["pno"]; |
| 431 | 451 | retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]); |
| 432 | 452 | retval.shirt_number = json["shirtNumber"]; |
| 433 | 453 | retval.summary = json["summary"]; |
| 434 | 454 | retval.times = json["times"]; |
| 455 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 435 | 456 | retval.tno = json["tno"]; |
| 436 | 457 | retval.tot = json["tot"]; |
| 437 | 458 | |
| @@ -458,6 +479,7 @@ Time Time_from_JSON(mixed json) { | ||
| 458 | 479 | Time retval = Time(); |
| 459 | 480 | |
| 460 | 481 | retval.gt = json["gt"]; |
| 482 | + if (!intp(json["per"])) error("Expected integer"); | |
| 461 | 483 | retval.per = json["per"]; |
| 462 | 484 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 463 | 485 | |
| @@ -609,69 +631,121 @@ Tm Tm_from_JSON(mixed json) { | ||
| 609 | 631 | |
| 610 | 632 | retval.code = json["code"]; |
| 611 | 633 | retval.code_international = json["codeInternational"]; |
| 634 | + if (!intp(json["fouls"])) error("Expected integer"); | |
| 612 | 635 | retval.fouls = json["fouls"]; |
| 636 | + if (!intp(json["full_score"])) error("Expected integer"); | |
| 613 | 637 | retval.full_score = json["full_score"]; |
| 614 | 638 | Lds_from_JSON(json["lds"]); |
| 615 | 639 | retval.lds = json["lds"]; |
| 616 | 640 | retval.logo = json["logo"]; |
| 617 | 641 | retval.name = json["name"]; |
| 618 | 642 | retval.name_international = json["nameInternational"]; |
| 643 | + if (!intp(json["p1_score"])) error("Expected integer"); | |
| 619 | 644 | retval.p1_score = json["p1_score"]; |
| 645 | + if (!intp(json["p2_score"])) error("Expected integer"); | |
| 620 | 646 | retval.p2_score = json["p2_score"]; |
| 647 | + if (!intp(json["p3_score"])) error("Expected integer"); | |
| 621 | 648 | retval.p3_score = json["p3_score"]; |
| 649 | + if (!intp(json["p4_score"])) error("Expected integer"); | |
| 622 | 650 | retval.p4_score = json["p4_score"]; |
| 623 | 651 | retval.pl = json["pl"]; |
| 652 | + if (!intp(json["score"])) error("Expected integer"); | |
| 624 | 653 | retval.score = json["score"]; |
| 625 | 654 | retval.scoring = json["scoring"]; |
| 626 | 655 | retval.short_name = json["shortName"]; |
| 627 | 656 | retval.short_name_international = json["shortNameInternational"]; |
| 628 | 657 | retval.shot = json["shot"]; |
| 658 | + if (!intp(json["timeouts"])) error("Expected integer"); | |
| 629 | 659 | retval.timeouts = json["timeouts"]; |
| 660 | + if (!intp(json["tot_eff_1"])) error("Expected integer"); | |
| 630 | 661 | retval.tot_eff_1 = json["tot_eff_1"]; |
| 662 | + if (!intp(json["tot_eff_2"])) error("Expected integer"); | |
| 631 | 663 | retval.tot_eff_2 = json["tot_eff_2"]; |
| 632 | 664 | retval.tot_eff_3 = (float)json["tot_eff_3"]; |
| 665 | + if (!intp(json["tot_eff_4"])) error("Expected integer"); | |
| 633 | 666 | retval.tot_eff_4 = json["tot_eff_4"]; |
| 667 | + if (!intp(json["tot_eff_5"])) error("Expected integer"); | |
| 634 | 668 | retval.tot_eff_5 = json["tot_eff_5"]; |
| 669 | + if (!intp(json["tot_eff_6"])) error("Expected integer"); | |
| 635 | 670 | retval.tot_eff_6 = json["tot_eff_6"]; |
| 671 | + if (!intp(json["tot_eff_7"])) error("Expected integer"); | |
| 636 | 672 | retval.tot_eff_7 = json["tot_eff_7"]; |
| 673 | + if (!intp(json["tot_sAssists"])) error("Expected integer"); | |
| 637 | 674 | retval.tot_s_assists = json["tot_sAssists"]; |
| 675 | + if (!intp(json["tot_sBenchPoints"])) error("Expected integer"); | |
| 638 | 676 | retval.tot_s_bench_points = json["tot_sBenchPoints"]; |
| 677 | + if (!intp(json["tot_sBiggestLead"])) error("Expected integer"); | |
| 639 | 678 | retval.tot_s_biggest_lead = json["tot_sBiggestLead"]; |
| 679 | + if (!intp(json["tot_sBiggestScoringRun"])) error("Expected integer"); | |
| 640 | 680 | retval.tot_s_biggest_scoring_run = json["tot_sBiggestScoringRun"]; |
| 681 | + if (!intp(json["tot_sBlocks"])) error("Expected integer"); | |
| 641 | 682 | retval.tot_s_blocks = json["tot_sBlocks"]; |
| 683 | + if (!intp(json["tot_sBlocksReceived"])) error("Expected integer"); | |
| 642 | 684 | retval.tot_s_blocks_received = json["tot_sBlocksReceived"]; |
| 685 | + if (!intp(json["tot_sFieldGoalsAttempted"])) error("Expected integer"); | |
| 643 | 686 | retval.tot_s_field_goals_attempted = json["tot_sFieldGoalsAttempted"]; |
| 687 | + if (!intp(json["tot_sFieldGoalsMade"])) error("Expected integer"); | |
| 644 | 688 | retval.tot_s_field_goals_made = json["tot_sFieldGoalsMade"]; |
| 689 | + if (!intp(json["tot_sFieldGoalsPercentage"])) error("Expected integer"); | |
| 645 | 690 | retval.tot_s_field_goals_percentage = json["tot_sFieldGoalsPercentage"]; |
| 691 | + if (!intp(json["tot_sFoulsOn"])) error("Expected integer"); | |
| 646 | 692 | retval.tot_s_fouls_on = json["tot_sFoulsOn"]; |
| 693 | + if (!intp(json["tot_sFoulsPersonal"])) error("Expected integer"); | |
| 647 | 694 | retval.tot_s_fouls_personal = json["tot_sFoulsPersonal"]; |
| 695 | + if (!intp(json["tot_sFoulsTeam"])) error("Expected integer"); | |
| 648 | 696 | retval.tot_s_fouls_team = json["tot_sFoulsTeam"]; |
| 697 | + if (!intp(json["tot_sFreeThrowsAttempted"])) error("Expected integer"); | |
| 649 | 698 | retval.tot_s_free_throws_attempted = json["tot_sFreeThrowsAttempted"]; |
| 699 | + if (!intp(json["tot_sFreeThrowsMade"])) error("Expected integer"); | |
| 650 | 700 | retval.tot_s_free_throws_made = json["tot_sFreeThrowsMade"]; |
| 701 | + if (!intp(json["tot_sFreeThrowsPercentage"])) error("Expected integer"); | |
| 651 | 702 | retval.tot_s_free_throws_percentage = json["tot_sFreeThrowsPercentage"]; |
| 703 | + if (!intp(json["tot_sLeadChanges"])) error("Expected integer"); | |
| 652 | 704 | retval.tot_s_lead_changes = json["tot_sLeadChanges"]; |
| 705 | + if (!intp(json["tot_sMinutes"])) error("Expected integer"); | |
| 653 | 706 | retval.tot_s_minutes = json["tot_sMinutes"]; |
| 707 | + if (!intp(json["tot_sPoints"])) error("Expected integer"); | |
| 654 | 708 | retval.tot_s_points = json["tot_sPoints"]; |
| 709 | + if (!intp(json["tot_sPointsFastBreak"])) error("Expected integer"); | |
| 655 | 710 | retval.tot_s_points_fast_break = json["tot_sPointsFastBreak"]; |
| 711 | + if (!intp(json["tot_sPointsFromTurnovers"])) error("Expected integer"); | |
| 656 | 712 | retval.tot_s_points_from_turnovers = json["tot_sPointsFromTurnovers"]; |
| 713 | + if (!intp(json["tot_sPointsInThePaint"])) error("Expected integer"); | |
| 657 | 714 | retval.tot_s_points_in_the_paint = json["tot_sPointsInThePaint"]; |
| 715 | + if (!intp(json["tot_sPointsSecondChance"])) error("Expected integer"); | |
| 658 | 716 | retval.tot_s_points_second_chance = json["tot_sPointsSecondChance"]; |
| 717 | + if (!intp(json["tot_sReboundsDefensive"])) error("Expected integer"); | |
| 659 | 718 | retval.tot_s_rebounds_defensive = json["tot_sReboundsDefensive"]; |
| 719 | + if (!intp(json["tot_sReboundsOffensive"])) error("Expected integer"); | |
| 660 | 720 | retval.tot_s_rebounds_offensive = json["tot_sReboundsOffensive"]; |
| 721 | + if (!intp(json["tot_sReboundsTeam"])) error("Expected integer"); | |
| 661 | 722 | retval.tot_s_rebounds_team = json["tot_sReboundsTeam"]; |
| 723 | + if (!intp(json["tot_sReboundsTeamDefensive"])) error("Expected integer"); | |
| 662 | 724 | retval.tot_s_rebounds_team_defensive = json["tot_sReboundsTeamDefensive"]; |
| 725 | + if (!intp(json["tot_sReboundsTeamOffensive"])) error("Expected integer"); | |
| 663 | 726 | retval.tot_s_rebounds_team_offensive = json["tot_sReboundsTeamOffensive"]; |
| 727 | + if (!intp(json["tot_sReboundsTotal"])) error("Expected integer"); | |
| 664 | 728 | retval.tot_s_rebounds_total = json["tot_sReboundsTotal"]; |
| 729 | + if (!intp(json["tot_sSteals"])) error("Expected integer"); | |
| 665 | 730 | retval.tot_s_steals = json["tot_sSteals"]; |
| 731 | + if (!intp(json["tot_sThreePointersAttempted"])) error("Expected integer"); | |
| 666 | 732 | retval.tot_s_three_pointers_attempted = json["tot_sThreePointersAttempted"]; |
| 733 | + if (!intp(json["tot_sThreePointersMade"])) error("Expected integer"); | |
| 667 | 734 | retval.tot_s_three_pointers_made = json["tot_sThreePointersMade"]; |
| 735 | + if (!intp(json["tot_sThreePointersPercentage"])) error("Expected integer"); | |
| 668 | 736 | retval.tot_s_three_pointers_percentage = json["tot_sThreePointersPercentage"]; |
| 669 | 737 | retval.tot_s_time_leading = (float)json["tot_sTimeLeading"]; |
| 738 | + if (!intp(json["tot_sTimesScoresLevel"])) error("Expected integer"); | |
| 670 | 739 | retval.tot_s_times_scores_level = json["tot_sTimesScoresLevel"]; |
| 740 | + if (!intp(json["tot_sTurnovers"])) error("Expected integer"); | |
| 671 | 741 | retval.tot_s_turnovers = json["tot_sTurnovers"]; |
| 742 | + if (!intp(json["tot_sTurnoversTeam"])) error("Expected integer"); | |
| 672 | 743 | retval.tot_s_turnovers_team = json["tot_sTurnoversTeam"]; |
| 744 | + if (!intp(json["tot_sTwoPointersAttempted"])) error("Expected integer"); | |
| 673 | 745 | retval.tot_s_two_pointers_attempted = json["tot_sTwoPointersAttempted"]; |
| 746 | + if (!intp(json["tot_sTwoPointersMade"])) error("Expected integer"); | |
| 674 | 747 | retval.tot_s_two_pointers_made = json["tot_sTwoPointersMade"]; |
| 748 | + if (!intp(json["tot_sTwoPointersPercentage"])) error("Expected integer"); | |
| 675 | 749 | retval.tot_s_two_pointers_percentage = json["tot_sTwoPointersPercentage"]; |
| 676 | 750 | |
| 677 | 751 | return retval; |
| @@ -844,16 +918,22 @@ class Pl { | ||
| 844 | 918 | Pl Pl_from_JSON(mixed json) { |
| 845 | 919 | Pl retval = Pl(); |
| 846 | 920 | |
| 921 | + if (!intp(json["active"])) error("Expected integer"); | |
| 847 | 922 | retval.active = json["active"]; |
| 848 | 923 | retval.captain = json["captain"]; |
| 849 | 924 | if (has_index(json, "comp") && json["comp"] != Val.null) Comp_from_JSON(json["comp"]); |
| 850 | 925 | retval.comp = json["comp"]; |
| 926 | + if (!intp(json["eff_1"])) error("Expected integer"); | |
| 851 | 927 | retval.eff_1 = json["eff_1"]; |
| 928 | + if (!intp(json["eff_2"])) error("Expected integer"); | |
| 852 | 929 | retval.eff_2 = json["eff_2"]; |
| 853 | 930 | retval.eff_3 = (float)json["eff_3"]; |
| 854 | 931 | retval.eff_4 = (float)json["eff_4"]; |
| 932 | + if (!intp(json["eff_5"])) error("Expected integer"); | |
| 855 | 933 | retval.eff_5 = json["eff_5"]; |
| 934 | + if (!intp(json["eff_6"])) error("Expected integer"); | |
| 856 | 935 | retval.eff_6 = json["eff_6"]; |
| 936 | + if (!intp(json["eff_7"])) error("Expected integer"); | |
| 857 | 937 | retval.eff_7 = json["eff_7"]; |
| 858 | 938 | retval.family_name = json["familyName"]; |
| 859 | 939 | retval.family_name_initial = FamilyNameInitial_from_JSON(json["familyNameInitial"]); |
| @@ -865,36 +945,64 @@ Pl Pl_from_JSON(mixed json) { | ||
| 865 | 945 | retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]); |
| 866 | 946 | retval.name = json["name"]; |
| 867 | 947 | retval.playing_position = json["playingPosition"]; |
| 948 | + if (!intp(json["sAssists"])) error("Expected integer"); | |
| 868 | 949 | retval.s_assists = json["sAssists"]; |
| 950 | + if (!intp(json["sBlocks"])) error("Expected integer"); | |
| 869 | 951 | retval.s_blocks = json["sBlocks"]; |
| 952 | + if (!intp(json["sBlocksReceived"])) error("Expected integer"); | |
| 870 | 953 | retval.s_blocks_received = json["sBlocksReceived"]; |
| 954 | + if (!intp(json["sFieldGoalsAttempted"])) error("Expected integer"); | |
| 871 | 955 | retval.s_field_goals_attempted = json["sFieldGoalsAttempted"]; |
| 956 | + if (!intp(json["sFieldGoalsMade"])) error("Expected integer"); | |
| 872 | 957 | retval.s_field_goals_made = json["sFieldGoalsMade"]; |
| 958 | + if (!intp(json["sFieldGoalsPercentage"])) error("Expected integer"); | |
| 873 | 959 | retval.s_field_goals_percentage = json["sFieldGoalsPercentage"]; |
| 960 | + if (!intp(json["sFoulsOn"])) error("Expected integer"); | |
| 874 | 961 | retval.s_fouls_on = json["sFoulsOn"]; |
| 962 | + if (!intp(json["sFoulsPersonal"])) error("Expected integer"); | |
| 875 | 963 | retval.s_fouls_personal = json["sFoulsPersonal"]; |
| 964 | + if (!intp(json["sFreeThrowsAttempted"])) error("Expected integer"); | |
| 876 | 965 | retval.s_free_throws_attempted = json["sFreeThrowsAttempted"]; |
| 966 | + if (!intp(json["sFreeThrowsMade"])) error("Expected integer"); | |
| 877 | 967 | retval.s_free_throws_made = json["sFreeThrowsMade"]; |
| 968 | + if (!intp(json["sFreeThrowsPercentage"])) error("Expected integer"); | |
| 878 | 969 | retval.s_free_throws_percentage = json["sFreeThrowsPercentage"]; |
| 879 | 970 | if (arrayp(json["sMinutes"])) error("Unexpected array"); |
| 880 | 971 | retval.s_minutes = json["sMinutes"]; |
| 972 | + if (!intp(json["sPlusMinusPoints"])) error("Expected integer"); | |
| 881 | 973 | retval.s_plus_minus_points = json["sPlusMinusPoints"]; |
| 974 | + if (!intp(json["sPoints"])) error("Expected integer"); | |
| 882 | 975 | retval.s_points = json["sPoints"]; |
| 976 | + if (!intp(json["sPointsFastBreak"])) error("Expected integer"); | |
| 883 | 977 | retval.s_points_fast_break = json["sPointsFastBreak"]; |
| 978 | + if (!intp(json["sPointsInThePaint"])) error("Expected integer"); | |
| 884 | 979 | retval.s_points_in_the_paint = json["sPointsInThePaint"]; |
| 980 | + if (!intp(json["sPointsSecondChance"])) error("Expected integer"); | |
| 885 | 981 | retval.s_points_second_chance = json["sPointsSecondChance"]; |
| 982 | + if (!intp(json["sReboundsDefensive"])) error("Expected integer"); | |
| 886 | 983 | retval.s_rebounds_defensive = json["sReboundsDefensive"]; |
| 984 | + if (!intp(json["sReboundsOffensive"])) error("Expected integer"); | |
| 887 | 985 | retval.s_rebounds_offensive = json["sReboundsOffensive"]; |
| 986 | + if (!intp(json["sReboundsTotal"])) error("Expected integer"); | |
| 888 | 987 | retval.s_rebounds_total = json["sReboundsTotal"]; |
| 988 | + if (!intp(json["sSteals"])) error("Expected integer"); | |
| 889 | 989 | retval.s_steals = json["sSteals"]; |
| 990 | + if (!intp(json["sThreePointersAttempted"])) error("Expected integer"); | |
| 890 | 991 | retval.s_three_pointers_attempted = json["sThreePointersAttempted"]; |
| 992 | + if (!intp(json["sThreePointersMade"])) error("Expected integer"); | |
| 891 | 993 | retval.s_three_pointers_made = json["sThreePointersMade"]; |
| 994 | + if (!intp(json["sThreePointersPercentage"])) error("Expected integer"); | |
| 892 | 995 | retval.s_three_pointers_percentage = json["sThreePointersPercentage"]; |
| 996 | + if (!intp(json["sTurnovers"])) error("Expected integer"); | |
| 893 | 997 | retval.s_turnovers = json["sTurnovers"]; |
| 998 | + if (!intp(json["sTwoPointersAttempted"])) error("Expected integer"); | |
| 894 | 999 | retval.s_two_pointers_attempted = json["sTwoPointersAttempted"]; |
| 1000 | + if (!intp(json["sTwoPointersMade"])) error("Expected integer"); | |
| 895 | 1001 | retval.s_two_pointers_made = json["sTwoPointersMade"]; |
| 1002 | + if (!intp(json["sTwoPointersPercentage"])) error("Expected integer"); | |
| 896 | 1003 | retval.s_two_pointers_percentage = json["sTwoPointersPercentage"]; |
| 897 | 1004 | retval.shirt_number = json["shirtNumber"]; |
| 1005 | + if (!intp(json["starter"])) error("Expected integer"); | |
| 898 | 1006 | retval.starter = json["starter"]; |
| 899 | 1007 | |
| 900 | 1008 | return retval; |
| @@ -973,16 +1081,23 @@ Shot Shot_from_JSON(mixed json) { | ||
| 973 | 1081 | Shot retval = Shot(); |
| 974 | 1082 | |
| 975 | 1083 | retval.action_type = ActionType_from_JSON(json["actionType"]); |
| 1084 | + if (!intp(json["p"])) error("Expected integer"); | |
| 976 | 1085 | retval.p = json["p"]; |
| 1086 | + if (!intp(json["per"])) error("Expected integer"); | |
| 977 | 1087 | retval.per = json["per"]; |
| 978 | 1088 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 979 | 1089 | retval.player = json["player"]; |
| 1090 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 980 | 1091 | retval.pno = json["pno"]; |
| 1092 | + if (!intp(json["r"])) error("Expected integer"); | |
| 981 | 1093 | retval.r = json["r"]; |
| 982 | 1094 | retval.shirt_number = json["shirtNumber"]; |
| 983 | 1095 | retval.sub_type = SubType_from_JSON(json["subType"]); |
| 1096 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 984 | 1097 | retval.tno = json["tno"]; |
| 1098 | + if (!intp(json["x"])) error("Expected integer"); | |
| 985 | 1099 | retval.x = json["x"]; |
| 1100 | + if (!intp(json["y"])) error("Expected integer"); | |
| 986 | 1101 | retval.y = json["y"]; |
| 987 | 1102 | |
| 988 | 1103 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/priority/nst-test-suite.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -306,6 +306,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 306 | 306 | retval.y_string_with_del_character_json = json["y_string_with_del_character.json"]; |
| 307 | 307 | if (json["y_structure_lonely_false.json"] != Standards.JSON.true && json["y_structure_lonely_false.json"] != Standards.JSON.false) error("Expected bool"); |
| 308 | 308 | retval.y_structure_lonely_false_json = json["y_structure_lonely_false.json"]; |
| 309 | + if (!intp(json["y_structure_lonely_int.json"])) error("Expected integer"); | |
| 309 | 310 | retval.y_structure_lonely_int_json = json["y_structure_lonely_int.json"]; |
| 310 | 311 | retval.y_structure_lonely_negative_real_json = (float)json["y_structure_lonely_negative_real.json"]; |
| 311 | 312 | retval.y_structure_lonely_null_json = json["y_structure_lonely_null.json"]; |
| @@ -377,6 +378,7 @@ class YObjectEmptyKeyJson { | ||
| 377 | 378 | YObjectEmptyKeyJson YObjectEmptyKeyJson_from_JSON(mixed json) { |
| 378 | 379 | YObjectEmptyKeyJson retval = YObjectEmptyKeyJson(); |
| 379 | 380 | |
| 381 | + if (!intp(json[""])) error("Expected integer"); | |
| 380 | 382 | retval.empty = json[""]; |
| 381 | 383 | |
| 382 | 384 | return retval; |
| @@ -397,6 +399,7 @@ class YObjectEscapedNullInKeyJson { | ||
| 397 | 399 | YObjectEscapedNullInKeyJson YObjectEscapedNullInKeyJson_from_JSON(mixed json) { |
| 398 | 400 | YObjectEscapedNullInKeyJson retval = YObjectEscapedNullInKeyJson(); |
| 399 | 401 | |
| 402 | + if (!intp(json["foo\u0000bar"])) error("Expected integer"); | |
| 400 | 403 | retval.foo_bar = json["foo\u0000bar"]; |
| 401 | 404 | |
| 402 | 405 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/priority/omit-empty.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -49,6 +49,7 @@ class Result { | ||
| 49 | 49 | Result Result_from_JSON(mixed json) { |
| 50 | 50 | Result retval = Result(); |
| 51 | 51 | |
| 52 | + if (!intp(json["age"])) error("Expected integer"); | |
| 52 | 53 | retval.age = json["age"]; |
| 53 | 54 | retval.name = json["name"]; |
Test case
1 generated file · +1 −0test/inputs/json/priority/php-validation.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -37,6 +37,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 37 | 37 | |
| 38 | 38 | if (json["boolean"] != Standards.JSON.true && json["boolean"] != Standards.JSON.false) error("Expected bool"); |
| 39 | 39 | retval.boolean = json["boolean"]; |
| 40 | + if (!intp(json["integer"])) error("Expected integer"); | |
| 40 | 41 | retval.integer = json["integer"]; |
| 41 | 42 | retval.integers = json["integers"]; |
| 42 | 43 | retval.number = (float)json["number"]; |
Test case
1 generated file · +26 −0test/inputs/json/priority/recursive.json
Mpikedefault / TopLevel.pmod+26 −0
| @@ -50,13 +50,18 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 50 | 50 | Details_from_JSON(json["details"]); |
| 51 | 51 | retval.details = json["details"]; |
| 52 | 52 | retval.match = json["match"]; |
| 53 | + if (!intp(json["page"])) error("Expected integer"); | |
| 53 | 54 | retval.page = json["page"]; |
| 54 | 55 | retval.product = json["product"]; |
| 55 | 56 | if (json["schk"] != Standards.JSON.true && json["schk"] != Standards.JSON.false) error("Expected bool"); |
| 56 | 57 | retval.schk = json["schk"]; |
| 58 | + if (!intp(json["totallooseoffers"])) error("Expected integer"); | |
| 57 | 59 | retval.totallooseoffers = json["totallooseoffers"]; |
| 60 | + if (!intp(json["totalpages"])) error("Expected integer"); | |
| 58 | 61 | retval.totalpages = json["totalpages"]; |
| 62 | + if (!intp(json["totalresultsavailable"])) error("Expected integer"); | |
| 59 | 63 | retval.totalresultsavailable = json["totalresultsavailable"]; |
| 64 | + if (!intp(json["totalresultsreturned"])) error("Expected integer"); | |
| 60 | 65 | retval.totalresultsreturned = json["totalresultsreturned"]; |
| 61 | 66 | |
| 62 | 67 | return retval; |
| @@ -95,11 +100,13 @@ Category Category_from_JSON(mixed json) { | ||
| 95 | 100 | retval.concatenatecategoryname = json["concatenatecategoryname"]; |
| 96 | 101 | if (json["hasoffer"] != Standards.JSON.true && json["hasoffer"] != Standards.JSON.false) error("Expected bool"); |
| 97 | 102 | retval.hasoffer = json["hasoffer"]; |
| 103 | + if (!intp(json["id"])) error("Expected integer"); | |
| 98 | 104 | retval.id = json["id"]; |
| 99 | 105 | if (json["isfinal"] != Standards.JSON.true && json["isfinal"] != Standards.JSON.false) error("Expected bool"); |
| 100 | 106 | retval.isfinal = json["isfinal"]; |
| 101 | 107 | retval.links = json["links"]; |
| 102 | 108 | retval.name = json["name"]; |
| 109 | + if (!intp(json["parentcategoryid"])) error("Expected integer"); | |
| 103 | 110 | retval.parentcategoryid = json["parentcategoryid"]; |
| 104 | 111 | CategoryThumbnail_from_JSON(json["thumbnail"]); |
| 105 | 112 | retval.thumbnail = json["thumbnail"]; |
| @@ -200,9 +207,11 @@ Details Details_from_JSON(mixed json) { | ||
| 200 | 207 | |
| 201 | 208 | retval.applicationid = json["applicationid"]; |
| 202 | 209 | retval.applicationversion = json["applicationversion"]; |
| 210 | + if (!intp(json["code"])) error("Expected integer"); | |
| 203 | 211 | retval.code = json["code"]; |
| 204 | 212 | Date_from_JSON(json["date"]); |
| 205 | 213 | retval.date = json["date"]; |
| 214 | + if (!intp(json["elapsedtime"])) error("Expected integer"); | |
| 206 | 215 | retval.elapsedtime = json["elapsedtime"]; |
| 207 | 216 | retval.message = json["message"]; |
| 208 | 217 | retval.status = json["status"]; |
| @@ -245,19 +254,27 @@ class Date { | ||
| 245 | 254 | Date Date_from_JSON(mixed json) { |
| 246 | 255 | Date retval = Date(); |
| 247 | 256 | |
| 257 | + if (!intp(json["day"])) error("Expected integer"); | |
| 248 | 258 | retval.day = json["day"]; |
| 249 | 259 | Eonandyear_from_JSON(json["eonandyear"]); |
| 250 | 260 | retval.eonandyear = json["eonandyear"]; |
| 261 | + if (!intp(json["hour"])) error("Expected integer"); | |
| 251 | 262 | retval.hour = json["hour"]; |
| 263 | + if (!intp(json["millisecond"])) error("Expected integer"); | |
| 252 | 264 | retval.millisecond = json["millisecond"]; |
| 265 | + if (!intp(json["minute"])) error("Expected integer"); | |
| 253 | 266 | retval.minute = json["minute"]; |
| 267 | + if (!intp(json["month"])) error("Expected integer"); | |
| 254 | 268 | retval.month = json["month"]; |
| 269 | + if (!intp(json["second"])) error("Expected integer"); | |
| 255 | 270 | retval.second = json["second"]; |
| 271 | + if (!intp(json["timezone"])) error("Expected integer"); | |
| 256 | 272 | retval.timezone = json["timezone"]; |
| 257 | 273 | if (json["valid"] != Standards.JSON.true && json["valid"] != Standards.JSON.false) error("Expected bool"); |
| 258 | 274 | retval.valid = json["valid"]; |
| 259 | 275 | Xmlschematype_from_JSON(json["xmlschematype"]); |
| 260 | 276 | retval.xmlschematype = json["xmlschematype"]; |
| 277 | + if (!intp(json["year"])) error("Expected integer"); | |
| 261 | 278 | retval.year = json["year"]; |
| 262 | 279 | |
| 263 | 280 | return retval; |
| @@ -278,6 +295,7 @@ class Eonandyear { | ||
| 278 | 295 | Eonandyear Eonandyear_from_JSON(mixed json) { |
| 279 | 296 | Eonandyear retval = Eonandyear(); |
| 280 | 297 | |
| 298 | + if (!intp(json["lowestsetbit"])) error("Expected integer"); | |
| 281 | 299 | retval.lowestsetbit = json["lowestsetbit"]; |
| 282 | 300 | |
| 283 | 301 | return retval; |
| @@ -375,6 +393,7 @@ class ProductProduct { | ||
| 375 | 393 | ProductProduct ProductProduct_from_JSON(mixed json) { |
| 376 | 394 | ProductProduct retval = ProductProduct(); |
| 377 | 395 | |
| 396 | + if (!intp(json["categoryid"])) error("Expected integer"); | |
| 378 | 397 | retval.categoryid = json["categoryid"]; |
| 379 | 398 | Currency_from_JSON(json["currency"]); |
| 380 | 399 | retval.currency = json["currency"]; |
| @@ -384,12 +403,15 @@ ProductProduct ProductProduct_from_JSON(mixed json) { | ||
| 384 | 403 | retval.fulldescription = json["fulldescription"]; |
| 385 | 404 | if (json["hasmetasearch"] != Standards.JSON.true && json["hasmetasearch"] != Standards.JSON.false) error("Expected bool"); |
| 386 | 405 | retval.hasmetasearch = json["hasmetasearch"]; |
| 406 | + if (!intp(json["id"])) error("Expected integer"); | |
| 387 | 407 | retval.id = json["id"]; |
| 388 | 408 | retval.links = json["links"]; |
| 409 | + if (!intp(json["numoffers"])) error("Expected integer"); | |
| 389 | 410 | retval.numoffers = json["numoffers"]; |
| 390 | 411 | retval.pricemax = json["pricemax"]; |
| 391 | 412 | retval.pricemin = json["pricemin"]; |
| 392 | 413 | retval.productname = json["productname"]; |
| 414 | + if (!intp(json["quantity"])) error("Expected integer"); | |
| 393 | 415 | retval.quantity = json["quantity"]; |
| 394 | 416 | Rating_from_JSON(json["rating"]); |
| 395 | 417 | retval.rating = json["rating"]; |
| @@ -397,6 +419,7 @@ ProductProduct ProductProduct_from_JSON(mixed json) { | ||
| 397 | 419 | retval.specification = json["specification"]; |
| 398 | 420 | FormatsClass_from_JSON(json["thumbnail"]); |
| 399 | 421 | retval.thumbnail = json["thumbnail"]; |
| 422 | + if (!intp(json["totalsellers"])) error("Expected integer"); | |
| 400 | 423 | retval.totalsellers = json["totalsellers"]; |
| 401 | 424 | |
| 402 | 425 | return retval; |
| @@ -463,6 +486,7 @@ Useraveragerating Useraveragerating_from_JSON(mixed json) { | ||
| 463 | 486 | Useraveragerating retval = Useraveragerating(); |
| 464 | 487 | |
| 465 | 488 | retval.links = json["links"]; |
| 489 | + if (!intp(json["numcomments"])) error("Expected integer"); | |
| 466 | 490 | retval.numcomments = json["numcomments"]; |
| 467 | 491 | retval.rating = json["rating"]; |
| 468 | 492 | |
| @@ -532,8 +556,10 @@ FormatsClass FormatsClass_from_JSON(mixed json) { | ||
| 532 | 556 | FormatsClass retval = FormatsClass(); |
| 533 | 557 | |
| 534 | 558 | retval.formats = json["formats"]; |
| 559 | + if (!intp(json["height"])) error("Expected integer"); | |
| 535 | 560 | retval.height = json["height"]; |
| 536 | 561 | retval.url = json["url"]; |
| 562 | + if (!intp(json["width"])) error("Expected integer"); | |
| 537 | 563 | retval.width = json["width"]; |
| 538 | 564 | |
| 539 | 565 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/priority/uuids.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -40,6 +40,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 40 | 40 | if (json["booleanValue"] != Standards.JSON.true && json["booleanValue"] != Standards.JSON.false) error("Expected bool"); |
| 41 | 41 | retval.boolean_value = json["booleanValue"]; |
| 42 | 42 | retval.double_value = (float)json["doubleValue"]; |
| 43 | + if (!intp(json["intValue"])) error("Expected integer"); | |
| 43 | 44 | retval.int_value = json["intValue"]; |
| 44 | 45 | retval.string_value = json["stringValue"]; |
| 45 | 46 | retval.uuid_value = json["uuidValue"]; |
Test case
1 generated file · +3 −0test/inputs/json/samples/bitcoin-block.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -35,9 +35,12 @@ class TopLevel { | ||
| 35 | 35 | TopLevel TopLevel_from_JSON(mixed json) { |
| 36 | 36 | TopLevel retval = TopLevel(); |
| 37 | 37 | |
| 38 | + if (!intp(json["block_index"])) error("Expected integer"); | |
| 38 | 39 | retval.block_index = json["block_index"]; |
| 39 | 40 | retval.hash = json["hash"]; |
| 41 | + if (!intp(json["height"])) error("Expected integer"); | |
| 40 | 42 | retval.height = json["height"]; |
| 43 | + if (!intp(json["time"])) error("Expected integer"); | |
| 41 | 44 | retval.time = json["time"]; |
| 42 | 45 | retval.tx_indexes = json["txIndexes"]; |
Test case
1 generated file · +29 −0test/inputs/json/samples/github-events.json
Mpikedefault / TopLevel.pmod+29 −0
| @@ -92,6 +92,7 @@ Actor Actor_from_JSON(mixed json) { | ||
| 92 | 92 | retval.avatar_url = json["avatar_url"]; |
| 93 | 93 | retval.display_login = json["display_login"]; |
| 94 | 94 | retval.gravatar_id = json["gravatar_id"]; |
| 95 | + if (!intp(json["id"])) error("Expected integer"); | |
| 95 | 96 | retval.id = json["id"]; |
| 96 | 97 | retval.login = json["login"]; |
| 97 | 98 | retval.url = json["url"]; |
| @@ -199,6 +200,7 @@ Comment Comment_from_JSON(mixed json) { | ||
| 199 | 200 | retval.body = json["body"]; |
| 200 | 201 | retval.created_at = json["created_at"]; |
| 201 | 202 | retval.html_url = json["html_url"]; |
| 203 | + if (!intp(json["id"])) error("Expected integer"); | |
| 202 | 204 | retval.id = json["id"]; |
| 203 | 205 | retval.issue_url = json["issue_url"]; |
| 204 | 206 | retval.updated_at = json["updated_at"]; |
| @@ -263,6 +265,7 @@ User User_from_JSON(mixed json) { | ||
| 263 | 265 | retval.gists_url = json["gists_url"]; |
| 264 | 266 | retval.gravatar_id = json["gravatar_id"]; |
| 265 | 267 | retval.html_url = json["html_url"]; |
| 268 | + if (!intp(json["id"])) error("Expected integer"); | |
| 266 | 269 | retval.id = json["id"]; |
| 267 | 270 | retval.login = json["login"]; |
| 268 | 271 | retval.organizations_url = json["organizations_url"]; |
| @@ -406,11 +409,13 @@ Issue Issue_from_JSON(mixed json) { | ||
| 406 | 409 | retval.body = json["body"]; |
| 407 | 410 | if (!has_index(json, "closed_at")) error("Missing required property"); |
| 408 | 411 | retval.closed_at = json["closed_at"]; |
| 412 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 409 | 413 | retval.comments = json["comments"]; |
| 410 | 414 | retval.comments_url = json["comments_url"]; |
| 411 | 415 | retval.created_at = json["created_at"]; |
| 412 | 416 | retval.events_url = json["events_url"]; |
| 413 | 417 | retval.html_url = json["html_url"]; |
| 418 | + if (!intp(json["id"])) error("Expected integer"); | |
| 414 | 419 | retval.id = json["id"]; |
| 415 | 420 | retval.labels = json["labels"]; |
| 416 | 421 | retval.labels_url = json["labels_url"]; |
| @@ -419,6 +424,7 @@ Issue Issue_from_JSON(mixed json) { | ||
| 419 | 424 | if (!has_index(json, "milestone")) error("Missing required property"); |
| 420 | 425 | if (has_index(json, "milestone") && json["milestone"] != Val.null) Milestone_from_JSON(json["milestone"]); |
| 421 | 426 | retval.milestone = json["milestone"]; |
| 427 | + if (!intp(json["number"])) error("Expected integer"); | |
| 422 | 428 | retval.number = json["number"]; |
| 423 | 429 | if (has_index(json, "pull_request") && json["pull_request"] != Val.null) IssuePullRequest_from_JSON(json["pull_request"]); |
| 424 | 430 | retval.pull_request = json["pull_request"]; |
| @@ -457,6 +463,7 @@ Label Label_from_JSON(mixed json) { | ||
| 457 | 463 | Label retval = Label(); |
| 458 | 464 | |
| 459 | 465 | retval.color = json["color"]; |
| 466 | + if (!intp(json["id"])) error("Expected integer"); | |
| 460 | 467 | retval.id = json["id"]; |
| 461 | 468 | if (json["default"] != Standards.JSON.true && json["default"] != Standards.JSON.false) error("Expected bool"); |
| 462 | 469 | retval.label_default = json["default"]; |
| @@ -510,6 +517,7 @@ Milestone Milestone_from_JSON(mixed json) { | ||
| 510 | 517 | Milestone retval = Milestone(); |
| 511 | 518 | |
| 512 | 519 | retval.closed_at = json["closed_at"]; |
| 520 | + if (!intp(json["closed_issues"])) error("Expected integer"); | |
| 513 | 521 | retval.closed_issues = json["closed_issues"]; |
| 514 | 522 | retval.created_at = json["created_at"]; |
| 515 | 523 | User_from_JSON(json["creator"]); |
| @@ -518,9 +526,12 @@ Milestone Milestone_from_JSON(mixed json) { | ||
| 518 | 526 | if (!has_index(json, "due_on")) error("Missing required property"); |
| 519 | 527 | retval.due_on = json["due_on"]; |
| 520 | 528 | retval.html_url = json["html_url"]; |
| 529 | + if (!intp(json["id"])) error("Expected integer"); | |
| 521 | 530 | retval.id = json["id"]; |
| 522 | 531 | retval.labels_url = json["labels_url"]; |
| 532 | + if (!intp(json["number"])) error("Expected integer"); | |
| 523 | 533 | retval.number = json["number"]; |
| 534 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 524 | 535 | retval.open_issues = json["open_issues"]; |
| 525 | 536 | retval.state = json["state"]; |
| 526 | 537 | retval.title = json["title"]; |
| @@ -654,24 +665,30 @@ class PayloadPullRequest { | ||
| 654 | 665 | PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) { |
| 655 | 666 | PayloadPullRequest retval = PayloadPullRequest(); |
| 656 | 667 | |
| 668 | + if (!intp(json["additions"])) error("Expected integer"); | |
| 657 | 669 | retval.additions = json["additions"]; |
| 658 | 670 | retval.assignee = json["assignee"]; |
| 659 | 671 | retval.assignees = json["assignees"]; |
| 660 | 672 | Base_from_JSON(json["base"]); |
| 661 | 673 | retval.base = json["base"]; |
| 662 | 674 | retval.body = json["body"]; |
| 675 | + if (!intp(json["changed_files"])) error("Expected integer"); | |
| 663 | 676 | retval.changed_files = json["changed_files"]; |
| 664 | 677 | retval.closed_at = json["closed_at"]; |
| 678 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 665 | 679 | retval.comments = json["comments"]; |
| 666 | 680 | retval.comments_url = json["comments_url"]; |
| 681 | + if (!intp(json["commits"])) error("Expected integer"); | |
| 667 | 682 | retval.commits = json["commits"]; |
| 668 | 683 | retval.commits_url = json["commits_url"]; |
| 669 | 684 | retval.created_at = json["created_at"]; |
| 685 | + if (!intp(json["deletions"])) error("Expected integer"); | |
| 670 | 686 | retval.deletions = json["deletions"]; |
| 671 | 687 | retval.diff_url = json["diff_url"]; |
| 672 | 688 | Base_from_JSON(json["head"]); |
| 673 | 689 | retval.head = json["head"]; |
| 674 | 690 | retval.html_url = json["html_url"]; |
| 691 | + if (!intp(json["id"])) error("Expected integer"); | |
| 675 | 692 | retval.id = json["id"]; |
| 676 | 693 | retval.issue_url = json["issue_url"]; |
| 677 | 694 | Links_from_JSON(json["_links"]); |
| @@ -689,11 +706,13 @@ PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) { | ||
| 689 | 706 | User_from_JSON(json["merged_by"]); |
| 690 | 707 | retval.merged_by = json["merged_by"]; |
| 691 | 708 | retval.milestone = json["milestone"]; |
| 709 | + if (!intp(json["number"])) error("Expected integer"); | |
| 692 | 710 | retval.number = json["number"]; |
| 693 | 711 | retval.patch_url = json["patch_url"]; |
| 694 | 712 | retval.rebaseable = json["rebaseable"]; |
| 695 | 713 | retval.requested_reviewers = json["requested_reviewers"]; |
| 696 | 714 | retval.review_comment_url = json["review_comment_url"]; |
| 715 | + if (!intp(json["review_comments"])) error("Expected integer"); | |
| 697 | 716 | retval.review_comments = json["review_comments"]; |
| 698 | 717 | retval.review_comments_url = json["review_comments_url"]; |
| 699 | 718 | retval.state = json["state"]; |
| @@ -911,7 +930,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 911 | 930 | retval.events_url = json["events_url"]; |
| 912 | 931 | if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool"); |
| 913 | 932 | retval.fork = json["fork"]; |
| 933 | + if (!intp(json["forks"])) error("Expected integer"); | |
| 914 | 934 | retval.forks = json["forks"]; |
| 935 | + if (!intp(json["forks_count"])) error("Expected integer"); | |
| 915 | 936 | retval.forks_count = json["forks_count"]; |
| 916 | 937 | retval.forks_url = json["forks_url"]; |
| 917 | 938 | retval.full_name = json["full_name"]; |
| @@ -932,6 +953,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 932 | 953 | retval.homepage = json["homepage"]; |
| 933 | 954 | retval.hooks_url = json["hooks_url"]; |
| 934 | 955 | retval.html_url = json["html_url"]; |
| 956 | + if (!intp(json["id"])) error("Expected integer"); | |
| 935 | 957 | retval.id = json["id"]; |
| 936 | 958 | retval.issue_comment_url = json["issue_comment_url"]; |
| 937 | 959 | retval.issue_events_url = json["issue_events_url"]; |
| @@ -945,7 +967,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 945 | 967 | retval.mirror_url = json["mirror_url"]; |
| 946 | 968 | retval.name = json["name"]; |
| 947 | 969 | retval.notifications_url = json["notifications_url"]; |
| 970 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 948 | 971 | retval.open_issues = json["open_issues"]; |
| 972 | + if (!intp(json["open_issues_count"])) error("Expected integer"); | |
| 949 | 973 | retval.open_issues_count = json["open_issues_count"]; |
| 950 | 974 | User_from_JSON(json["owner"]); |
| 951 | 975 | retval.owner = json["owner"]; |
| @@ -954,8 +978,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 954 | 978 | retval.releases_url = json["releases_url"]; |
| 955 | 979 | if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool"); |
| 956 | 980 | retval.repo_private = json["private"]; |
| 981 | + if (!intp(json["size"])) error("Expected integer"); | |
| 957 | 982 | retval.size = json["size"]; |
| 958 | 983 | retval.ssh_url = json["ssh_url"]; |
| 984 | + if (!intp(json["stargazers_count"])) error("Expected integer"); | |
| 959 | 985 | retval.stargazers_count = json["stargazers_count"]; |
| 960 | 986 | retval.stargazers_url = json["stargazers_url"]; |
| 961 | 987 | retval.statuses_url = json["statuses_url"]; |
| @@ -967,7 +993,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 967 | 993 | retval.trees_url = json["trees_url"]; |
| 968 | 994 | retval.updated_at = json["updated_at"]; |
| 969 | 995 | retval.url = json["url"]; |
| 996 | + if (!intp(json["watchers"])) error("Expected integer"); | |
| 970 | 997 | retval.watchers = json["watchers"]; |
| 998 | + if (!intp(json["watchers_count"])) error("Expected integer"); | |
| 971 | 999 | retval.watchers_count = json["watchers_count"]; |
| 972 | 1000 | |
| 973 | 1001 | return retval; |
| @@ -1061,6 +1089,7 @@ class TopLevelRepo { | ||
| 1061 | 1089 | TopLevelRepo TopLevelRepo_from_JSON(mixed json) { |
| 1062 | 1090 | TopLevelRepo retval = TopLevelRepo(); |
| 1063 | 1091 | |
| 1092 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1064 | 1093 | retval.id = json["id"]; |
| 1065 | 1094 | retval.name = json["name"]; |
| 1066 | 1095 | retval.url = json["url"]; |
Test case
1 generated file · +2 −0test/inputs/json/samples/kitchen-sink.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -58,6 +58,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 58 | 58 | retval.date_value = json["dateValue"]; |
| 59 | 59 | retval.different_things = json["differentThings"]; |
| 60 | 60 | retval.double_value = (float)json["doubleValue"]; |
| 61 | + if (!intp(json["intValue"])) error("Expected integer"); | |
| 61 | 62 | retval.int_value = json["intValue"]; |
| 62 | 63 | foreach (json["mapValue"]; mixed _; mixed value) if (stringp(value)) error("Unexpected string"); |
| 63 | 64 | retval.map_value = json["mapValue"]; |
| @@ -151,6 +152,7 @@ class PurplePerson { | ||
| 151 | 152 | PurplePerson PurplePerson_from_JSON(mixed json) { |
| 152 | 153 | PurplePerson retval = PurplePerson(); |
| 153 | 154 | |
| 155 | + if (!intp(json["intOrString"])) error("Expected integer"); | |
| 154 | 156 | retval.int_or_string = json["intOrString"]; |
| 155 | 157 | retval.name = json["name"]; |
Test case
1 generated file · +1 −0test/inputs/json/samples/null-safe.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -57,6 +57,7 @@ Item Item_from_JSON(mixed json) { | ||
| 57 | 57 | retval.address = json["address"]; |
| 58 | 58 | retval.created_at = json["created_at"]; |
| 59 | 59 | retval.name = json["name"]; |
| 60 | + if (!intp(json["sex"])) error("Expected integer"); | |
| 60 | 61 | if (!has_index(json, "sex")) error("Missing required property"); |
| 61 | 62 | retval.sex = json["sex"]; |
Test case
1 generated file · +1 −0test/inputs/json/samples/pokedex.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -84,6 +84,7 @@ Pokemon Pokemon_from_JSON(mixed json) { | ||
| 84 | 84 | retval.candy_count = json["candy_count"]; |
| 85 | 85 | retval.egg = Egg_from_JSON(json["egg"]); |
| 86 | 86 | retval.height = json["height"]; |
| 87 | + if (!intp(json["id"])) error("Expected integer"); | |
| 87 | 88 | retval.id = json["id"]; |
| 88 | 89 | retval.img = json["img"]; |
| 89 | 90 | if (!has_index(json, "multipliers")) error("Missing required property"); |
Test case
1 generated file · +11 −0test/inputs/json/samples/reddit.json
Mpikedefault / TopLevel.pmod+11 −0
| @@ -255,14 +255,18 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 255 | 255 | retval.clicked = json["clicked"]; |
| 256 | 256 | if (json["contest_mode"] != Standards.JSON.true && json["contest_mode"] != Standards.JSON.false) error("Expected bool"); |
| 257 | 257 | retval.contest_mode = json["contest_mode"]; |
| 258 | + if (!intp(json["created"])) error("Expected integer"); | |
| 258 | 259 | retval.created = json["created"]; |
| 260 | + if (!intp(json["created_utc"])) error("Expected integer"); | |
| 259 | 261 | retval.created_utc = json["created_utc"]; |
| 260 | 262 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 261 | 263 | retval.distinguished = json["distinguished"]; |
| 262 | 264 | retval.domain = Domain_from_JSON(json["domain"]); |
| 265 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 263 | 266 | retval.downs = json["downs"]; |
| 264 | 267 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 265 | 268 | retval.edited = json["edited"]; |
| 269 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 266 | 270 | retval.gilded = json["gilded"]; |
| 267 | 271 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 268 | 272 | retval.hidden = json["hidden"]; |
| @@ -285,6 +289,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 285 | 289 | retval.media_embed = json["media_embed"]; |
| 286 | 290 | retval.mod_reports = json["mod_reports"]; |
| 287 | 291 | retval.name = json["name"]; |
| 292 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 288 | 293 | retval.num_comments = json["num_comments"]; |
| 289 | 294 | retval.num_reports = json["num_reports"]; |
| 290 | 295 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -300,6 +305,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 300 | 305 | retval.report_reasons = json["report_reasons"]; |
| 301 | 306 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 302 | 307 | retval.saved = json["saved"]; |
| 308 | + if (!intp(json["score"])) error("Expected integer"); | |
| 303 | 309 | retval.score = json["score"]; |
| 304 | 310 | retval.secure_media = json["secure_media"]; |
| 305 | 311 | MediaEmbed_from_JSON(json["secure_media_embed"]); |
| @@ -316,9 +322,12 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 316 | 322 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 317 | 323 | retval.suggested_sort = json["suggested_sort"]; |
| 318 | 324 | retval.thumbnail = json["thumbnail"]; |
| 325 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 319 | 326 | retval.thumbnail_height = json["thumbnail_height"]; |
| 327 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 320 | 328 | retval.thumbnail_width = json["thumbnail_width"]; |
| 321 | 329 | retval.title = json["title"]; |
| 330 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 322 | 331 | retval.ups = json["ups"]; |
| 323 | 332 | retval.url = json["url"]; |
| 324 | 333 | retval.user_reports = json["user_reports"]; |
| @@ -448,8 +457,10 @@ class Source { | ||
| 448 | 457 | Source Source_from_JSON(mixed json) { |
| 449 | 458 | Source retval = Source(); |
| 450 | 459 | |
| 460 | + if (!intp(json["height"])) error("Expected integer"); | |
| 451 | 461 | retval.height = json["height"]; |
| 452 | 462 | retval.url = json["url"]; |
| 463 | + if (!intp(json["width"])) error("Expected integer"); | |
| 453 | 464 | retval.width = json["width"]; |
| 454 | 465 | |
| 455 | 466 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/samples/simple-object.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -31,6 +31,7 @@ class TopLevel { | ||
| 31 | 31 | TopLevel TopLevel_from_JSON(mixed json) { |
| 32 | 32 | TopLevel retval = TopLevel(); |
| 33 | 33 | |
| 34 | + if (!intp(json["date"])) error("Expected integer"); | |
| 34 | 35 | retval.date = json["date"]; |
| 35 | 36 | retval.title = json["title"]; |
| 36 | 37 | if (json["validity"] != Standards.JSON.true && json["validity"] != Standards.JSON.false) error("Expected bool"); |
Test case
1 generated file · +9 −0test/inputs/json/samples/spotify-album.json
Mpikedefault / TopLevel.pmod+9 −0
| @@ -72,6 +72,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 72 | 72 | retval.id = json["id"]; |
| 73 | 73 | retval.images = json["images"]; |
| 74 | 74 | retval.name = json["name"]; |
| 75 | + if (!intp(json["popularity"])) error("Expected integer"); | |
| 75 | 76 | retval.popularity = json["popularity"]; |
| 76 | 77 | retval.release_date = json["release_date"]; |
| 77 | 78 | retval.release_date_precision = json["release_date_precision"]; |
| @@ -201,8 +202,10 @@ class Image { | ||
| 201 | 202 | Image Image_from_JSON(mixed json) { |
| 202 | 203 | Image retval = Image(); |
| 203 | 204 | |
| 205 | + if (!intp(json["height"])) error("Expected integer"); | |
| 204 | 206 | retval.height = json["height"]; |
| 205 | 207 | retval.url = json["url"]; |
| 208 | + if (!intp(json["width"])) error("Expected integer"); | |
| 206 | 209 | retval.width = json["width"]; |
| 207 | 210 | |
| 208 | 211 | return retval; |
| @@ -237,10 +240,13 @@ Tracks Tracks_from_JSON(mixed json) { | ||
| 237 | 240 | |
| 238 | 241 | retval.href = json["href"]; |
| 239 | 242 | retval.items = json["items"]; |
| 243 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 240 | 244 | retval.limit = json["limit"]; |
| 241 | 245 | retval.next = json["next"]; |
| 246 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 242 | 247 | retval.offset = json["offset"]; |
| 243 | 248 | retval.previous = json["previous"]; |
| 249 | + if (!intp(json["total"])) error("Expected integer"); | |
| 244 | 250 | retval.total = json["total"]; |
| 245 | 251 | |
| 246 | 252 | return retval; |
| @@ -287,7 +293,9 @@ Item Item_from_JSON(mixed json) { | ||
| 287 | 293 | |
| 288 | 294 | retval.artists = json["artists"]; |
| 289 | 295 | retval.available_markets = json["available_markets"]; |
| 296 | + if (!intp(json["disc_number"])) error("Expected integer"); | |
| 290 | 297 | retval.disc_number = json["disc_number"]; |
| 298 | + if (!intp(json["duration_ms"])) error("Expected integer"); | |
| 291 | 299 | retval.duration_ms = json["duration_ms"]; |
| 292 | 300 | if (json["explicit"] != Standards.JSON.true && json["explicit"] != Standards.JSON.false) error("Expected bool"); |
| 293 | 301 | retval.explicit = json["explicit"]; |
| @@ -297,6 +305,7 @@ Item Item_from_JSON(mixed json) { | ||
| 297 | 305 | retval.id = json["id"]; |
| 298 | 306 | retval.name = json["name"]; |
| 299 | 307 | retval.preview_url = json["preview_url"]; |
| 308 | + if (!intp(json["track_number"])) error("Expected integer"); | |
| 300 | 309 | retval.track_number = json["track_number"]; |
| 301 | 310 | retval.type = json["type"]; |
| 302 | 311 | retval.uri = json["uri"]; |
Test case
1 generated file · +1 −0test/inputs/json/samples/us-avg-temperatures.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -81,6 +81,7 @@ Description Description_from_JSON(mixed json) { | ||
| 81 | 81 | Description retval = Description(); |
| 82 | 82 | |
| 83 | 83 | retval.base_period = json["base_period"]; |
| 84 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 84 | 85 | retval.missing = json["missing"]; |
| 85 | 86 | retval.title = json["title"]; |
| 86 | 87 | retval.units = json["units"]; |
Test case
1 generated file · +4 −0test/inputs/json/samples/us-senators.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -55,8 +55,11 @@ class Meta { | ||
| 55 | 55 | Meta Meta_from_JSON(mixed json) { |
| 56 | 56 | Meta retval = Meta(); |
| 57 | 57 | |
| 58 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 58 | 59 | retval.limit = json["limit"]; |
| 60 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 59 | 61 | retval.offset = json["offset"]; |
| 62 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 60 | 63 | retval.total_count = json["total_count"]; |
| 61 | 64 | |
| 62 | 65 | return retval; |
| @@ -241,6 +244,7 @@ Person Person_from_JSON(mixed json) { | ||
| 241 | 244 | |
| 242 | 245 | retval.bioguideid = json["bioguideid"]; |
| 243 | 246 | retval.birthday = json["birthday"]; |
| 247 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 244 | 248 | retval.cspanid = json["cspanid"]; |
| 245 | 249 | retval.firstname = json["firstname"]; |
| 246 | 250 | retval.gender = Gender_from_JSON(json["gender"]); |
Test case
1 generated file · +1 −0test/inputs/schema/const-non-string.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -35,6 +35,7 @@ class TopLevel { | ||
| 35 | 35 | TopLevel TopLevel_from_JSON(mixed json) { |
| 36 | 36 | TopLevel retval = TopLevel(); |
| 37 | 37 | |
| 38 | + if (!intp(json["amount"])) error("Expected integer"); | |
| 38 | 39 | retval.amount = json["amount"]; |
| 39 | 40 | if (json["enabled"] != Standards.JSON.true && json["enabled"] != Standards.JSON.false) error("Expected bool"); |
| 40 | 41 | retval.enabled = json["enabled"]; |
Test case
1 generated file · +1 −0test/inputs/schema/cut-enum.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -27,6 +27,7 @@ class TopLevel { | ||
| 27 | 27 | TopLevel TopLevel_from_JSON(mixed json) { |
| 28 | 28 | TopLevel retval = TopLevel(); |
| 29 | 29 | |
| 30 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 30 | 31 | retval.foo = json["foo"]; |
| 31 | 32 | |
| 32 | 33 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/default-value.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -28,6 +28,7 @@ class TopLevel { | ||
| 28 | 28 | TopLevel TopLevel_from_JSON(mixed json) { |
| 29 | 29 | TopLevel retval = TopLevel(); |
| 30 | 30 | |
| 31 | + if (!intp(json["id"])) error("Expected integer"); | |
| 31 | 32 | retval.id = json["id"]; |
| 32 | 33 | |
| 33 | 34 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/id-no-address.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -27,6 +27,7 @@ class TopLevel { | ||
| 27 | 27 | TopLevel TopLevel_from_JSON(mixed json) { |
| 28 | 28 | TopLevel retval = TopLevel(); |
| 29 | 29 | |
| 30 | + if (!intp(json["item"])) error("Expected integer"); | |
| 30 | 31 | retval.item = json["item"]; |
| 31 | 32 | |
| 32 | 33 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/id-root.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -27,6 +27,7 @@ class TopLevel { | ||
| 27 | 27 | TopLevel TopLevel_from_JSON(mixed json) { |
| 28 | 28 | TopLevel retval = TopLevel(); |
| 29 | 29 | |
| 30 | + if (!intp(json["bar"])) error("Expected integer"); | |
| 30 | 31 | retval.bar = json["bar"]; |
| 31 | 32 | |
| 32 | 33 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-all-of.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -31,6 +31,7 @@ class TopLevel { | ||
| 31 | 31 | TopLevel TopLevel_from_JSON(mixed json) { |
| 32 | 32 | TopLevel retval = TopLevel(); |
| 33 | 33 | |
| 34 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 34 | 35 | retval.foo = json["foo"]; |
| 35 | 36 | if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool"); |
| 36 | 37 | retval.bar = json["bar"]; |
Test case
1 generated file · +1 −0test/inputs/schema/implicit-one-of.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -31,6 +31,7 @@ class TopLevel { | ||
| 31 | 31 | TopLevel TopLevel_from_JSON(mixed json) { |
| 32 | 32 | TopLevel retval = TopLevel(); |
| 33 | 33 | |
| 34 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 34 | 35 | retval.foo = json["foo"]; |
| 35 | 36 | retval.bar = json["bar"]; |
| 36 | 37 | retval.quux = json["quux"]; |
Test case
1 generated file · +9 −0test/inputs/schema/integer-type.schema
Mschema-pikedefault / TopLevel.pmod+9 −0
| @@ -45,26 +45,35 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 45 | 45 | |
| 46 | 46 | if (json["above_i32_max"] < 0) error("Value below minimum"); |
| 47 | 47 | if (json["above_i32_max"] > 2147483648) error("Value above maximum"); |
| 48 | + if (!intp(json["above_i32_max"])) error("Expected integer"); | |
| 48 | 49 | retval.above_i32_max = json["above_i32_max"]; |
| 49 | 50 | if (json["below_i32_min"] < -2147483649) error("Value below minimum"); |
| 50 | 51 | if (json["below_i32_min"] > 0) error("Value above maximum"); |
| 52 | + if (!intp(json["below_i32_min"])) error("Expected integer"); | |
| 51 | 53 | retval.below_i32_min = json["below_i32_min"]; |
| 52 | 54 | if (json["i32_range"] < -2147483648) error("Value below minimum"); |
| 53 | 55 | if (json["i32_range"] > 2147483647) error("Value above maximum"); |
| 56 | + if (!intp(json["i32_range"])) error("Expected integer"); | |
| 54 | 57 | retval.i32_range = json["i32_range"]; |
| 55 | 58 | if (json["large_bounds"] < -9007199254740991) error("Value below minimum"); |
| 56 | 59 | if (json["large_bounds"] > 9007199254740991) error("Value above maximum"); |
| 60 | + if (!intp(json["large_bounds"])) error("Expected integer"); | |
| 57 | 61 | retval.large_bounds = json["large_bounds"]; |
| 58 | 62 | if (json["only_maximum"] > 0) error("Value above maximum"); |
| 63 | + if (!intp(json["only_maximum"])) error("Expected integer"); | |
| 59 | 64 | retval.only_maximum = json["only_maximum"]; |
| 60 | 65 | if (json["only_minimum"] < 0) error("Value below minimum"); |
| 66 | + if (!intp(json["only_minimum"])) error("Expected integer"); | |
| 61 | 67 | retval.only_minimum = json["only_minimum"]; |
| 62 | 68 | if (json["small_negative"] < -100) error("Value below minimum"); |
| 63 | 69 | if (json["small_negative"] > 0) error("Value above maximum"); |
| 70 | + if (!intp(json["small_negative"])) error("Expected integer"); | |
| 64 | 71 | retval.small_negative = json["small_negative"]; |
| 65 | 72 | if (json["small_positive"] < 0) error("Value below minimum"); |
| 66 | 73 | if (json["small_positive"] > 100) error("Value above maximum"); |
| 74 | + if (!intp(json["small_positive"])) error("Expected integer"); | |
| 67 | 75 | retval.small_positive = json["small_positive"]; |
| 76 | + if (!intp(json["unbounded"])) error("Expected integer"); | |
| 68 | 77 | retval.unbounded = json["unbounded"]; |
| 69 | 78 | |
| 70 | 79 | return retval; |
Test case
1 generated file · +8 −0test/inputs/schema/minmax-integer.schema
Mschema-pikedefault / TopLevel.pmod+8 −0
| @@ -41,23 +41,31 @@ class TopLevel { | ||
| 41 | 41 | TopLevel TopLevel_from_JSON(mixed json) { |
| 42 | 42 | TopLevel retval = TopLevel(); |
| 43 | 43 | |
| 44 | + if (!intp(json["free"])) error("Expected integer"); | |
| 44 | 45 | retval.free = json["free"]; |
| 45 | 46 | if (json["intersection"] < 4) error("Value below minimum"); |
| 46 | 47 | if (json["intersection"] > 5) error("Value above maximum"); |
| 48 | + if (!intp(json["intersection"])) error("Expected integer"); | |
| 47 | 49 | retval.intersection = json["intersection"]; |
| 48 | 50 | if (json["max"] > 5) error("Value above maximum"); |
| 51 | + if (!intp(json["max"])) error("Expected integer"); | |
| 49 | 52 | retval.max = json["max"]; |
| 50 | 53 | if (json["min"] < 3) error("Value below minimum"); |
| 54 | + if (!intp(json["min"])) error("Expected integer"); | |
| 51 | 55 | retval.min = json["min"]; |
| 52 | 56 | if (json["minmax"] < 3) error("Value below minimum"); |
| 53 | 57 | if (json["minmax"] > 5) error("Value above maximum"); |
| 58 | + if (!intp(json["minmax"])) error("Expected integer"); | |
| 54 | 59 | retval.minmax = json["minmax"]; |
| 55 | 60 | if (json["minMaxIntersection"] < 3) error("Value below minimum"); |
| 56 | 61 | if (json["minMaxIntersection"] > 5) error("Value above maximum"); |
| 62 | + if (!intp(json["minMaxIntersection"])) error("Expected integer"); | |
| 57 | 63 | retval.min_max_intersection = json["minMaxIntersection"]; |
| 64 | + if (!intp(json["minMaxUnion"])) error("Expected integer"); | |
| 58 | 65 | retval.min_max_union = json["minMaxUnion"]; |
| 59 | 66 | if (json["union"] < 3) error("Value below minimum"); |
| 60 | 67 | if (json["union"] > 6) error("Value above maximum"); |
| 68 | + if (!intp(json["union"])) error("Expected integer"); | |
| 61 | 69 | retval.union = json["union"]; |
| 62 | 70 | |
| 63 | 71 | return retval; |
Test case
1 generated file · +2 −0test/inputs/schema/non-standard-ref.schema
Mschema-pikedefault / TopLevel.pmod+2 −0
| @@ -31,7 +31,9 @@ class TopLevel { | ||
| 31 | 31 | TopLevel TopLevel_from_JSON(mixed json) { |
| 32 | 32 | TopLevel retval = TopLevel(); |
| 33 | 33 | |
| 34 | + if (!intp(json["bar"])) error("Expected integer"); | |
| 34 | 35 | retval.bar = json["bar"]; |
| 36 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 35 | 37 | retval.foo = json["foo"]; |
| 36 | 38 | if (json["quux"] != Standards.JSON.true && json["quux"] != Standards.JSON.false) error("Expected bool"); |
| 37 | 39 | retval.quux = json["quux"]; |
Test case
1 generated file · +1 −0test/inputs/schema/optional-const-ref.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -49,6 +49,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 49 | 49 | retval.required_coordinates = json["requiredCoordinates"]; |
| 50 | 50 | if (json["requiredCount"] < 1) error("Value below minimum"); |
| 51 | 51 | if (json["requiredCount"] > 100) error("Value above maximum"); |
| 52 | + if (!intp(json["requiredCount"])) error("Expected integer"); | |
| 52 | 53 | retval.required_count = json["requiredCount"]; |
| 53 | 54 | if (sizeof(json["requiredLabel"]) < 2) error("String too short"); |
| 54 | 55 | if (sizeof(json["requiredLabel"]) > 16) error("String too long"); |
Test case
1 generated file · +1 −0test/inputs/schema/optional-constraints.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -48,6 +48,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 48 | 48 | retval.opt_string = json["optString"]; |
| 49 | 49 | if (json["reqZeroMin"] < 0) error("Value below minimum"); |
| 50 | 50 | if (json["reqZeroMin"] > 100) error("Value above maximum"); |
| 51 | + if (!intp(json["reqZeroMin"])) error("Expected integer"); | |
| 51 | 52 | retval.req_zero_min = json["reqZeroMin"]; |
| 52 | 53 | |
| 53 | 54 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/ref-id-files.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -27,6 +27,7 @@ class TopLevel { | ||
| 27 | 27 | TopLevel TopLevel_from_JSON(mixed json) { |
| 28 | 28 | TopLevel retval = TopLevel(); |
| 29 | 29 | |
| 30 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 30 | 31 | retval.foo = json["foo"]; |
| 31 | 32 | |
| 32 | 33 | return retval; |
Test case
1 generated file · +1 −0test/inputs/schema/required-non-properties.schema
Mschema-pikedefault / TopLevel.pmod+1 −0
| @@ -29,6 +29,7 @@ class TopLevel { | ||
| 29 | 29 | TopLevel TopLevel_from_JSON(mixed json) { |
| 30 | 30 | TopLevel retval = TopLevel(); |
| 31 | 31 | |
| 32 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 32 | 33 | retval.foo = json["foo"]; |
| 33 | 34 | retval.bar = json["bar"]; |
No generated files match these filters.