Test case
1 generated file · +1 −0test/inputs/graphql/github2.graphql
Mgraphql-pikedefault / TopLevel.pmod+1 −0
| @@ -96,6 +96,7 @@ class RepositoryConnection { | ||
| 96 | 96 | RepositoryConnection RepositoryConnection_from_JSON(mixed json) { |
| 97 | 97 | RepositoryConnection retval = RepositoryConnection(); |
| 98 | 98 | |
| 99 | + if (!intp(json["totalCount"])) error("Expected integer"); | |
| 99 | 100 | retval.total_count = json["totalCount"]; |
| 100 | 101 | if (!has_index(json, "nodes")) error("Missing required property"); |
| 101 | 102 | retval.nodes = json["nodes"]; |
Test case
1 generated file · +1 −0test/inputs/graphql/github7.graphql
Mgraphql-pikedefault / TopLevel.pmod+1 −0
| @@ -171,6 +171,7 @@ class Connection { | ||
| 171 | 171 | Connection Connection_from_JSON(mixed json) { |
| 172 | 172 | Connection retval = Connection(); |
| 173 | 173 | |
| 174 | + if (!intp(json["totalCount"])) error("Expected integer"); | |
| 174 | 175 | retval.total_count = json["totalCount"]; |
| 175 | 176 | |
| 176 | 177 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/00c36.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -118,9 +118,12 @@ class FluffyTopLevel { | ||
| 118 | 118 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 119 | 119 | FluffyTopLevel retval = FluffyTopLevel(); |
| 120 | 120 | |
| 121 | + if (!intp(json["page"])) error("Expected integer"); | |
| 121 | 122 | retval.page = json["page"]; |
| 123 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 122 | 124 | retval.pages = json["pages"]; |
| 123 | 125 | retval.per_page = json["per_page"]; |
| 126 | + if (!intp(json["total"])) error("Expected integer"); | |
| 124 | 127 | retval.total = json["total"]; |
| 125 | 128 | |
| 126 | 129 | 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
| @@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) { | ||
| 80 | 80 | Description retval = Description(); |
| 81 | 81 | |
| 82 | 82 | retval.base_period = json["base_period"]; |
| 83 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 83 | 84 | retval.missing = json["missing"]; |
| 84 | 85 | retval.title = json["title"]; |
| 85 | 86 | retval.units = json["units"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/0a358.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -39,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | retval.previous = json["previous"]; |
| @@ -94,6 +97,7 @@ Result Result_from_JSON(mixed json) { | ||
| 94 | 97 | |
| 95 | 98 | retval.code = json["code"]; |
| 96 | 99 | retval.created_at = json["created_at"]; |
| 100 | + if (!intp(json["id"])) error("Expected integer"); | |
| 97 | 101 | retval.id = json["id"]; |
| 98 | 102 | retval.name = json["name"]; |
| 99 | 103 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +20 −0test/inputs/json/misc/0a91a.json
Mpikedefault / TopLevel.pmod+20 −0
| @@ -88,6 +88,7 @@ Actor Actor_from_JSON(mixed json) { | ||
| 88 | 88 | retval.avatar_url = json["avatar_url"]; |
| 89 | 89 | retval.display_login = json["display_login"]; |
| 90 | 90 | retval.gravatar_id = json["gravatar_id"]; |
| 91 | + if (!intp(json["id"])) error("Expected integer"); | |
| 91 | 92 | retval.id = json["id"]; |
| 92 | 93 | retval.login = json["login"]; |
| 93 | 94 | retval.url = json["url"]; |
| @@ -305,22 +306,28 @@ class PullRequest { | ||
| 305 | 306 | PullRequest PullRequest_from_JSON(mixed json) { |
| 306 | 307 | PullRequest retval = PullRequest(); |
| 307 | 308 | |
| 309 | + if (!intp(json["additions"])) error("Expected integer"); | |
| 308 | 310 | retval.additions = json["additions"]; |
| 309 | 311 | retval.assignee = json["assignee"]; |
| 310 | 312 | retval.assignees = json["assignees"]; |
| 311 | 313 | retval.base = json["base"]; |
| 312 | 314 | retval.body = json["body"]; |
| 315 | + if (!intp(json["changed_files"])) error("Expected integer"); | |
| 313 | 316 | retval.changed_files = json["changed_files"]; |
| 314 | 317 | retval.closed_at = json["closed_at"]; |
| 318 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 315 | 319 | retval.comments = json["comments"]; |
| 316 | 320 | retval.comments_url = json["comments_url"]; |
| 321 | + if (!intp(json["commits"])) error("Expected integer"); | |
| 317 | 322 | retval.commits = json["commits"]; |
| 318 | 323 | retval.commits_url = json["commits_url"]; |
| 319 | 324 | retval.created_at = json["created_at"]; |
| 325 | + if (!intp(json["deletions"])) error("Expected integer"); | |
| 320 | 326 | retval.deletions = json["deletions"]; |
| 321 | 327 | retval.diff_url = json["diff_url"]; |
| 322 | 328 | retval.head = json["head"]; |
| 323 | 329 | retval.html_url = json["html_url"]; |
| 330 | + if (!intp(json["id"])) error("Expected integer"); | |
| 324 | 331 | retval.id = json["id"]; |
| 325 | 332 | retval.issue_url = json["issue_url"]; |
| 326 | 333 | retval.links = json["_links"]; |
| @@ -336,11 +343,13 @@ PullRequest PullRequest_from_JSON(mixed json) { | ||
| 336 | 343 | retval.merged_at = json["merged_at"]; |
| 337 | 344 | retval.merged_by = json["merged_by"]; |
| 338 | 345 | retval.milestone = json["milestone"]; |
| 346 | + if (!intp(json["number"])) error("Expected integer"); | |
| 339 | 347 | retval.number = json["number"]; |
| 340 | 348 | retval.patch_url = json["patch_url"]; |
| 341 | 349 | retval.rebaseable = json["rebaseable"]; |
| 342 | 350 | retval.requested_reviewers = json["requested_reviewers"]; |
| 343 | 351 | retval.review_comment_url = json["review_comment_url"]; |
| 352 | + if (!intp(json["review_comments"])) error("Expected integer"); | |
| 344 | 353 | retval.review_comments = json["review_comments"]; |
| 345 | 354 | retval.review_comments_url = json["review_comments_url"]; |
| 346 | 355 | retval.state = json["state"]; |
| @@ -555,7 +564,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 555 | 564 | retval.events_url = json["events_url"]; |
| 556 | 565 | if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool"); |
| 557 | 566 | retval.fork = json["fork"]; |
| 567 | + if (!intp(json["forks"])) error("Expected integer"); | |
| 558 | 568 | retval.forks = json["forks"]; |
| 569 | + if (!intp(json["forks_count"])) error("Expected integer"); | |
| 559 | 570 | retval.forks_count = json["forks_count"]; |
| 560 | 571 | retval.forks_url = json["forks_url"]; |
| 561 | 572 | retval.full_name = json["full_name"]; |
| @@ -576,6 +587,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 576 | 587 | retval.homepage = json["homepage"]; |
| 577 | 588 | retval.hooks_url = json["hooks_url"]; |
| 578 | 589 | retval.html_url = json["html_url"]; |
| 590 | + if (!intp(json["id"])) error("Expected integer"); | |
| 579 | 591 | retval.id = json["id"]; |
| 580 | 592 | retval.issue_comment_url = json["issue_comment_url"]; |
| 581 | 593 | retval.issue_events_url = json["issue_events_url"]; |
| @@ -589,7 +601,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 589 | 601 | retval.mirror_url = json["mirror_url"]; |
| 590 | 602 | retval.name = json["name"]; |
| 591 | 603 | retval.notifications_url = json["notifications_url"]; |
| 604 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 592 | 605 | retval.open_issues = json["open_issues"]; |
| 606 | + if (!intp(json["open_issues_count"])) error("Expected integer"); | |
| 593 | 607 | retval.open_issues_count = json["open_issues_count"]; |
| 594 | 608 | retval.owner = json["owner"]; |
| 595 | 609 | retval.pulls_url = json["pulls_url"]; |
| @@ -597,8 +611,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 597 | 611 | retval.releases_url = json["releases_url"]; |
| 598 | 612 | if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool"); |
| 599 | 613 | retval.repo_private = json["private"]; |
| 614 | + if (!intp(json["size"])) error("Expected integer"); | |
| 600 | 615 | retval.size = json["size"]; |
| 601 | 616 | retval.ssh_url = json["ssh_url"]; |
| 617 | + if (!intp(json["stargazers_count"])) error("Expected integer"); | |
| 602 | 618 | retval.stargazers_count = json["stargazers_count"]; |
| 603 | 619 | retval.stargazers_url = json["stargazers_url"]; |
| 604 | 620 | retval.statuses_url = json["statuses_url"]; |
| @@ -610,7 +626,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 610 | 626 | retval.trees_url = json["trees_url"]; |
| 611 | 627 | retval.updated_at = json["updated_at"]; |
| 612 | 628 | retval.url = json["url"]; |
| 629 | + if (!intp(json["watchers"])) error("Expected integer"); | |
| 613 | 630 | retval.watchers = json["watchers"]; |
| 631 | + if (!intp(json["watchers_count"])) error("Expected integer"); | |
| 614 | 632 | retval.watchers_count = json["watchers_count"]; |
| 615 | 633 | |
| 616 | 634 | return retval; |
| @@ -670,6 +688,7 @@ MergedBy MergedBy_from_JSON(mixed json) { | ||
| 670 | 688 | retval.gists_url = json["gists_url"]; |
| 671 | 689 | retval.gravatar_id = json["gravatar_id"]; |
| 672 | 690 | retval.html_url = json["html_url"]; |
| 691 | + if (!intp(json["id"])) error("Expected integer"); | |
| 673 | 692 | retval.id = json["id"]; |
| 674 | 693 | retval.login = json["login"]; |
| 675 | 694 | retval.organizations_url = json["organizations_url"]; |
| @@ -765,6 +784,7 @@ class TopLevelRepo { | ||
| 765 | 784 | TopLevelRepo TopLevelRepo_from_JSON(mixed json) { |
| 766 | 785 | TopLevelRepo retval = TopLevelRepo(); |
| 767 | 786 | |
| 787 | + if (!intp(json["id"])) error("Expected integer"); | |
| 768 | 788 | retval.id = json["id"]; |
| 769 | 789 | retval.name = json["name"]; |
| 770 | 790 | retval.url = json["url"]; |
Test case
1 generated file · +4 −0test/inputs/json/misc/0b91a.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 79 | 79 | ResponseInfo retval = ResponseInfo(); |
| 80 | 80 | |
| 81 | 81 | retval.developer_message = json["developerMessage"]; |
| 82 | + if (!intp(json["status"])) error("Expected integer"); | |
| 82 | 83 | retval.status = json["status"]; |
| 83 | 84 | |
| 84 | 85 | return retval; |
| @@ -103,8 +104,11 @@ class Resultset { | ||
| 103 | 104 | Resultset Resultset_from_JSON(mixed json) { |
| 104 | 105 | Resultset retval = Resultset(); |
| 105 | 106 | |
| 107 | + if (!intp(json["count"])) error("Expected integer"); | |
| 106 | 108 | retval.count = json["count"]; |
| 109 | + if (!intp(json["page"])) error("Expected integer"); | |
| 107 | 110 | retval.page = json["page"]; |
| 111 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 108 | 112 | retval.pagesize = json["pagesize"]; |
| 109 | 113 | |
| 110 | 114 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/0cffa.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -407,6 +408,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 407 | 408 | |
| 408 | 409 | retval.msg = json["msg"]; |
| 409 | 410 | retval.response_id = json["response_id"]; |
| 411 | + if (!intp(json["status"])) error("Expected integer"); | |
| 410 | 412 | retval.status = json["status"]; |
| 411 | 413 | |
| 412 | 414 | return retval; |
| @@ -431,8 +433,11 @@ class Pagination { | ||
| 431 | 433 | Pagination Pagination_from_JSON(mixed json) { |
| 432 | 434 | Pagination retval = Pagination(); |
| 433 | 435 | |
| 436 | + if (!intp(json["count"])) error("Expected integer"); | |
| 434 | 437 | retval.count = json["count"]; |
| 438 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 435 | 439 | retval.offset = json["offset"]; |
| 440 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 436 | 441 | retval.total_count = json["total_count"]; |
| 437 | 442 | |
| 438 | 443 | 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,21 +85,26 @@ 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 | retval.fav_movie = json["fav_movie"]; |
| 95 | + if (!intp(json["id"])) error("Expected integer"); | |
| 92 | 96 | retval.id = json["id"]; |
| 93 | 97 | retval.images = json["images"]; |
| 94 | 98 | retval.language = ResultLanguage_from_JSON(json["language"]); |
| 95 | 99 | retval.release_date = json["release_date"]; |
| 100 | + if (!intp(json["stars"])) error("Expected integer"); | |
| 96 | 101 | retval.stars = json["stars"]; |
| 97 | 102 | if (!has_index(json, "tags")) error("Missing required property"); |
| 98 | 103 | retval.tags = json["tags"]; |
| 99 | 104 | retval.title = json["title"]; |
| 100 | 105 | retval.videos = json["videos"]; |
| 101 | 106 | retval.vote_score = json["vote_score"]; |
| 107 | + if (!intp(json["watches"])) error("Expected integer"); | |
| 102 | 108 | retval.watches = json["watches"]; |
| 103 | 109 | |
| 104 | 110 | return retval; |
| @@ -125,6 +131,7 @@ class Collection { | ||
| 125 | 131 | Collection Collection_from_JSON(mixed json) { |
| 126 | 132 | Collection retval = Collection(); |
| 127 | 133 | |
| 134 | + if (!intp(json["id"])) error("Expected integer"); | |
| 128 | 135 | retval.id = json["id"]; |
| 129 | 136 | retval.movies = json["movies"]; |
| 130 | 137 | retval.name = json["name"]; |
| @@ -162,6 +169,7 @@ Detail Detail_from_JSON(mixed json) { | ||
| 162 | 169 | |
| 163 | 170 | retval.cast = json["cast"]; |
| 164 | 171 | retval.director = json["director"]; |
| 172 | + if (!intp(json["id"])) error("Expected integer"); | |
| 165 | 173 | retval.id = json["id"]; |
| 166 | 174 | retval.language = DetailLanguage_from_JSON(json["language"]); |
| 167 | 175 | retval.storyline = json["storyline"]; |
| @@ -232,7 +240,9 @@ class Image { | ||
| 232 | 240 | Image Image_from_JSON(mixed json) { |
| 233 | 241 | Image retval = Image(); |
| 234 | 242 | |
| 243 | + if (!intp(json["favs"])) error("Expected integer"); | |
| 235 | 244 | retval.favs = json["favs"]; |
| 245 | + if (!intp(json["id"])) error("Expected integer"); | |
| 236 | 246 | retval.id = json["id"]; |
| 237 | 247 | retval.thumbnail = json["thumbnail"]; |
| 238 | 248 | retval.type = Type_from_JSON(json["type"]); |
| @@ -307,8 +317,11 @@ class VoteScore { | ||
| 307 | 317 | VoteScore VoteScore_from_JSON(mixed json) { |
| 308 | 318 | VoteScore retval = VoteScore(); |
| 309 | 319 | |
| 320 | + if (!intp(json["avg"])) error("Expected integer"); | |
| 310 | 321 | retval.avg = json["avg"]; |
| 322 | + if (!intp(json["score"])) error("Expected integer"); | |
| 311 | 323 | retval.score = json["score"]; |
| 324 | + if (!intp(json["total"])) error("Expected integer"); | |
| 312 | 325 | retval.total = json["total"]; |
| 313 | 326 | |
| 314 | 327 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/127a1.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -406,6 +407,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 406 | 407 | |
| 407 | 408 | retval.msg = json["msg"]; |
| 408 | 409 | retval.response_id = json["response_id"]; |
| 410 | + if (!intp(json["status"])) error("Expected integer"); | |
| 409 | 411 | retval.status = json["status"]; |
| 410 | 412 | |
| 411 | 413 | return retval; |
| @@ -430,8 +432,11 @@ class Pagination { | ||
| 430 | 432 | Pagination Pagination_from_JSON(mixed json) { |
| 431 | 433 | Pagination retval = Pagination(); |
| 432 | 434 | |
| 435 | + if (!intp(json["count"])) error("Expected integer"); | |
| 433 | 436 | retval.count = json["count"]; |
| 437 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 434 | 438 | retval.offset = json["offset"]; |
| 439 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 435 | 440 | retval.total_count = json["total_count"]; |
| 436 | 441 | |
| 437 | 442 | 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 | retval.location = json["location"]; |
| 56 | 57 | retval.location_subtype = json["location_subtype"]; |
| @@ -105,6 +106,7 @@ class Street { | ||
| 105 | 106 | Street Street_from_JSON(mixed json) { |
| 106 | 107 | Street retval = Street(); |
| 107 | 108 | |
| 109 | + if (!intp(json["id"])) error("Expected integer"); | |
| 108 | 110 | retval.id = json["id"]; |
| 109 | 111 | retval.name = json["name"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/16bc5.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | 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 | retval.results = json["Results"]; |
| 39 | 40 | retval.status = json["status"]; |
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
| @@ -54,8 +54,11 @@ class Meta { | ||
| 54 | 54 | Meta Meta_from_JSON(mixed json) { |
| 55 | 55 | Meta retval = Meta(); |
| 56 | 56 | |
| 57 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 57 | 58 | retval.limit = json["limit"]; |
| 59 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 58 | 60 | retval.offset = json["offset"]; |
| 61 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 59 | 62 | retval.total_count = json["total_count"]; |
| 60 | 63 | |
| 61 | 64 | return retval; |
| @@ -121,9 +124,11 @@ Object Object_from_JSON(mixed json) { | ||
| 121 | 124 | if (json["current"] != Standards.JSON.true && json["current"] != Standards.JSON.false) error("Expected bool"); |
| 122 | 125 | retval.current = json["current"]; |
| 123 | 126 | retval.description = json["description"]; |
| 127 | + if (!intp(json["district"])) error("Expected integer"); | |
| 124 | 128 | retval.district = json["district"]; |
| 125 | 129 | retval.enddate = json["enddate"]; |
| 126 | 130 | retval.extra = json["extra"]; |
| 131 | + if (!intp(json["id"])) error("Expected integer"); | |
| 127 | 132 | retval.id = json["id"]; |
| 128 | 133 | if (!has_index(json, "leadership_title")) error("Missing required property"); |
| 129 | 134 | retval.leadership_title = json["leadership_title"]; |
| @@ -235,10 +240,12 @@ Person Person_from_JSON(mixed json) { | ||
| 235 | 240 | |
| 236 | 241 | retval.bioguideid = json["bioguideid"]; |
| 237 | 242 | retval.birthday = json["birthday"]; |
| 243 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 238 | 244 | retval.cspanid = json["cspanid"]; |
| 239 | 245 | retval.firstname = json["firstname"]; |
| 240 | 246 | retval.gender = Gender_from_JSON(json["gender"]); |
| 241 | 247 | retval.gender_label = GenderLabel_from_JSON(json["gender_label"]); |
| 248 | + if (!intp(json["id"])) error("Expected integer"); | |
| 242 | 249 | retval.id = json["id"]; |
| 243 | 250 | retval.lastname = json["lastname"]; |
| 244 | 251 | retval.link = json["link"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/262f0.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/26b49.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -401,6 +402,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 401 | 402 | |
| 402 | 403 | retval.msg = json["msg"]; |
| 403 | 404 | retval.response_id = json["response_id"]; |
| 405 | + if (!intp(json["status"])) error("Expected integer"); | |
| 404 | 406 | retval.status = json["status"]; |
| 405 | 407 | |
| 406 | 408 | return retval; |
| @@ -425,8 +427,11 @@ class Pagination { | ||
| 425 | 427 | Pagination Pagination_from_JSON(mixed json) { |
| 426 | 428 | Pagination retval = Pagination(); |
| 427 | 429 | |
| 430 | + if (!intp(json["count"])) error("Expected integer"); | |
| 428 | 431 | retval.count = json["count"]; |
| 432 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 429 | 433 | retval.offset = json["offset"]; |
| 434 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 430 | 435 | retval.total_count = json["total_count"]; |
| 431 | 436 | |
| 432 | 437 | return retval; |
Test case
1 generated file · +19 −0test/inputs/json/misc/26c9c.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -152,12 +152,15 @@ View View_from_JSON(mixed json) { | ||
| 152 | 152 | |
| 153 | 153 | retval.attribution = json["attribution"]; |
| 154 | 154 | retval.attribution_link = json["attributionLink"]; |
| 155 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 155 | 156 | retval.average_rating = json["averageRating"]; |
| 156 | 157 | retval.category = json["category"]; |
| 157 | 158 | retval.columns = json["columns"]; |
| 159 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 158 | 160 | retval.created_at = json["createdAt"]; |
| 159 | 161 | retval.description = json["description"]; |
| 160 | 162 | retval.display_type = json["displayType"]; |
| 163 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 161 | 164 | retval.download_count = json["downloadCount"]; |
| 162 | 165 | retval.flags = json["flags"]; |
| 163 | 166 | retval.grants = json["grants"]; |
| @@ -166,30 +169,40 @@ View View_from_JSON(mixed json) { | ||
| 166 | 169 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 167 | 170 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 168 | 171 | retval.id = json["id"]; |
| 172 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 169 | 173 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 170 | 174 | retval.locale = json["locale"]; |
| 171 | 175 | retval.metadata = json["metadata"]; |
| 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 | retval.owner = json["owner"]; |
| 178 | 184 | retval.provenance = json["provenance"]; |
| 179 | 185 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 180 | 186 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 187 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 181 | 188 | retval.publication_date = json["publicationDate"]; |
| 189 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 182 | 190 | retval.publication_group = json["publicationGroup"]; |
| 183 | 191 | retval.publication_stage = json["publicationStage"]; |
| 184 | 192 | retval.query = json["query"]; |
| 185 | 193 | retval.rights = json["rights"]; |
| 194 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 186 | 195 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 187 | 196 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 188 | 197 | retval.table_author = json["tableAuthor"]; |
| 198 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 189 | 199 | retval.table_id = json["tableId"]; |
| 190 | 200 | retval.tags = json["tags"]; |
| 201 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 191 | 202 | retval.total_times_rated = json["totalTimesRated"]; |
| 203 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 192 | 204 | retval.view_count = json["viewCount"]; |
| 205 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 193 | 206 | retval.view_last_modified = json["viewLastModified"]; |
| 194 | 207 | retval.view_type = json["viewType"]; |
| 195 | 208 | |
| @@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) { | ||
| 236 | 249 | retval.field_name = json["fieldName"]; |
| 237 | 250 | retval.flags = json["flags"]; |
| 238 | 251 | retval.format = json["format"]; |
| 252 | + if (!intp(json["id"])) error("Expected integer"); | |
| 239 | 253 | retval.id = json["id"]; |
| 240 | 254 | retval.name = json["name"]; |
| 255 | + if (!intp(json["position"])) error("Expected integer"); | |
| 241 | 256 | retval.position = json["position"]; |
| 242 | 257 | retval.render_type_name = json["renderTypeName"]; |
| 243 | 258 | retval.table_column_id = json["tableColumnId"]; |
| @@ -275,7 +290,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 275 | 290 | |
| 276 | 291 | retval.average = json["average"]; |
| 277 | 292 | retval.largest = json["largest"]; |
| 293 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 278 | 294 | retval.non_null = json["non_null"]; |
| 295 | + if (!intp(json["null"])) error("Expected integer"); | |
| 279 | 296 | retval.null = json["null"]; |
| 280 | 297 | retval.smallest = json["smallest"]; |
| 281 | 298 | retval.sum = json["sum"]; |
| @@ -301,6 +318,7 @@ class Top { | ||
| 301 | 318 | Top Top_from_JSON(mixed json) { |
| 302 | 319 | Top retval = Top(); |
| 303 | 320 | |
| 321 | + if (!intp(json["count"])) error("Expected integer"); | |
| 304 | 322 | retval.count = json["count"]; |
| 305 | 323 | retval.item = json["item"]; |
| 306 | 324 | |
| @@ -779,6 +797,7 @@ class Expression { | ||
| 779 | 797 | Expression Expression_from_JSON(mixed json) { |
| 780 | 798 | Expression retval = Expression(); |
| 781 | 799 | |
| 800 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 782 | 801 | retval.column_id = json["columnId"]; |
| 783 | 802 | retval.type = json["type"]; |
Test case
1 generated file · +13 −0test/inputs/json/misc/27332.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -254,9 +254,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 254 | 254 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 255 | 255 | retval.distinguished = json["distinguished"]; |
| 256 | 256 | retval.domain = Domain_from_JSON(json["domain"]); |
| 257 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 257 | 258 | retval.downs = json["downs"]; |
| 258 | 259 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 259 | 260 | retval.edited = json["edited"]; |
| 261 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 260 | 262 | retval.gilded = json["gilded"]; |
| 261 | 263 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 262 | 264 | retval.hidden = json["hidden"]; |
| @@ -279,6 +281,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 279 | 281 | retval.media_embed = json["media_embed"]; |
| 280 | 282 | retval.mod_reports = json["mod_reports"]; |
| 281 | 283 | retval.name = json["name"]; |
| 284 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 282 | 285 | retval.num_comments = json["num_comments"]; |
| 283 | 286 | retval.num_reports = json["num_reports"]; |
| 284 | 287 | 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 | retval.secure_media = json["secure_media"]; |
| @@ -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 = 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"]; |
| @@ -396,16 +403,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 396 | 403 | Oembed retval = Oembed(); |
| 397 | 404 | |
| 398 | 405 | retval.description = json["description"]; |
| 406 | + if (!intp(json["height"])) error("Expected integer"); | |
| 399 | 407 | retval.height = json["height"]; |
| 400 | 408 | retval.html = json["html"]; |
| 401 | 409 | retval.provider_name = json["provider_name"]; |
| 402 | 410 | retval.provider_url = json["provider_url"]; |
| 411 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 403 | 412 | retval.thumbnail_height = json["thumbnail_height"]; |
| 404 | 413 | retval.thumbnail_url = json["thumbnail_url"]; |
| 414 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 405 | 415 | retval.thumbnail_width = json["thumbnail_width"]; |
| 406 | 416 | retval.title = json["title"]; |
| 407 | 417 | retval.type = json["type"]; |
| 408 | 418 | retval.version = json["version"]; |
| 419 | + if (!intp(json["width"])) error("Expected integer"); | |
| 409 | 420 | retval.width = json["width"]; |
| 410 | 421 | |
| 411 | 422 | 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 · +9 −0test/inputs/json/misc/29f47.json
Mpikedefault / TopLevel.pmod+9 −0
| @@ -251,9 +251,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 251 | 251 | retval.created_utc = (float)json["created_utc"]; |
| 252 | 252 | retval.distinguished = Distinguished_from_JSON(json["distinguished"]); |
| 253 | 253 | retval.domain = Domain_from_JSON(json["domain"]); |
| 254 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 254 | 255 | retval.downs = json["downs"]; |
| 255 | 256 | if (arrayp(json["edited"])) error("Unexpected array"); |
| 256 | 257 | retval.edited = json["edited"]; |
| 258 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 257 | 259 | retval.gilded = json["gilded"]; |
| 258 | 260 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 259 | 261 | retval.hidden = json["hidden"]; |
| @@ -273,6 +275,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 273 | 275 | retval.media_embed = json["media_embed"]; |
| 274 | 276 | retval.mod_reports = json["mod_reports"]; |
| 275 | 277 | retval.name = json["name"]; |
| 278 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 276 | 279 | retval.num_comments = json["num_comments"]; |
| 277 | 280 | retval.num_reports = json["num_reports"]; |
| 278 | 281 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -286,6 +289,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 286 | 289 | retval.report_reasons = json["report_reasons"]; |
| 287 | 290 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 288 | 291 | retval.saved = json["saved"]; |
| 292 | + if (!intp(json["score"])) error("Expected integer"); | |
| 289 | 293 | retval.score = json["score"]; |
| 290 | 294 | retval.secure_media = json["secure_media"]; |
| 291 | 295 | retval.secure_media_embed = json["secure_media_embed"]; |
| @@ -303,11 +307,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 303 | 307 | if (!has_index(json, "suggested_sort")) error("Missing required property"); |
| 304 | 308 | retval.suggested_sort = json["suggested_sort"]; |
| 305 | 309 | retval.thumbnail = json["thumbnail"]; |
| 310 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 306 | 311 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 307 | 312 | retval.thumbnail_height = json["thumbnail_height"]; |
| 313 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 308 | 314 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 309 | 315 | retval.thumbnail_width = json["thumbnail_width"]; |
| 310 | 316 | retval.title = json["title"]; |
| 317 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 311 | 318 | retval.ups = json["ups"]; |
| 312 | 319 | retval.url = json["url"]; |
| 313 | 320 | retval.user_reports = json["user_reports"]; |
| @@ -438,8 +445,10 @@ class Source { | ||
| 438 | 445 | Source Source_from_JSON(mixed json) { |
| 439 | 446 | Source retval = Source(); |
| 440 | 447 | |
| 448 | + if (!intp(json["height"])) error("Expected integer"); | |
| 441 | 449 | retval.height = json["height"]; |
| 442 | 450 | retval.url = json["url"]; |
| 451 | + if (!intp(json["width"])) error("Expected integer"); | |
| 443 | 452 | retval.width = json["width"]; |
| 444 | 453 | |
| 445 | 454 | return retval; |
Test case
1 generated file · +6 −0test/inputs/json/misc/2d4e2.json
Mpikedefault / TopLevel.pmod+6 −0
| @@ -54,8 +54,11 @@ class Meta { | ||
| 54 | 54 | Meta Meta_from_JSON(mixed json) { |
| 55 | 55 | Meta retval = Meta(); |
| 56 | 56 | |
| 57 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 57 | 58 | retval.limit = json["limit"]; |
| 59 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 58 | 60 | retval.offset = json["offset"]; |
| 61 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 59 | 62 | retval.total_count = json["total_count"]; |
| 60 | 63 | |
| 61 | 64 | return retval; |
| @@ -129,6 +132,7 @@ Object Object_from_JSON(mixed json) { | ||
| 129 | 132 | retval.district = json["district"]; |
| 130 | 133 | retval.enddate = json["enddate"]; |
| 131 | 134 | retval.extra = json["extra"]; |
| 135 | + if (!intp(json["id"])) error("Expected integer"); | |
| 132 | 136 | retval.id = json["id"]; |
| 133 | 137 | if (!has_index(json, "leadership_title")) error("Missing required property"); |
| 134 | 138 | retval.leadership_title = json["leadership_title"]; |
| @@ -243,10 +247,12 @@ Person Person_from_JSON(mixed json) { | ||
| 243 | 247 | |
| 244 | 248 | retval.bioguideid = json["bioguideid"]; |
| 245 | 249 | retval.birthday = json["birthday"]; |
| 250 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 246 | 251 | retval.cspanid = json["cspanid"]; |
| 247 | 252 | retval.firstname = json["firstname"]; |
| 248 | 253 | retval.gender = Gender_from_JSON(json["gender"]); |
| 249 | 254 | retval.gender_label = GenderLabel_from_JSON(json["gender_label"]); |
| 255 | + if (!intp(json["id"])) error("Expected integer"); | |
| 250 | 256 | retval.id = json["id"]; |
| 251 | 257 | retval.lastname = json["lastname"]; |
| 252 | 258 | retval.link = json["link"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/2df80.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -173,9 +173,12 @@ class FluffyTopLevel { | ||
| 173 | 173 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 174 | 174 | FluffyTopLevel retval = FluffyTopLevel(); |
| 175 | 175 | |
| 176 | + if (!intp(json["page"])) error("Expected integer"); | |
| 176 | 177 | retval.page = json["page"]; |
| 178 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 177 | 179 | retval.pages = json["pages"]; |
| 178 | 180 | retval.per_page = json["per_page"]; |
| 181 | + if (!intp(json["total"])) error("Expected integer"); | |
| 179 | 182 | retval.total = json["total"]; |
| 180 | 183 | |
| 181 | 184 | return retval; |
Test case
1 generated file · +10 −0test/inputs/json/misc/32431.json
Mpikedefault / TopLevel.pmod+10 −0
| @@ -173,6 +173,7 @@ Properties Properties_from_JSON(mixed json) { | ||
| 173 | 173 | if (!has_index(json, "dmin")) error("Missing required property"); |
| 174 | 174 | retval.dmin = json["dmin"]; |
| 175 | 175 | retval.felt = json["felt"]; |
| 176 | + if (!intp(json["gap"])) error("Expected integer"); | |
| 176 | 177 | if (!has_index(json, "gap")) error("Missing required property"); |
| 177 | 178 | retval.gap = json["gap"]; |
| 178 | 179 | retval.ids = json["ids"]; |
| @@ -180,19 +181,25 @@ Properties Properties_from_JSON(mixed json) { | ||
| 180 | 181 | retval.mag_type = MagType_from_JSON(json["magType"]); |
| 181 | 182 | retval.mmi = json["mmi"]; |
| 182 | 183 | retval.net = json["net"]; |
| 184 | + if (!intp(json["nst"])) error("Expected integer"); | |
| 183 | 185 | if (!has_index(json, "nst")) error("Missing required property"); |
| 184 | 186 | retval.nst = json["nst"]; |
| 185 | 187 | retval.place = json["place"]; |
| 186 | 188 | retval.rms = (float)json["rms"]; |
| 189 | + if (!intp(json["sig"])) error("Expected integer"); | |
| 187 | 190 | retval.sig = json["sig"]; |
| 188 | 191 | retval.sources = json["sources"]; |
| 189 | 192 | retval.status = Status_from_JSON(json["status"]); |
| 193 | + if (!intp(json["time"])) error("Expected integer"); | |
| 190 | 194 | retval.time = json["time"]; |
| 191 | 195 | retval.title = json["title"]; |
| 196 | + if (!intp(json["tsunami"])) error("Expected integer"); | |
| 192 | 197 | retval.tsunami = json["tsunami"]; |
| 193 | 198 | retval.type = PropertiesType_from_JSON(json["type"]); |
| 194 | 199 | retval.types = json["types"]; |
| 200 | + if (!intp(json["tz"])) error("Expected integer"); | |
| 195 | 201 | retval.tz = json["tz"]; |
| 202 | + if (!intp(json["updated"])) error("Expected integer"); | |
| 196 | 203 | retval.updated = json["updated"]; |
| 197 | 204 | retval.url = json["url"]; |
| 198 | 205 | |
| @@ -260,8 +267,11 @@ Metadata Metadata_from_JSON(mixed json) { | ||
| 260 | 267 | Metadata retval = Metadata(); |
| 261 | 268 | |
| 262 | 269 | retval.api = json["api"]; |
| 270 | + if (!intp(json["count"])) error("Expected integer"); | |
| 263 | 271 | retval.count = json["count"]; |
| 272 | + if (!intp(json["generated"])) error("Expected integer"); | |
| 264 | 273 | retval.generated = json["generated"]; |
| 274 | + if (!intp(json["status"])) error("Expected integer"); | |
| 265 | 275 | retval.status = json["status"]; |
| 266 | 276 | retval.title = json["title"]; |
| 267 | 277 | 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,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | retval.previous = json["previous"]; |
| @@ -144,10 +147,13 @@ class Result { | ||
| 144 | 147 | Result Result_from_JSON(mixed json) { |
| 145 | 148 | Result retval = Result(); |
| 146 | 149 | |
| 150 | + if (!intp(json["cost_absolute"])) error("Expected integer"); | |
| 147 | 151 | if (!has_index(json, "cost_absolute")) error("Missing required property"); |
| 148 | 152 | retval.cost_absolute = json["cost_absolute"]; |
| 153 | + if (!intp(json["cost_max"])) error("Expected integer"); | |
| 149 | 154 | if (!has_index(json, "cost_max")) error("Missing required property"); |
| 150 | 155 | retval.cost_max = json["cost_max"]; |
| 156 | + if (!intp(json["cost_min"])) error("Expected integer"); | |
| 151 | 157 | if (!has_index(json, "cost_min")) error("Missing required property"); |
| 152 | 158 | retval.cost_min = json["cost_min"]; |
| 153 | 159 | retval.created_at = json["created_at"]; |
| @@ -155,9 +161,11 @@ Result Result_from_JSON(mixed json) { | ||
| 155 | 161 | retval.direct_rep_costs_max = json["direct_rep_costs_max"]; |
| 156 | 162 | retval.direct_rep_costs_min = json["direct_rep_costs_min"]; |
| 157 | 163 | retval.end_date = json["end_date"]; |
| 164 | + if (!intp(json["eur_sources_grants"])) error("Expected integer"); | |
| 158 | 165 | retval.eur_sources_grants = json["eur_sources_grants"]; |
| 159 | 166 | if (!has_index(json, "eur_sources_grants_src")) error("Missing required property"); |
| 160 | 167 | retval.eur_sources_grants_src = json["eur_sources_grants_src"]; |
| 168 | + if (!intp(json["eur_sources_procurement"])) error("Expected integer"); | |
| 161 | 169 | retval.eur_sources_procurement = json["eur_sources_procurement"]; |
| 162 | 170 | if (!has_index(json, "eur_sources_procurement_src")) error("Missing required property"); |
| 163 | 171 | retval.eur_sources_procurement_src = json["eur_sources_procurement_src"]; |
| @@ -167,27 +175,37 @@ Result Result_from_JSON(mixed json) { | ||
| 167 | 175 | retval.no_clients = json["no_clients"]; |
| 168 | 176 | if (!has_index(json, "other_financial_information")) error("Missing required property"); |
| 169 | 177 | retval.other_financial_information = json["other_financial_information"]; |
| 178 | + if (!intp(json["other_sources_contributions"])) error("Expected integer"); | |
| 170 | 179 | if (!has_index(json, "other_sources_contributions")) error("Missing required property"); |
| 171 | 180 | retval.other_sources_contributions = json["other_sources_contributions"]; |
| 181 | + if (!intp(json["other_sources_donation"])) error("Expected integer"); | |
| 172 | 182 | if (!has_index(json, "other_sources_donation")) error("Missing required property"); |
| 173 | 183 | retval.other_sources_donation = json["other_sources_donation"]; |
| 184 | + if (!intp(json["other_sources_total"])) error("Expected integer"); | |
| 174 | 185 | if (!has_index(json, "other_sources_total")) error("Missing required property"); |
| 175 | 186 | retval.other_sources_total = json["other_sources_total"]; |
| 187 | + if (!intp(json["public_financing_infranational"])) error("Expected integer"); | |
| 176 | 188 | if (!has_index(json, "public_financing_infranational")) error("Missing required property"); |
| 177 | 189 | retval.public_financing_infranational = json["public_financing_infranational"]; |
| 190 | + if (!intp(json["public_financing_national"])) error("Expected integer"); | |
| 178 | 191 | if (!has_index(json, "public_financing_national")) error("Missing required property"); |
| 179 | 192 | retval.public_financing_national = json["public_financing_national"]; |
| 193 | + if (!intp(json["public_financing_total"])) error("Expected integer"); | |
| 180 | 194 | if (!has_index(json, "public_financing_total")) error("Missing required property"); |
| 181 | 195 | retval.public_financing_total = json["public_financing_total"]; |
| 182 | 196 | retval.representative = json["representative"]; |
| 183 | 197 | retval.start_date = json["start_date"]; |
| 184 | 198 | retval.status = Status_from_JSON(json["status"]); |
| 199 | + if (!intp(json["total_budget"])) error("Expected integer"); | |
| 185 | 200 | if (!has_index(json, "total_budget")) error("Missing required property"); |
| 186 | 201 | retval.total_budget = json["total_budget"]; |
| 202 | + if (!intp(json["turnover_absolute"])) error("Expected integer"); | |
| 187 | 203 | if (!has_index(json, "turnover_absolute")) error("Missing required property"); |
| 188 | 204 | retval.turnover_absolute = json["turnover_absolute"]; |
| 205 | + if (!intp(json["turnover_max"])) error("Expected integer"); | |
| 189 | 206 | if (!has_index(json, "turnover_max")) error("Missing required property"); |
| 190 | 207 | retval.turnover_max = json["turnover_max"]; |
| 208 | + if (!intp(json["turnover_min"])) error("Expected integer"); | |
| 191 | 209 | if (!has_index(json, "turnover_min")) error("Missing required property"); |
| 192 | 210 | retval.turnover_min = json["turnover_min"]; |
| 193 | 211 | retval.type = ResultType_from_JSON(json["type"]); |
| @@ -226,6 +244,7 @@ class CustomIncome { | ||
| 226 | 244 | CustomIncome CustomIncome_from_JSON(mixed json) { |
| 227 | 245 | CustomIncome retval = CustomIncome(); |
| 228 | 246 | |
| 247 | + if (!intp(json["amount"])) error("Expected integer"); | |
| 229 | 248 | retval.amount = json["amount"]; |
| 230 | 249 | retval.created_at = json["created_at"]; |
| 231 | 250 | retval.id = json["id"]; |
Test case
1 generated file · +2 −0test/inputs/json/misc/34702.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 35 | 35 | |
| 36 | 36 | retval.crs = json["crs"]; |
| 37 | 37 | retval.features = json["features"]; |
| 38 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 38 | 39 | retval.total_features = json["totalFeatures"]; |
| 39 | 40 | retval.type = json["type"]; |
| 40 | 41 | |
| @@ -208,6 +209,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 208 | 209 | if (!has_index(json, "no")) error("Missing required property"); |
| 209 | 210 | retval.no = json["no"]; |
| 210 | 211 | retval.phone = (float)json["phone"]; |
| 212 | + if (!intp(json["postcode"])) error("Expected integer"); | |
| 211 | 213 | retval.postcode = json["postcode"]; |
| 212 | 214 | retval.psa = json["psa"]; |
| 213 | 215 | 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 | retval.results = json["Results"]; |
| 39 | 40 | retval.status = json["status"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/3f1ce.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +18 −0test/inputs/json/misc/421d4.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -155,12 +155,15 @@ View View_from_JSON(mixed json) { | ||
| 155 | 155 | View retval = View(); |
| 156 | 156 | |
| 157 | 157 | retval.attribution = json["attribution"]; |
| 158 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 158 | 159 | retval.average_rating = json["averageRating"]; |
| 159 | 160 | retval.category = json["category"]; |
| 160 | 161 | retval.columns = json["columns"]; |
| 162 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 161 | 163 | retval.created_at = json["createdAt"]; |
| 162 | 164 | retval.description = json["description"]; |
| 163 | 165 | retval.display_type = json["displayType"]; |
| 166 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 164 | 167 | retval.download_count = json["downloadCount"]; |
| 165 | 168 | retval.flags = json["flags"]; |
| 166 | 169 | retval.grants = json["grants"]; |
| @@ -169,6 +172,7 @@ View View_from_JSON(mixed json) { | ||
| 169 | 172 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 170 | 173 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 171 | 174 | retval.id = json["id"]; |
| 175 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 172 | 176 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 173 | 177 | retval.license = json["license"]; |
| 174 | 178 | retval.license_id = json["licenseId"]; |
| @@ -177,25 +181,34 @@ View View_from_JSON(mixed json) { | ||
| 177 | 181 | retval.name = json["name"]; |
| 178 | 182 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 179 | 183 | retval.new_backend = json["newBackend"]; |
| 184 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 180 | 185 | retval.number_of_comments = json["numberOfComments"]; |
| 186 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 181 | 187 | retval.oid = json["oid"]; |
| 182 | 188 | retval.owner = json["owner"]; |
| 183 | 189 | retval.provenance = json["provenance"]; |
| 184 | 190 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 185 | 191 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 192 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 186 | 193 | retval.publication_date = json["publicationDate"]; |
| 194 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 187 | 195 | retval.publication_group = json["publicationGroup"]; |
| 188 | 196 | retval.publication_stage = json["publicationStage"]; |
| 189 | 197 | retval.query = json["query"]; |
| 190 | 198 | retval.rights = json["rights"]; |
| 191 | 199 | retval.row_class = json["rowClass"]; |
| 200 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 192 | 201 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 193 | 202 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 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 | |
| @@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) { | ||
| 242 | 255 | retval.field_name = json["fieldName"]; |
| 243 | 256 | retval.flags = json["flags"]; |
| 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 = 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/437e7.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -392,6 +393,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 392 | 393 | |
| 393 | 394 | retval.msg = json["msg"]; |
| 394 | 395 | retval.response_id = json["response_id"]; |
| 396 | + if (!intp(json["status"])) error("Expected integer"); | |
| 395 | 397 | retval.status = json["status"]; |
| 396 | 398 | |
| 397 | 399 | return retval; |
| @@ -416,8 +418,11 @@ class Pagination { | ||
| 416 | 418 | Pagination Pagination_from_JSON(mixed json) { |
| 417 | 419 | Pagination retval = Pagination(); |
| 418 | 420 | |
| 421 | + if (!intp(json["count"])) error("Expected integer"); | |
| 419 | 422 | retval.count = json["count"]; |
| 423 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 420 | 424 | retval.offset = json["offset"]; |
| 425 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 421 | 426 | retval.total_count = json["total_count"]; |
| 422 | 427 | |
| 423 | 428 | 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
| @@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 79 | 79 | ResponseInfo retval = ResponseInfo(); |
| 80 | 80 | |
| 81 | 81 | retval.developer_message = json["developerMessage"]; |
| 82 | + if (!intp(json["status"])) error("Expected integer"); | |
| 82 | 83 | retval.status = json["status"]; |
| 83 | 84 | |
| 84 | 85 | return retval; |
| @@ -103,8 +104,11 @@ class Resultset { | ||
| 103 | 104 | Resultset Resultset_from_JSON(mixed json) { |
| 104 | 105 | Resultset retval = Resultset(); |
| 105 | 106 | |
| 107 | + if (!intp(json["count"])) error("Expected integer"); | |
| 106 | 108 | retval.count = json["count"]; |
| 109 | + if (!intp(json["page"])) error("Expected integer"); | |
| 107 | 110 | retval.page = json["page"]; |
| 111 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 108 | 112 | retval.pagesize = json["pagesize"]; |
| 109 | 113 | |
| 110 | 114 | 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
| @@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 35 | 35 | |
| 36 | 36 | retval.crs = json["crs"]; |
| 37 | 37 | retval.features = json["features"]; |
| 38 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 38 | 39 | retval.total_features = json["totalFeatures"]; |
| 39 | 40 | retval.type = json["type"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/4c547.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +13 −0test/inputs/json/misc/4d6fb.json
Mpikedefault / TopLevel.pmod+13 −0
| @@ -251,9 +251,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 251 | 251 | retval.created_utc = (float)json["created_utc"]; |
| 252 | 252 | retval.distinguished = json["distinguished"]; |
| 253 | 253 | retval.domain = json["domain"]; |
| 254 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 254 | 255 | retval.downs = json["downs"]; |
| 255 | 256 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 256 | 257 | retval.edited = json["edited"]; |
| 258 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 257 | 259 | retval.gilded = json["gilded"]; |
| 258 | 260 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 259 | 261 | retval.hidden = json["hidden"]; |
| @@ -274,6 +276,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 274 | 276 | retval.media_embed = json["media_embed"]; |
| 275 | 277 | retval.mod_reports = json["mod_reports"]; |
| 276 | 278 | retval.name = json["name"]; |
| 279 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 277 | 280 | retval.num_comments = json["num_comments"]; |
| 278 | 281 | retval.num_reports = json["num_reports"]; |
| 279 | 282 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -287,6 +290,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 287 | 290 | retval.report_reasons = json["report_reasons"]; |
| 288 | 291 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 289 | 292 | retval.saved = json["saved"]; |
| 293 | + if (!intp(json["score"])) error("Expected integer"); | |
| 290 | 294 | retval.score = json["score"]; |
| 291 | 295 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 292 | 296 | retval.secure_media = json["secure_media"]; |
| @@ -303,11 +307,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 303 | 307 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 304 | 308 | retval.suggested_sort = json["suggested_sort"]; |
| 305 | 309 | retval.thumbnail = json["thumbnail"]; |
| 310 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 306 | 311 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 307 | 312 | retval.thumbnail_height = json["thumbnail_height"]; |
| 313 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 308 | 314 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 309 | 315 | retval.thumbnail_width = json["thumbnail_width"]; |
| 310 | 316 | retval.title = json["title"]; |
| 317 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 311 | 318 | retval.ups = json["ups"]; |
| 312 | 319 | retval.url = json["url"]; |
| 313 | 320 | retval.user_reports = json["user_reports"]; |
| @@ -382,16 +389,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 382 | 389 | |
| 383 | 390 | retval.author_name = json["author_name"]; |
| 384 | 391 | retval.author_url = json["author_url"]; |
| 392 | + if (!intp(json["height"])) error("Expected integer"); | |
| 385 | 393 | retval.height = json["height"]; |
| 386 | 394 | retval.html = json["html"]; |
| 387 | 395 | retval.provider_name = json["provider_name"]; |
| 388 | 396 | retval.provider_url = json["provider_url"]; |
| 397 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 389 | 398 | retval.thumbnail_height = json["thumbnail_height"]; |
| 390 | 399 | retval.thumbnail_url = json["thumbnail_url"]; |
| 400 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 391 | 401 | retval.thumbnail_width = json["thumbnail_width"]; |
| 392 | 402 | retval.title = json["title"]; |
| 393 | 403 | retval.type = json["type"]; |
| 394 | 404 | retval.version = json["version"]; |
| 405 | + if (!intp(json["width"])) error("Expected integer"); | |
| 395 | 406 | retval.width = json["width"]; |
| 396 | 407 | |
| 397 | 408 | return retval; |
| @@ -507,8 +518,10 @@ class Source { | ||
| 507 | 518 | Source Source_from_JSON(mixed json) { |
| 508 | 519 | Source retval = Source(); |
| 509 | 520 | |
| 521 | + if (!intp(json["height"])) error("Expected integer"); | |
| 510 | 522 | retval.height = json["height"]; |
| 511 | 523 | retval.url = json["url"]; |
| 524 | + if (!intp(json["width"])) error("Expected integer"); | |
| 512 | 525 | retval.width = json["width"]; |
| 513 | 526 | |
| 514 | 527 | 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,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | 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
| @@ -152,12 +152,15 @@ View View_from_JSON(mixed json) { | ||
| 152 | 152 | |
| 153 | 153 | retval.attribution = json["attribution"]; |
| 154 | 154 | retval.attribution_link = json["attributionLink"]; |
| 155 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 155 | 156 | retval.average_rating = json["averageRating"]; |
| 156 | 157 | retval.category = json["category"]; |
| 157 | 158 | retval.columns = json["columns"]; |
| 159 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 158 | 160 | retval.created_at = json["createdAt"]; |
| 159 | 161 | retval.description = json["description"]; |
| 160 | 162 | retval.display_type = json["displayType"]; |
| 163 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 161 | 164 | retval.download_count = json["downloadCount"]; |
| 162 | 165 | retval.flags = json["flags"]; |
| 163 | 166 | retval.grants = json["grants"]; |
| @@ -166,30 +169,40 @@ View View_from_JSON(mixed json) { | ||
| 166 | 169 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 167 | 170 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 168 | 171 | retval.id = json["id"]; |
| 172 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 169 | 173 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 170 | 174 | retval.locale = json["locale"]; |
| 171 | 175 | retval.metadata = json["metadata"]; |
| 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 | retval.owner = json["owner"]; |
| 178 | 184 | retval.provenance = json["provenance"]; |
| 179 | 185 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 180 | 186 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 187 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 181 | 188 | retval.publication_date = json["publicationDate"]; |
| 189 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 182 | 190 | retval.publication_group = json["publicationGroup"]; |
| 183 | 191 | retval.publication_stage = json["publicationStage"]; |
| 184 | 192 | retval.query = json["query"]; |
| 185 | 193 | retval.rights = json["rights"]; |
| 194 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 186 | 195 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 187 | 196 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 188 | 197 | retval.table_author = json["tableAuthor"]; |
| 198 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 189 | 199 | retval.table_id = json["tableId"]; |
| 190 | 200 | retval.tags = json["tags"]; |
| 201 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 191 | 202 | retval.total_times_rated = json["totalTimesRated"]; |
| 203 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 192 | 204 | retval.view_count = json["viewCount"]; |
| 205 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 193 | 206 | retval.view_last_modified = json["viewLastModified"]; |
| 194 | 207 | retval.view_type = json["viewType"]; |
| 195 | 208 | |
| @@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) { | ||
| 236 | 249 | retval.field_name = json["fieldName"]; |
| 237 | 250 | retval.flags = json["flags"]; |
| 238 | 251 | retval.format = json["format"]; |
| 252 | + if (!intp(json["id"])) error("Expected integer"); | |
| 239 | 253 | retval.id = json["id"]; |
| 240 | 254 | retval.name = json["name"]; |
| 255 | + if (!intp(json["position"])) error("Expected integer"); | |
| 241 | 256 | retval.position = json["position"]; |
| 242 | 257 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 243 | 258 | retval.table_column_id = json["tableColumnId"]; |
| @@ -270,7 +285,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 270 | 285 | CachedContents retval = CachedContents(); |
| 271 | 286 | |
| 272 | 287 | retval.largest = json["largest"]; |
| 288 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 273 | 289 | retval.non_null = json["non_null"]; |
| 290 | + if (!intp(json["null"])) error("Expected integer"); | |
| 274 | 291 | retval.null = json["null"]; |
| 275 | 292 | retval.smallest = json["smallest"]; |
| 276 | 293 | retval.top = json["top"]; |
| @@ -295,6 +312,7 @@ class Top { | ||
| 295 | 312 | Top Top_from_JSON(mixed json) { |
| 296 | 313 | Top retval = Top(); |
| 297 | 314 | |
| 315 | + if (!intp(json["count"])) error("Expected integer"); | |
| 298 | 316 | retval.count = json["count"]; |
| 299 | 317 | retval.item = json["item"]; |
| 300 | 318 | |
| @@ -777,6 +795,7 @@ class Expression { | ||
| 777 | 795 | Expression Expression_from_JSON(mixed json) { |
| 778 | 796 | Expression retval = Expression(); |
| 779 | 797 | |
| 798 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 780 | 799 | retval.column_id = json["columnId"]; |
| 781 | 800 | retval.type = json["type"]; |
Test case
1 generated file · +19 −0test/inputs/json/misc/617e8.json
Mpikedefault / TopLevel.pmod+19 −0
| @@ -152,12 +152,15 @@ View View_from_JSON(mixed json) { | ||
| 152 | 152 | |
| 153 | 153 | retval.attribution = json["attribution"]; |
| 154 | 154 | retval.attribution_link = json["attributionLink"]; |
| 155 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 155 | 156 | retval.average_rating = json["averageRating"]; |
| 156 | 157 | retval.category = json["category"]; |
| 157 | 158 | retval.columns = json["columns"]; |
| 159 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 158 | 160 | retval.created_at = json["createdAt"]; |
| 159 | 161 | retval.description = json["description"]; |
| 160 | 162 | retval.display_type = json["displayType"]; |
| 163 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 161 | 164 | retval.download_count = json["downloadCount"]; |
| 162 | 165 | retval.flags = json["flags"]; |
| 163 | 166 | retval.grants = json["grants"]; |
| @@ -166,30 +169,40 @@ View View_from_JSON(mixed json) { | ||
| 166 | 169 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 167 | 170 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 168 | 171 | retval.id = json["id"]; |
| 172 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 169 | 173 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 170 | 174 | retval.locale = json["locale"]; |
| 171 | 175 | retval.metadata = json["metadata"]; |
| 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 | retval.owner = json["owner"]; |
| 178 | 184 | retval.provenance = json["provenance"]; |
| 179 | 185 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 180 | 186 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 187 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 181 | 188 | retval.publication_date = json["publicationDate"]; |
| 189 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 182 | 190 | retval.publication_group = json["publicationGroup"]; |
| 183 | 191 | retval.publication_stage = json["publicationStage"]; |
| 184 | 192 | retval.query = json["query"]; |
| 185 | 193 | retval.rights = json["rights"]; |
| 194 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 186 | 195 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 187 | 196 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 188 | 197 | retval.table_author = json["tableAuthor"]; |
| 198 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 189 | 199 | retval.table_id = json["tableId"]; |
| 190 | 200 | retval.tags = json["tags"]; |
| 201 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 191 | 202 | retval.total_times_rated = json["totalTimesRated"]; |
| 203 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 192 | 204 | retval.view_count = json["viewCount"]; |
| 205 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 193 | 206 | retval.view_last_modified = json["viewLastModified"]; |
| 194 | 207 | retval.view_type = json["viewType"]; |
| 195 | 208 | |
| @@ -239,8 +252,10 @@ Column Column_from_JSON(mixed json) { | ||
| 239 | 252 | retval.field_name = json["fieldName"]; |
| 240 | 253 | retval.flags = json["flags"]; |
| 241 | 254 | retval.format = json["format"]; |
| 255 | + if (!intp(json["id"])) error("Expected integer"); | |
| 242 | 256 | retval.id = json["id"]; |
| 243 | 257 | retval.name = json["name"]; |
| 258 | + if (!intp(json["position"])) error("Expected integer"); | |
| 244 | 259 | retval.position = json["position"]; |
| 245 | 260 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 246 | 261 | retval.table_column_id = json["tableColumnId"]; |
| @@ -273,7 +288,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 273 | 288 | CachedContents retval = CachedContents(); |
| 274 | 289 | |
| 275 | 290 | retval.largest = json["largest"]; |
| 291 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 276 | 292 | retval.non_null = json["non_null"]; |
| 293 | + if (!intp(json["null"])) error("Expected integer"); | |
| 277 | 294 | retval.null = json["null"]; |
| 278 | 295 | retval.smallest = json["smallest"]; |
| 279 | 296 | retval.top = json["top"]; |
| @@ -298,6 +315,7 @@ class Top { | ||
| 298 | 315 | Top Top_from_JSON(mixed json) { |
| 299 | 316 | Top retval = Top(); |
| 300 | 317 | |
| 318 | + if (!intp(json["count"])) error("Expected integer"); | |
| 301 | 319 | retval.count = json["count"]; |
| 302 | 320 | retval.item = json["item"]; |
| 303 | 321 | |
| @@ -774,6 +792,7 @@ class Expression { | ||
| 774 | 792 | Expression Expression_from_JSON(mixed json) { |
| 775 | 793 | Expression retval = Expression(); |
| 776 | 794 | |
| 795 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 777 | 796 | retval.column_id = json["columnId"]; |
| 778 | 797 | 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
| @@ -33,6 +33,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 33 | 33 | |
| 34 | 34 | retval.iss_position = json["iss_position"]; |
| 35 | 35 | retval.message = json["message"]; |
| 36 | + if (!intp(json["timestamp"])) error("Expected integer"); | |
| 36 | 37 | retval.timestamp = json["timestamp"]; |
| 37 | 38 | |
| 38 | 39 | 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; |
| @@ -107,6 +114,7 @@ Input Input_from_JSON(mixed json) { | ||
| 107 | 114 | |
| 108 | 115 | retval.prev_out = json["prev_out"]; |
| 109 | 116 | retval.script = json["script"]; |
| 117 | + if (!intp(json["sequence"])) error("Expected integer"); | |
| 110 | 118 | retval.sequence = json["sequence"]; |
| 111 | 119 | |
| 112 | 120 | return retval; |
| @@ -140,12 +148,16 @@ Out Out_from_JSON(mixed json) { | ||
| 140 | 148 | Out retval = Out(); |
| 141 | 149 | |
| 142 | 150 | retval.addr = json["addr"]; |
| 151 | + if (!intp(json["n"])) error("Expected integer"); | |
| 143 | 152 | retval.n = json["n"]; |
| 144 | 153 | retval.script = json["script"]; |
| 145 | 154 | if (json["spent"] != Standards.JSON.true && json["spent"] != Standards.JSON.false) error("Expected bool"); |
| 146 | 155 | retval.spent = json["spent"]; |
| 156 | + if (!intp(json["tx_index"])) error("Expected integer"); | |
| 147 | 157 | retval.tx_index = json["tx_index"]; |
| 158 | + if (!intp(json["type"])) error("Expected integer"); | |
| 148 | 159 | retval.type = json["type"]; |
| 160 | + if (!intp(json["value"])) error("Expected integer"); | |
| 149 | 161 | retval.value = json["value"]; |
| 150 | 162 | |
| 151 | 163 | return retval; |
Test case
1 generated file · +4 −0test/inputs/json/misc/6c155.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 79 | 79 | ResponseInfo retval = ResponseInfo(); |
| 80 | 80 | |
| 81 | 81 | retval.developer_message = json["developerMessage"]; |
| 82 | + if (!intp(json["status"])) error("Expected integer"); | |
| 82 | 83 | retval.status = json["status"]; |
| 83 | 84 | |
| 84 | 85 | return retval; |
| @@ -103,8 +104,11 @@ class Resultset { | ||
| 103 | 104 | Resultset Resultset_from_JSON(mixed json) { |
| 104 | 105 | Resultset retval = Resultset(); |
| 105 | 106 | |
| 107 | + if (!intp(json["count"])) error("Expected integer"); | |
| 106 | 108 | retval.count = json["count"]; |
| 109 | + if (!intp(json["page"])) error("Expected integer"); | |
| 107 | 110 | retval.page = json["page"]; |
| 111 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 108 | 112 | retval.pagesize = json["pagesize"]; |
| 109 | 113 | |
| 110 | 114 | return retval; |
Test case
1 generated file · +13 −0test/inputs/json/misc/6de06.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"); |
| @@ -291,6 +294,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 291 | 294 | retval.report_reasons = json["report_reasons"]; |
| 292 | 295 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 293 | 296 | retval.saved = json["saved"]; |
| 297 | + if (!intp(json["score"])) error("Expected integer"); | |
| 294 | 298 | retval.score = json["score"]; |
| 295 | 299 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 296 | 300 | retval.secure_media = json["secure_media"]; |
| @@ -309,11 +313,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 309 | 313 | if (!has_index(json, "suggested_sort")) error("Missing required property"); |
| 310 | 314 | retval.suggested_sort = 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"]; |
| @@ -385,16 +392,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 385 | 392 | Oembed retval = Oembed(); |
| 386 | 393 | |
| 387 | 394 | retval.description = json["description"]; |
| 395 | + if (!intp(json["height"])) error("Expected integer"); | |
| 388 | 396 | retval.height = json["height"]; |
| 389 | 397 | retval.html = json["html"]; |
| 390 | 398 | retval.provider_name = json["provider_name"]; |
| 391 | 399 | retval.provider_url = json["provider_url"]; |
| 400 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 392 | 401 | retval.thumbnail_height = json["thumbnail_height"]; |
| 393 | 402 | retval.thumbnail_url = json["thumbnail_url"]; |
| 403 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 394 | 404 | retval.thumbnail_width = json["thumbnail_width"]; |
| 395 | 405 | retval.title = json["title"]; |
| 396 | 406 | retval.type = json["type"]; |
| 397 | 407 | retval.version = json["version"]; |
| 408 | + if (!intp(json["width"])) error("Expected integer"); | |
| 398 | 409 | retval.width = json["width"]; |
| 399 | 410 | |
| 400 | 411 | return retval; |
| @@ -511,8 +522,10 @@ class Source { | ||
| 511 | 522 | Source Source_from_JSON(mixed json) { |
| 512 | 523 | Source retval = Source(); |
| 513 | 524 | |
| 525 | + if (!intp(json["height"])) error("Expected integer"); | |
| 514 | 526 | retval.height = json["height"]; |
| 515 | 527 | retval.url = json["url"]; |
| 528 | + if (!intp(json["width"])) error("Expected integer"); | |
| 516 | 529 | retval.width = json["width"]; |
| 517 | 530 | |
| 518 | 531 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/6dec6.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | 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,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | retval.previous = json["previous"]; |
| @@ -216,6 +219,7 @@ Result Result_from_JSON(mixed json) { | ||
| 216 | 219 | retval.be_office_street = json["be_office_street"]; |
| 217 | 220 | retval.be_office_town = json["be_office_town"]; |
| 218 | 221 | retval.code_of_conduct = json["code_of_conduct"]; |
| 222 | + if (!intp(json["contact_country"])) error("Expected integer"); | |
| 219 | 223 | retval.contact_country = json["contact_country"]; |
| 220 | 224 | retval.created_at = json["created_at"]; |
| 221 | 225 | retval.entity = json["entity"]; |
| @@ -239,15 +243,21 @@ Result Result_from_JSON(mixed json) { | ||
| 239 | 243 | retval.last_update_date = json["last_update_date"]; |
| 240 | 244 | retval.legal = json["legal"]; |
| 241 | 245 | retval.legal_status = json["legal_status"]; |
| 246 | + if (!intp(json["main_category"])) error("Expected integer"); | |
| 242 | 247 | retval.main_category = json["main_category"]; |
| 243 | 248 | retval.main_category_title = json["main_category_title"]; |
| 249 | + if (!intp(json["members"])) error("Expected integer"); | |
| 244 | 250 | retval.members = json["members"]; |
| 251 | + if (!intp(json["members_100"])) error("Expected integer"); | |
| 245 | 252 | if (!has_index(json, "members_100")) error("Missing required property"); |
| 246 | 253 | retval.members_100 = json["members_100"]; |
| 254 | + if (!intp(json["members_25"])) error("Expected integer"); | |
| 247 | 255 | if (!has_index(json, "members_25")) error("Missing required property"); |
| 248 | 256 | retval.members_25 = json["members_25"]; |
| 257 | + if (!intp(json["members_50"])) error("Expected integer"); | |
| 249 | 258 | if (!has_index(json, "members_50")) error("Missing required property"); |
| 250 | 259 | retval.members_50 = json["members_50"]; |
| 260 | + if (!intp(json["members_75"])) error("Expected integer"); | |
| 251 | 261 | if (!has_index(json, "members_75")) error("Missing required property"); |
| 252 | 262 | retval.members_75 = json["members_75"]; |
| 253 | 263 | retval.members_fte = (float)json["members_fte"]; |
| @@ -255,6 +265,7 @@ Result Result_from_JSON(mixed json) { | ||
| 255 | 265 | retval.native_name = json["native_name"]; |
| 256 | 266 | if (!has_index(json, "networking")) error("Missing required property"); |
| 257 | 267 | retval.networking = json["networking"]; |
| 268 | + if (!intp(json["number_of_natural_persons"])) error("Expected integer"); | |
| 258 | 269 | if (!has_index(json, "number_of_natural_persons")) error("Missing required property"); |
| 259 | 270 | retval.number_of_natural_persons = json["number_of_natural_persons"]; |
| 260 | 271 | if (!has_index(json, "other_code_of_conduct")) error("Missing required property"); |
| @@ -262,6 +273,7 @@ Result Result_from_JSON(mixed json) { | ||
| 262 | 273 | retval.registration_date = json["registration_date"]; |
| 263 | 274 | retval.status = Status_from_JSON(json["status"]); |
| 264 | 275 | retval.structure_members = json["structure_members"]; |
| 276 | + if (!intp(json["sub_category"])) error("Expected integer"); | |
| 265 | 277 | retval.sub_category = json["sub_category"]; |
| 266 | 278 | retval.sub_category_title = json["sub_category_title"]; |
| 267 | 279 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/7681c.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -408,6 +409,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 408 | 409 | |
| 409 | 410 | retval.msg = json["msg"]; |
| 410 | 411 | retval.response_id = json["response_id"]; |
| 412 | + if (!intp(json["status"])) error("Expected integer"); | |
| 411 | 413 | retval.status = json["status"]; |
| 412 | 414 | |
| 413 | 415 | return retval; |
| @@ -432,8 +434,11 @@ class Pagination { | ||
| 432 | 434 | Pagination Pagination_from_JSON(mixed json) { |
| 433 | 435 | Pagination retval = Pagination(); |
| 434 | 436 | |
| 437 | + if (!intp(json["count"])) error("Expected integer"); | |
| 435 | 438 | retval.count = json["count"]; |
| 439 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 436 | 440 | retval.offset = json["offset"]; |
| 441 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 437 | 442 | retval.total_count = json["total_count"]; |
| 438 | 443 | |
| 439 | 444 | return retval; |
Test case
1 generated file · +2 −0test/inputs/json/misc/7df41.json
Mpikedefault / TopLevel.pmod+2 −0
| @@ -63,8 +63,10 @@ class Pc { | ||
| 63 | 63 | Pc Pc_from_JSON(mixed json) { |
| 64 | 64 | Pc retval = Pc(); |
| 65 | 65 | |
| 66 | + if (!intp(json["count"])) error("Expected integer"); | |
| 66 | 67 | retval.count = json["count"]; |
| 67 | 68 | retval.label = json["label"]; |
| 69 | + if (!intp(json["peak24"])) error("Expected integer"); | |
| 68 | 70 | retval.peak24 = json["peak24"]; |
| 69 | 71 | |
| 70 | 72 | 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"]; |
| @@ -88,12 +89,16 @@ Result Result_from_JSON(mixed json) { | ||
| 88 | 89 | retval.fav = json["fav"]; |
| 89 | 90 | retval.group = json["group"]; |
| 90 | 91 | retval.location = Location_from_JSON(json["location"]); |
| 92 | + if (!intp(json["min_screens"])) error("Expected integer"); | |
| 91 | 93 | retval.min_screens = json["min_screens"]; |
| 94 | + if (!intp(json["num_views"])) error("Expected integer"); | |
| 92 | 95 | retval.num_views = json["num_views"]; |
| 93 | 96 | retval.showtimes = json["showtimes"]; |
| 97 | + if (!intp(json["stars"])) error("Expected integer"); | |
| 94 | 98 | retval.stars = json["stars"]; |
| 95 | 99 | retval.tel = Tel_from_JSON(json["tel"]); |
| 96 | 100 | retval.thai = json["thai"]; |
| 101 | + if (!intp(json["today_screens"])) error("Expected integer"); | |
| 97 | 102 | retval.today_screens = json["today_screens"]; |
| 98 | 103 | retval.url = json["url"]; |
| 99 | 104 | 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
| @@ -118,9 +118,12 @@ class FluffyTopLevel { | ||
| 118 | 118 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 119 | 119 | FluffyTopLevel retval = FluffyTopLevel(); |
| 120 | 120 | |
| 121 | + if (!intp(json["page"])) error("Expected integer"); | |
| 121 | 122 | retval.page = json["page"]; |
| 123 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 122 | 124 | retval.pages = json["pages"]; |
| 123 | 125 | retval.per_page = json["per_page"]; |
| 126 | + if (!intp(json["total"])) error("Expected integer"); | |
| 124 | 127 | retval.total = json["total"]; |
| 125 | 128 | |
| 126 | 129 | return retval; |
Test case
1 generated file · +6 −0test/inputs/json/misc/80aff.json
Mpikedefault / TopLevel.pmod+6 −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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | if (json["next"] != Standards.JSON.true && json["next"] != Standards.JSON.false) error("Expected bool"); |
| 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"]; |
| @@ -96,9 +99,12 @@ Result Result_from_JSON(mixed json) { | ||
| 96 | 99 | Result retval = Result(); |
| 97 | 100 | |
| 98 | 101 | retval.created_at = json["created_at"]; |
| 102 | + if (!intp(json["id"])) error("Expected integer"); | |
| 99 | 103 | retval.id = json["id"]; |
| 104 | + if (!intp(json["items"])) error("Expected integer"); | |
| 100 | 105 | retval.items = json["items"]; |
| 101 | 106 | retval.name = json["name"]; |
| 107 | + if (!intp(json["parent"])) error("Expected integer"); | |
| 102 | 108 | if (!has_index(json, "parent")) error("Missing required property"); |
| 103 | 109 | retval.parent = json["parent"]; |
| 104 | 110 | retval.updated_at = json["updated_at"]; |
Test case
1 generated file · +9 −0test/inputs/json/misc/8592b.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 = 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"]; |
| @@ -275,6 +277,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 275 | 277 | retval.media_embed = json["media_embed"]; |
| 276 | 278 | retval.mod_reports = json["mod_reports"]; |
| 277 | 279 | retval.name = json["name"]; |
| 280 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 278 | 281 | retval.num_comments = json["num_comments"]; |
| 279 | 282 | retval.num_reports = json["num_reports"]; |
| 280 | 283 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -288,6 +291,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 288 | 291 | retval.report_reasons = json["report_reasons"]; |
| 289 | 292 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 290 | 293 | retval.saved = json["saved"]; |
| 294 | + if (!intp(json["score"])) error("Expected integer"); | |
| 291 | 295 | retval.score = json["score"]; |
| 292 | 296 | retval.secure_media = json["secure_media"]; |
| 293 | 297 | retval.secure_media_embed = json["secure_media_embed"]; |
| @@ -304,11 +308,14 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 304 | 308 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 305 | 309 | retval.suggested_sort = SuggestedSort_from_JSON(json["suggested_sort"]); |
| 306 | 310 | retval.thumbnail = json["thumbnail"]; |
| 311 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 307 | 312 | if (!has_index(json, "thumbnail_height")) error("Missing required property"); |
| 308 | 313 | retval.thumbnail_height = json["thumbnail_height"]; |
| 314 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 309 | 315 | if (!has_index(json, "thumbnail_width")) error("Missing required property"); |
| 310 | 316 | retval.thumbnail_width = json["thumbnail_width"]; |
| 311 | 317 | retval.title = json["title"]; |
| 318 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 312 | 319 | retval.ups = json["ups"]; |
| 313 | 320 | retval.url = json["url"]; |
| 314 | 321 | retval.user_reports = json["user_reports"]; |
| @@ -415,8 +422,10 @@ class Source { | ||
| 415 | 422 | Source Source_from_JSON(mixed json) { |
| 416 | 423 | Source retval = Source(); |
| 417 | 424 | |
| 425 | + if (!intp(json["height"])) error("Expected integer"); | |
| 418 | 426 | retval.height = json["height"]; |
| 419 | 427 | retval.url = json["url"]; |
| 428 | + if (!intp(json["width"])) error("Expected integer"); | |
| 420 | 429 | retval.width = json["width"]; |
| 421 | 430 | |
| 422 | 431 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/88130.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | 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
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/9ac3b.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -39,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | retval.previous = json["previous"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/a0496.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -67,6 +67,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 67 | 67 | retval.errors = json["errors"]; |
| 68 | 68 | retval.frequency = json["frequency"]; |
| 69 | 69 | retval.from_date = json["from_date"]; |
| 70 | + if (!intp(json["id"])) error("Expected integer"); | |
| 70 | 71 | retval.id = json["id"]; |
| 71 | 72 | retval.name = json["name"]; |
| 72 | 73 | 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
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +18 −0test/inputs/json/misc/a3d8c.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -148,11 +148,14 @@ class View { | ||
| 148 | 148 | View View_from_JSON(mixed json) { |
| 149 | 149 | View retval = View(); |
| 150 | 150 | |
| 151 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 151 | 152 | retval.average_rating = json["averageRating"]; |
| 152 | 153 | retval.category = json["category"]; |
| 153 | 154 | retval.columns = json["columns"]; |
| 155 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 154 | 156 | retval.created_at = json["createdAt"]; |
| 155 | 157 | retval.display_type = json["displayType"]; |
| 158 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 156 | 159 | retval.download_count = json["downloadCount"]; |
| 157 | 160 | retval.flags = json["flags"]; |
| 158 | 161 | retval.grants = json["grants"]; |
| @@ -161,6 +164,7 @@ View View_from_JSON(mixed json) { | ||
| 161 | 164 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 162 | 165 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 163 | 166 | retval.id = json["id"]; |
| 167 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 164 | 168 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 165 | 169 | retval.license = json["license"]; |
| 166 | 170 | retval.license_id = json["licenseId"]; |
| @@ -169,24 +173,33 @@ View View_from_JSON(mixed json) { | ||
| 169 | 173 | retval.name = json["name"]; |
| 170 | 174 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 171 | 175 | retval.new_backend = json["newBackend"]; |
| 176 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 172 | 177 | retval.number_of_comments = json["numberOfComments"]; |
| 178 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 173 | 179 | retval.oid = json["oid"]; |
| 174 | 180 | retval.owner = json["owner"]; |
| 175 | 181 | retval.provenance = json["provenance"]; |
| 176 | 182 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 183 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 184 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 178 | 185 | retval.publication_date = json["publicationDate"]; |
| 186 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 179 | 187 | retval.publication_group = json["publicationGroup"]; |
| 180 | 188 | retval.publication_stage = json["publicationStage"]; |
| 181 | 189 | retval.query = json["query"]; |
| 182 | 190 | retval.rights = json["rights"]; |
| 183 | 191 | retval.row_class = json["rowClass"]; |
| 192 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 184 | 193 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 185 | 194 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 186 | 195 | retval.table_author = json["tableAuthor"]; |
| 196 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 187 | 197 | retval.table_id = json["tableId"]; |
| 198 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 188 | 199 | retval.total_times_rated = json["totalTimesRated"]; |
| 200 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 189 | 201 | retval.view_count = json["viewCount"]; |
| 202 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 190 | 203 | retval.view_last_modified = json["viewLastModified"]; |
| 191 | 204 | retval.view_type = json["viewType"]; |
| 192 | 205 | |
| @@ -233,8 +246,10 @@ Column Column_from_JSON(mixed json) { | ||
| 233 | 246 | retval.field_name = json["fieldName"]; |
| 234 | 247 | retval.flags = json["flags"]; |
| 235 | 248 | retval.format = json["format"]; |
| 249 | + if (!intp(json["id"])) error("Expected integer"); | |
| 236 | 250 | retval.id = json["id"]; |
| 237 | 251 | retval.name = json["name"]; |
| 252 | + if (!intp(json["position"])) error("Expected integer"); | |
| 238 | 253 | retval.position = json["position"]; |
| 239 | 254 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 240 | 255 | retval.table_column_id = json["tableColumnId"]; |
| @@ -272,7 +287,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 272 | 287 | |
| 273 | 288 | retval.average = json["average"]; |
| 274 | 289 | retval.largest = json["largest"]; |
| 290 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 275 | 291 | retval.non_null = json["non_null"]; |
| 292 | + if (!intp(json["null"])) error("Expected integer"); | |
| 276 | 293 | retval.null = json["null"]; |
| 277 | 294 | retval.smallest = json["smallest"]; |
| 278 | 295 | retval.sum = json["sum"]; |
| @@ -298,6 +315,7 @@ class Top { | ||
| 298 | 315 | Top Top_from_JSON(mixed json) { |
| 299 | 316 | Top retval = Top(); |
| 300 | 317 | |
| 318 | + if (!intp(json["count"])) error("Expected integer"); | |
| 301 | 319 | retval.count = json["count"]; |
| 302 | 320 | 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
| @@ -243,9 +243,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 243 | 243 | retval.created_utc = (float)json["created_utc"]; |
| 244 | 244 | retval.distinguished = json["distinguished"]; |
| 245 | 245 | retval.domain = Domain_from_JSON(json["domain"]); |
| 246 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 246 | 247 | retval.downs = json["downs"]; |
| 247 | 248 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 248 | 249 | retval.edited = json["edited"]; |
| 250 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 249 | 251 | retval.gilded = json["gilded"]; |
| 250 | 252 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 251 | 253 | retval.hidden = json["hidden"]; |
| @@ -267,6 +269,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 267 | 269 | retval.media_embed = json["media_embed"]; |
| 268 | 270 | retval.mod_reports = json["mod_reports"]; |
| 269 | 271 | retval.name = json["name"]; |
| 272 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 270 | 273 | retval.num_comments = json["num_comments"]; |
| 271 | 274 | retval.num_reports = json["num_reports"]; |
| 272 | 275 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -278,6 +281,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 278 | 281 | retval.report_reasons = json["report_reasons"]; |
| 279 | 282 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 280 | 283 | retval.saved = json["saved"]; |
| 284 | + if (!intp(json["score"])) error("Expected integer"); | |
| 281 | 285 | retval.score = json["score"]; |
| 282 | 286 | retval.secure_media = json["secure_media"]; |
| 283 | 287 | retval.secure_media_embed = json["secure_media_embed"]; |
| @@ -294,6 +298,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 294 | 298 | retval.suggested_sort = json["suggested_sort"]; |
| 295 | 299 | retval.thumbnail = json["thumbnail"]; |
| 296 | 300 | retval.title = json["title"]; |
| 301 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 297 | 302 | retval.ups = json["ups"]; |
| 298 | 303 | retval.url = json["url"]; |
| 299 | 304 | retval.user_reports = json["user_reports"]; |
Test case
1 generated file · +6 −0test/inputs/json/misc/af2d1.json
Mpikedefault / TopLevel.pmod+6 −0
| @@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 35 | 35 | |
| 36 | 36 | retval.crs = json["crs"]; |
| 37 | 37 | retval.features = json["features"]; |
| 38 | + if (!intp(json["totalFeatures"])) error("Expected integer"); | |
| 38 | 39 | retval.total_features = json["totalFeatures"]; |
| 39 | 40 | retval.type = json["type"]; |
| 40 | 41 | |
| @@ -250,6 +251,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 250 | 251 | retval.asset_numb = json["asset_numb"]; |
| 251 | 252 | if (!has_index(json, "comments")) error("Missing required property"); |
| 252 | 253 | retval.comments = json["comments"]; |
| 254 | + if (!intp(json["condition"])) error("Expected integer"); | |
| 253 | 255 | retval.condition = json["condition"]; |
| 254 | 256 | if (!has_index(json, "constructi")) error("Missing required property"); |
| 255 | 257 | retval.constructi = json["constructi"]; |
| @@ -265,6 +267,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 265 | 267 | retval.folder_num = json["folder_num"]; |
| 266 | 268 | if (!has_index(json, "funding_ba")) error("Missing required property"); |
| 267 | 269 | retval.funding_ba = FundingBa_from_JSON(json["funding_ba"]); |
| 270 | + if (!intp(json["historic_c"])) error("Expected integer"); | |
| 268 | 271 | retval.historic_c = json["historic_c"]; |
| 269 | 272 | retval.inspection = json["inspection"]; |
| 270 | 273 | retval.inspectors = json["inspectors"]; |
| @@ -272,8 +275,10 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 272 | 275 | if (!has_index(json, "level_accu")) error("Missing required property"); |
| 273 | 276 | retval.level_accu = LevelAccu_from_JSON(json["level_accu"]); |
| 274 | 277 | retval.material = Material_from_JSON(json["material"]); |
| 278 | + if (!intp(json["mi_prinx"])) error("Expected integer"); | |
| 275 | 279 | retval.mi_prinx = json["mi_prinx"]; |
| 276 | 280 | retval.mi_symbolo = MiSymbolo_from_JSON(json["mi_symbolo"]); |
| 281 | + if (!intp(json["number_lan"])) error("Expected integer"); | |
| 277 | 282 | retval.number_lan = json["number_lan"]; |
| 278 | 283 | if (!has_index(json, "owner")) error("Missing required property"); |
| 279 | 284 | retval.owner = json["owner"]; |
| @@ -281,6 +286,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) { | ||
| 281 | 286 | retval.positional = LevelAccu_from_JSON(json["positional"]); |
| 282 | 287 | if (!has_index(json, "project_nu")) error("Missing required property"); |
| 283 | 288 | retval.project_nu = json["project_nu"]; |
| 289 | + if (!intp(json["rec_id"])) error("Expected integer"); | |
| 284 | 290 | retval.rec_id = json["rec_id"]; |
| 285 | 291 | if (!has_index(json, "record_cre")) error("Missing required property"); |
| 286 | 292 | 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
| @@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 253 | 253 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 254 | 254 | retval.distinguished = 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 (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"]; |
| @@ -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"); |
| @@ -289,6 +292,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 289 | 292 | retval.report_reasons = json["report_reasons"]; |
| 290 | 293 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 291 | 294 | retval.saved = json["saved"]; |
| 295 | + if (!intp(json["score"])) error("Expected integer"); | |
| 292 | 296 | retval.score = json["score"]; |
| 293 | 297 | if (!has_index(json, "secure_media")) error("Missing required property"); |
| 294 | 298 | retval.secure_media = json["secure_media"]; |
| @@ -305,9 +309,12 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 305 | 309 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 306 | 310 | retval.suggested_sort = json["suggested_sort"]; |
| 307 | 311 | retval.thumbnail = json["thumbnail"]; |
| 312 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 308 | 313 | retval.thumbnail_height = json["thumbnail_height"]; |
| 314 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 309 | 315 | retval.thumbnail_width = json["thumbnail_width"]; |
| 310 | 316 | retval.title = json["title"]; |
| 317 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 311 | 318 | retval.ups = json["ups"]; |
| 312 | 319 | retval.url = json["url"]; |
| 313 | 320 | retval.user_reports = json["user_reports"]; |
| @@ -391,16 +398,20 @@ Oembed Oembed_from_JSON(mixed json) { | ||
| 391 | 398 | Oembed retval = Oembed(); |
| 392 | 399 | |
| 393 | 400 | retval.description = json["description"]; |
| 401 | + if (!intp(json["height"])) error("Expected integer"); | |
| 394 | 402 | retval.height = json["height"]; |
| 395 | 403 | retval.html = json["html"]; |
| 396 | 404 | retval.provider_name = json["provider_name"]; |
| 397 | 405 | retval.provider_url = json["provider_url"]; |
| 406 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 398 | 407 | retval.thumbnail_height = json["thumbnail_height"]; |
| 399 | 408 | retval.thumbnail_url = json["thumbnail_url"]; |
| 409 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 400 | 410 | retval.thumbnail_width = json["thumbnail_width"]; |
| 401 | 411 | retval.title = json["title"]; |
| 402 | 412 | retval.type = json["type"]; |
| 403 | 413 | retval.version = json["version"]; |
| 414 | + if (!intp(json["width"])) error("Expected integer"); | |
| 404 | 415 | retval.width = json["width"]; |
| 405 | 416 | |
| 406 | 417 | 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/c0356.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -78,6 +78,7 @@ Description Description_from_JSON(mixed json) { | ||
| 78 | 78 | Description retval = Description(); |
| 79 | 79 | |
| 80 | 80 | retval.base_period = json["base_period"]; |
| 81 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 81 | 82 | retval.missing = json["missing"]; |
| 82 | 83 | retval.title = json["title"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/c3303.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -403,6 +404,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 403 | 404 | |
| 404 | 405 | retval.msg = json["msg"]; |
| 405 | 406 | retval.response_id = json["response_id"]; |
| 407 | + if (!intp(json["status"])) error("Expected integer"); | |
| 406 | 408 | retval.status = json["status"]; |
| 407 | 409 | |
| 408 | 410 | return retval; |
| @@ -427,8 +429,11 @@ class Pagination { | ||
| 427 | 429 | Pagination Pagination_from_JSON(mixed json) { |
| 428 | 430 | Pagination retval = Pagination(); |
| 429 | 431 | |
| 432 | + if (!intp(json["count"])) error("Expected integer"); | |
| 430 | 433 | retval.count = json["count"]; |
| 434 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 431 | 435 | retval.offset = json["offset"]; |
| 436 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 432 | 437 | retval.total_count = json["total_count"]; |
| 433 | 438 | |
| 434 | 439 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/c8c7e.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -118,9 +118,12 @@ class FluffyTopLevel { | ||
| 118 | 118 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 119 | 119 | FluffyTopLevel retval = FluffyTopLevel(); |
| 120 | 120 | |
| 121 | + if (!intp(json["page"])) error("Expected integer"); | |
| 121 | 122 | retval.page = json["page"]; |
| 123 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 122 | 124 | retval.pages = json["pages"]; |
| 123 | 125 | retval.per_page = json["per_page"]; |
| 126 | + if (!intp(json["total"])) error("Expected integer"); | |
| 124 | 127 | retval.total = json["total"]; |
| 125 | 128 | |
| 126 | 129 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/misc/cda6c.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -118,9 +118,12 @@ class FluffyTopLevel { | ||
| 118 | 118 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 119 | 119 | FluffyTopLevel retval = FluffyTopLevel(); |
| 120 | 120 | |
| 121 | + if (!intp(json["page"])) error("Expected integer"); | |
| 121 | 122 | retval.page = json["page"]; |
| 123 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 122 | 124 | retval.pages = json["pages"]; |
| 123 | 125 | retval.per_page = json["per_page"]; |
| 126 | + if (!intp(json["total"])) error("Expected integer"); | |
| 124 | 127 | retval.total = json["total"]; |
| 125 | 128 | |
| 126 | 129 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/cf0d8.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | 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,10 +39,13 @@ 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 | retval.facets = json["facets"]; |
| 45 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 44 | 46 | retval.limit = json["limit"]; |
| 45 | 47 | retval.next = json["next"]; |
| 48 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 46 | 49 | retval.offset = json["offset"]; |
| 47 | 50 | if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool"); |
| 48 | 51 | retval.previous = json["previous"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/dbfb3.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | 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
| @@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) { | ||
| 79 | 79 | ResponseInfo retval = ResponseInfo(); |
| 80 | 80 | |
| 81 | 81 | retval.developer_message = json["developerMessage"]; |
| 82 | + if (!intp(json["status"])) error("Expected integer"); | |
| 82 | 83 | retval.status = json["status"]; |
| 83 | 84 | |
| 84 | 85 | return retval; |
| @@ -103,8 +104,11 @@ class Resultset { | ||
| 103 | 104 | Resultset Resultset_from_JSON(mixed json) { |
| 104 | 105 | Resultset retval = Resultset(); |
| 105 | 106 | |
| 107 | + if (!intp(json["count"])) error("Expected integer"); | |
| 106 | 108 | retval.count = json["count"]; |
| 109 | + if (!intp(json["page"])) error("Expected integer"); | |
| 107 | 110 | retval.page = json["page"]; |
| 111 | + if (!intp(json["pagesize"])) error("Expected integer"); | |
| 108 | 112 | retval.pagesize = json["pagesize"]; |
| 109 | 113 | |
| 110 | 114 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/df957.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +5 −0test/inputs/json/misc/e0ac7.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -397,6 +398,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 397 | 398 | |
| 398 | 399 | retval.msg = json["msg"]; |
| 399 | 400 | retval.response_id = json["response_id"]; |
| 401 | + if (!intp(json["status"])) error("Expected integer"); | |
| 400 | 402 | retval.status = json["status"]; |
| 401 | 403 | |
| 402 | 404 | return retval; |
| @@ -421,8 +423,11 @@ class Pagination { | ||
| 421 | 423 | Pagination Pagination_from_JSON(mixed json) { |
| 422 | 424 | Pagination retval = Pagination(); |
| 423 | 425 | |
| 426 | + if (!intp(json["count"])) error("Expected integer"); | |
| 424 | 427 | retval.count = json["count"]; |
| 428 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 425 | 429 | retval.offset = json["offset"]; |
| 430 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 426 | 431 | retval.total_count = json["total_count"]; |
| 427 | 432 | |
| 428 | 433 | return retval; |
Test case
1 generated file · +1 −0test/inputs/json/misc/e2915.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -53,6 +53,7 @@ class Query { | ||
| 53 | 53 | Query Query_from_JSON(mixed json) { |
| 54 | 54 | Query retval = Query(); |
| 55 | 55 | |
| 56 | + if (!intp(json["count"])) error("Expected integer"); | |
| 56 | 57 | retval.count = json["count"]; |
| 57 | 58 | retval.created = json["created"]; |
| 58 | 59 | retval.lang = json["lang"]; |
Test case
1 generated file · +3 −0test/inputs/json/misc/e53b5.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -118,9 +118,12 @@ class FluffyTopLevel { | ||
| 118 | 118 | FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) { |
| 119 | 119 | FluffyTopLevel retval = FluffyTopLevel(); |
| 120 | 120 | |
| 121 | + if (!intp(json["page"])) error("Expected integer"); | |
| 121 | 122 | retval.page = json["page"]; |
| 123 | + if (!intp(json["pages"])) error("Expected integer"); | |
| 122 | 124 | retval.pages = json["pages"]; |
| 123 | 125 | retval.per_page = json["per_page"]; |
| 126 | + if (!intp(json["total"])) error("Expected integer"); | |
| 124 | 127 | retval.total = json["total"]; |
| 125 | 128 | |
| 126 | 129 | 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"]; |
| @@ -132,13 +135,16 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 132 | 135 | retval.name = json["name"]; |
| 133 | 136 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 134 | 137 | retval.new_backend = json["newBackend"]; |
| 138 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 135 | 139 | retval.number_of_comments = json["numberOfComments"]; |
| 140 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 136 | 141 | retval.oid = json["oid"]; |
| 137 | 142 | retval.owner = json["owner"]; |
| 138 | 143 | retval.provenance = Provenance_from_JSON(json["provenance"]); |
| 139 | 144 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 140 | 145 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 141 | 146 | retval.publication_date = json["publicationDate"]; |
| 147 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 142 | 148 | retval.publication_group = json["publicationGroup"]; |
| 143 | 149 | retval.publication_stage = PublicationStage_from_JSON(json["publicationStage"]); |
| 144 | 150 | retval.ratings = json["ratings"]; |
| @@ -149,10 +155,14 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) { | ||
| 149 | 155 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 150 | 156 | retval.rows_updated_by = RowsUpdatedBy_from_JSON(json["rowsUpdatedBy"]); |
| 151 | 157 | retval.table_author = json["tableAuthor"]; |
| 158 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 152 | 159 | retval.table_id = json["tableId"]; |
| 153 | 160 | retval.tags = json["tags"]; |
| 161 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 154 | 162 | retval.total_times_rated = json["totalTimesRated"]; |
| 163 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 155 | 164 | retval.view_count = json["viewCount"]; |
| 165 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 156 | 166 | retval.view_last_modified = json["viewLastModified"]; |
| 157 | 167 | retval.view_type = ViewType_from_JSON(json["viewType"]); |
| 158 | 168 | |
| @@ -547,6 +557,7 @@ class TableColumnId { | ||
| 547 | 557 | TableColumnId TableColumnId_from_JSON(mixed json) { |
| 548 | 558 | TableColumnId retval = TableColumnId(); |
| 549 | 559 | |
| 560 | + if (!intp(json["2819740"])) error("Expected integer"); | |
| 550 | 561 | retval.the_2819740 = json["2819740"]; |
| 551 | 562 | |
| 552 | 563 | return retval; |
| @@ -713,6 +724,7 @@ class Field { | ||
| 713 | 724 | Field Field_from_JSON(mixed json) { |
| 714 | 725 | Field retval = Field(); |
| 715 | 726 | |
| 727 | + if (!intp(json["tableColumnId"])) error("Expected integer"); | |
| 716 | 728 | retval.table_column_id = json["tableColumnId"]; |
| 717 | 729 | retval.type = FieldType_from_JSON(json["type"]); |
| 718 | 730 | |
| @@ -941,6 +953,7 @@ class Ratings { | ||
| 941 | 953 | Ratings Ratings_from_JSON(mixed json) { |
| 942 | 954 | Ratings retval = Ratings(); |
| 943 | 955 | |
| 956 | + if (!intp(json["rating"])) error("Expected integer"); | |
| 944 | 957 | retval.rating = json["rating"]; |
| 945 | 958 | |
| 946 | 959 | return retval; |
Test case
1 generated file · +5 −0test/inputs/json/misc/f22f5.json
Mpikedefault / TopLevel.pmod+5 −0
| @@ -243,9 +243,11 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 243 | 243 | retval.created_utc = (float)json["created_utc"]; |
| 244 | 244 | retval.distinguished = json["distinguished"]; |
| 245 | 245 | retval.domain = json["domain"]; |
| 246 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 246 | 247 | retval.downs = json["downs"]; |
| 247 | 248 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 248 | 249 | retval.edited = json["edited"]; |
| 250 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 249 | 251 | retval.gilded = json["gilded"]; |
| 250 | 252 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 251 | 253 | retval.hidden = json["hidden"]; |
| @@ -267,6 +269,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 267 | 269 | retval.media_embed = json["media_embed"]; |
| 268 | 270 | retval.mod_reports = json["mod_reports"]; |
| 269 | 271 | retval.name = json["name"]; |
| 272 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 270 | 273 | retval.num_comments = json["num_comments"]; |
| 271 | 274 | retval.num_reports = json["num_reports"]; |
| 272 | 275 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -278,6 +281,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 278 | 281 | retval.report_reasons = json["report_reasons"]; |
| 279 | 282 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 280 | 283 | retval.saved = json["saved"]; |
| 284 | + if (!intp(json["score"])) error("Expected integer"); | |
| 281 | 285 | retval.score = json["score"]; |
| 282 | 286 | retval.secure_media = json["secure_media"]; |
| 283 | 287 | retval.secure_media_embed = json["secure_media_embed"]; |
| @@ -294,6 +298,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 294 | 298 | retval.suggested_sort = json["suggested_sort"]; |
| 295 | 299 | retval.thumbnail = json["thumbnail"]; |
| 296 | 300 | retval.title = json["title"]; |
| 301 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 297 | 302 | retval.ups = json["ups"]; |
| 298 | 303 | retval.url = json["url"]; |
| 299 | 304 | 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
| @@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) { | ||
| 94 | 94 | retval.id = json["id"]; |
| 95 | 95 | retval.images = json["images"]; |
| 96 | 96 | retval.import_datetime = json["import_datetime"]; |
| 97 | + if (!intp(json["is_indexable"])) error("Expected integer"); | |
| 97 | 98 | retval.is_indexable = json["is_indexable"]; |
| 98 | 99 | retval.rating = Rating_from_JSON(json["rating"]); |
| 99 | 100 | retval.slug = json["slug"]; |
| @@ -409,6 +410,7 @@ Meta Meta_from_JSON(mixed json) { | ||
| 409 | 410 | |
| 410 | 411 | retval.msg = json["msg"]; |
| 411 | 412 | retval.response_id = json["response_id"]; |
| 413 | + if (!intp(json["status"])) error("Expected integer"); | |
| 412 | 414 | retval.status = json["status"]; |
| 413 | 415 | |
| 414 | 416 | return retval; |
| @@ -433,8 +435,11 @@ class Pagination { | ||
| 433 | 435 | Pagination Pagination_from_JSON(mixed json) { |
| 434 | 436 | Pagination retval = Pagination(); |
| 435 | 437 | |
| 438 | + if (!intp(json["count"])) error("Expected integer"); | |
| 436 | 439 | retval.count = json["count"]; |
| 440 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 437 | 441 | retval.offset = json["offset"]; |
| 442 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 438 | 443 | retval.total_count = json["total_count"]; |
| 439 | 444 | |
| 440 | 445 | return retval; |
Test case
1 generated file · +18 −0test/inputs/json/misc/f74d5.json
Mpikedefault / TopLevel.pmod+18 −0
| @@ -148,11 +148,14 @@ class View { | ||
| 148 | 148 | View View_from_JSON(mixed json) { |
| 149 | 149 | View retval = View(); |
| 150 | 150 | |
| 151 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 151 | 152 | retval.average_rating = json["averageRating"]; |
| 152 | 153 | retval.category = json["category"]; |
| 153 | 154 | retval.columns = json["columns"]; |
| 155 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 154 | 156 | retval.created_at = json["createdAt"]; |
| 155 | 157 | retval.display_type = json["displayType"]; |
| 158 | + if (!intp(json["downloadCount"])) error("Expected integer"); | |
| 156 | 159 | retval.download_count = json["downloadCount"]; |
| 157 | 160 | retval.flags = json["flags"]; |
| 158 | 161 | retval.grants = json["grants"]; |
| @@ -161,6 +164,7 @@ View View_from_JSON(mixed json) { | ||
| 161 | 164 | if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool"); |
| 162 | 165 | retval.hide_from_data_json = json["hideFromDataJson"]; |
| 163 | 166 | retval.id = json["id"]; |
| 167 | + if (!intp(json["indexUpdatedAt"])) error("Expected integer"); | |
| 164 | 168 | retval.index_updated_at = json["indexUpdatedAt"]; |
| 165 | 169 | retval.license = json["license"]; |
| 166 | 170 | retval.license_id = json["licenseId"]; |
| @@ -169,24 +173,33 @@ View View_from_JSON(mixed json) { | ||
| 169 | 173 | retval.name = json["name"]; |
| 170 | 174 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 171 | 175 | retval.new_backend = json["newBackend"]; |
| 176 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 172 | 177 | retval.number_of_comments = json["numberOfComments"]; |
| 178 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 173 | 179 | retval.oid = json["oid"]; |
| 174 | 180 | retval.owner = json["owner"]; |
| 175 | 181 | retval.provenance = json["provenance"]; |
| 176 | 182 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 183 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 184 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 178 | 185 | retval.publication_date = json["publicationDate"]; |
| 186 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 179 | 187 | retval.publication_group = json["publicationGroup"]; |
| 180 | 188 | retval.publication_stage = json["publicationStage"]; |
| 181 | 189 | retval.query = json["query"]; |
| 182 | 190 | retval.rights = json["rights"]; |
| 183 | 191 | retval.row_class = json["rowClass"]; |
| 192 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 184 | 193 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 185 | 194 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 186 | 195 | retval.table_author = json["tableAuthor"]; |
| 196 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 187 | 197 | retval.table_id = json["tableId"]; |
| 198 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 188 | 199 | retval.total_times_rated = json["totalTimesRated"]; |
| 200 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 189 | 201 | retval.view_count = json["viewCount"]; |
| 202 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 190 | 203 | retval.view_last_modified = json["viewLastModified"]; |
| 191 | 204 | retval.view_type = json["viewType"]; |
| 192 | 205 | |
| @@ -233,8 +246,10 @@ Column Column_from_JSON(mixed json) { | ||
| 233 | 246 | retval.field_name = json["fieldName"]; |
| 234 | 247 | retval.flags = json["flags"]; |
| 235 | 248 | retval.format = json["format"]; |
| 249 | + if (!intp(json["id"])) error("Expected integer"); | |
| 236 | 250 | retval.id = json["id"]; |
| 237 | 251 | retval.name = json["name"]; |
| 252 | + if (!intp(json["position"])) error("Expected integer"); | |
| 238 | 253 | retval.position = json["position"]; |
| 239 | 254 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 240 | 255 | retval.table_column_id = json["tableColumnId"]; |
| @@ -272,7 +287,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 272 | 287 | |
| 273 | 288 | retval.average = json["average"]; |
| 274 | 289 | retval.largest = json["largest"]; |
| 290 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 275 | 291 | retval.non_null = json["non_null"]; |
| 292 | + if (!intp(json["null"])) error("Expected integer"); | |
| 276 | 293 | retval.null = json["null"]; |
| 277 | 294 | retval.smallest = json["smallest"]; |
| 278 | 295 | retval.sum = json["sum"]; |
| @@ -298,6 +315,7 @@ class Top { | ||
| 298 | 315 | Top Top_from_JSON(mixed json) { |
| 299 | 316 | Top retval = Top(); |
| 300 | 317 | |
| 318 | + if (!intp(json["count"])) error("Expected integer"); | |
| 301 | 319 | retval.count = json["count"]; |
| 302 | 320 | 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
| @@ -49,7 +49,9 @@ class Response { | ||
| 49 | 49 | Response Response_from_JSON(mixed json) { |
| 50 | 50 | Response retval = Response(); |
| 51 | 51 | |
| 52 | + if (!intp(json["player_count"])) error("Expected integer"); | |
| 52 | 53 | retval.player_count = json["player_count"]; |
| 54 | + if (!intp(json["result"])) error("Expected integer"); | |
| 53 | 55 | retval.result = json["result"]; |
| 54 | 56 | |
| 55 | 57 | return retval; |
Test case
1 generated file · +21 −0test/inputs/json/misc/fcca3.json
Mpikedefault / TopLevel.pmod+21 −0
| @@ -149,12 +149,15 @@ View View_from_JSON(mixed json) { | ||
| 149 | 149 | View retval = View(); |
| 150 | 150 | |
| 151 | 151 | retval.attribution = json["attribution"]; |
| 152 | + if (!intp(json["averageRating"])) error("Expected integer"); | |
| 152 | 153 | retval.average_rating = json["averageRating"]; |
| 153 | 154 | retval.category = json["category"]; |
| 154 | 155 | retval.columns = json["columns"]; |
| 156 | + if (!intp(json["createdAt"])) error("Expected integer"); | |
| 155 | 157 | retval.created_at = json["createdAt"]; |
| 156 | 158 | retval.description = json["description"]; |
| 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,30 +166,40 @@ 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 | retval.locale = json["locale"]; |
| 168 | 172 | retval.metadata = json["metadata"]; |
| 169 | 173 | retval.name = json["name"]; |
| 170 | 174 | if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool"); |
| 171 | 175 | retval.new_backend = json["newBackend"]; |
| 176 | + if (!intp(json["numberOfComments"])) error("Expected integer"); | |
| 172 | 177 | retval.number_of_comments = json["numberOfComments"]; |
| 178 | + if (!intp(json["oid"])) error("Expected integer"); | |
| 173 | 179 | retval.oid = json["oid"]; |
| 174 | 180 | retval.owner = json["owner"]; |
| 175 | 181 | retval.provenance = json["provenance"]; |
| 176 | 182 | if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool"); |
| 177 | 183 | retval.publication_append_enabled = json["publicationAppendEnabled"]; |
| 184 | + if (!intp(json["publicationDate"])) error("Expected integer"); | |
| 178 | 185 | retval.publication_date = json["publicationDate"]; |
| 186 | + if (!intp(json["publicationGroup"])) error("Expected integer"); | |
| 179 | 187 | retval.publication_group = json["publicationGroup"]; |
| 180 | 188 | retval.publication_stage = json["publicationStage"]; |
| 181 | 189 | retval.query = json["query"]; |
| 182 | 190 | retval.rights = json["rights"]; |
| 191 | + if (!intp(json["rowsUpdatedAt"])) error("Expected integer"); | |
| 183 | 192 | retval.rows_updated_at = json["rowsUpdatedAt"]; |
| 184 | 193 | retval.rows_updated_by = json["rowsUpdatedBy"]; |
| 185 | 194 | retval.table_author = json["tableAuthor"]; |
| 195 | + if (!intp(json["tableId"])) error("Expected integer"); | |
| 186 | 196 | retval.table_id = json["tableId"]; |
| 187 | 197 | retval.tags = json["tags"]; |
| 198 | + if (!intp(json["totalTimesRated"])) error("Expected integer"); | |
| 188 | 199 | retval.total_times_rated = json["totalTimesRated"]; |
| 200 | + if (!intp(json["viewCount"])) error("Expected integer"); | |
| 189 | 201 | retval.view_count = json["viewCount"]; |
| 202 | + if (!intp(json["viewLastModified"])) error("Expected integer"); | |
| 190 | 203 | retval.view_last_modified = json["viewLastModified"]; |
| 191 | 204 | retval.view_type = json["viewType"]; |
| 192 | 205 | |
| @@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) { | ||
| 236 | 249 | retval.field_name = json["fieldName"]; |
| 237 | 250 | retval.flags = json["flags"]; |
| 238 | 251 | retval.format = json["format"]; |
| 252 | + if (!intp(json["id"])) error("Expected integer"); | |
| 239 | 253 | retval.id = json["id"]; |
| 240 | 254 | retval.name = json["name"]; |
| 255 | + if (!intp(json["position"])) error("Expected integer"); | |
| 241 | 256 | retval.position = json["position"]; |
| 242 | 257 | retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]); |
| 243 | 258 | retval.table_column_id = json["tableColumnId"]; |
| @@ -275,7 +290,9 @@ CachedContents CachedContents_from_JSON(mixed json) { | ||
| 275 | 290 | |
| 276 | 291 | retval.average = json["average"]; |
| 277 | 292 | retval.largest = json["largest"]; |
| 293 | + if (!intp(json["non_null"])) error("Expected integer"); | |
| 278 | 294 | retval.non_null = json["non_null"]; |
| 295 | + if (!intp(json["null"])) error("Expected integer"); | |
| 279 | 296 | retval.null = json["null"]; |
| 280 | 297 | retval.smallest = json["smallest"]; |
| 281 | 298 | retval.sum = json["sum"]; |
| @@ -301,6 +318,7 @@ class Top { | ||
| 301 | 318 | Top Top_from_JSON(mixed json) { |
| 302 | 319 | Top retval = Top(); |
| 303 | 320 | |
| 321 | + if (!intp(json["count"])) error("Expected integer"); | |
| 304 | 322 | retval.count = json["count"]; |
| 305 | 323 | retval.item = json["item"]; |
| 306 | 324 | |
| @@ -669,6 +687,7 @@ class TableColumnId { | ||
| 669 | 687 | TableColumnId TableColumnId_from_JSON(mixed json) { |
| 670 | 688 | TableColumnId retval = TableColumnId(); |
| 671 | 689 | |
| 690 | + if (!intp(json["703610"])) error("Expected integer"); | |
| 672 | 691 | retval.the_703610 = json["703610"]; |
| 673 | 692 | |
| 674 | 693 | return retval; |
| @@ -693,6 +712,7 @@ FilterConditionMetadata FilterConditionMetadata_from_JSON(mixed json) { | ||
| 693 | 712 | |
| 694 | 713 | if (json["advanced"] != Standards.JSON.true && json["advanced"] != Standards.JSON.false) error("Expected bool"); |
| 695 | 714 | retval.advanced = json["advanced"]; |
| 715 | + if (!intp(json["unifiedVersion"])) error("Expected integer"); | |
| 696 | 716 | retval.unified_version = json["unifiedVersion"]; |
| 697 | 717 | |
| 698 | 718 | return retval; |
| @@ -885,6 +905,7 @@ class Expression { | ||
| 885 | 905 | Expression Expression_from_JSON(mixed json) { |
| 886 | 906 | Expression retval = Expression(); |
| 887 | 907 | |
| 908 | + if (!intp(json["columnId"])) error("Expected integer"); | |
| 888 | 909 | retval.column_id = json["columnId"]; |
| 889 | 910 | retval.type = json["type"]; |
Test case
1 generated file · +1 −0test/inputs/json/misc/fd329.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) { | ||
| 80 | 80 | Description retval = Description(); |
| 81 | 81 | |
| 82 | 82 | retval.base_period = json["base_period"]; |
| 83 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 83 | 84 | retval.missing = json["missing"]; |
| 84 | 85 | retval.title = json["title"]; |
| 85 | 86 | retval.units = json["units"]; |
Test case
1 generated file · +55 −0test/inputs/json/priority/bug427.json
Mpikedefault / TopLevel.pmod+55 −0
| @@ -40,7 +40,9 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 40 | 40 | retval.children = json["children"]; |
| 41 | 41 | retval.flags = json["flags"]; |
| 42 | 42 | retval.groups = json["groups"]; |
| 43 | + if (!intp(json["id"])) error("Expected integer"); | |
| 43 | 44 | retval.id = json["id"]; |
| 45 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 44 | 46 | retval.kind = json["kind"]; |
| 45 | 47 | retval.name = json["name"]; |
| 46 | 48 | |
| @@ -84,7 +86,9 @@ TopLevelChild TopLevelChild_from_JSON(mixed json) { | ||
| 84 | 86 | retval.comment = json["comment"]; |
| 85 | 87 | retval.flags = json["flags"]; |
| 86 | 88 | retval.groups = json["groups"]; |
| 89 | + if (!intp(json["id"])) error("Expected integer"); | |
| 87 | 90 | retval.id = json["id"]; |
| 91 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 88 | 92 | retval.kind = json["kind"]; |
| 89 | 93 | retval.kind_string = TentacledKindString_from_JSON(json["kindString"]); |
| 90 | 94 | retval.name = json["name"]; |
| @@ -148,9 +152,11 @@ PurpleChild PurpleChild_from_JSON(mixed json) { | ||
| 148 | 152 | retval.extended_types = json["extendedTypes"]; |
| 149 | 153 | retval.flags = json["flags"]; |
| 150 | 154 | retval.groups = json["groups"]; |
| 155 | + if (!intp(json["id"])) error("Expected integer"); | |
| 151 | 156 | retval.id = json["id"]; |
| 152 | 157 | retval.implemented_by = json["implementedBy"]; |
| 153 | 158 | retval.implemented_types = json["implementedTypes"]; |
| 159 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 154 | 160 | retval.kind = json["kind"]; |
| 155 | 161 | retval.kind_string = FluffyKindString_from_JSON(json["kindString"]); |
| 156 | 162 | retval.name = json["name"]; |
| @@ -215,9 +221,11 @@ FluffyChild FluffyChild_from_JSON(mixed json) { | ||
| 215 | 221 | retval.flags = json["flags"]; |
| 216 | 222 | retval.get_signature = json["getSignature"]; |
| 217 | 223 | retval.groups = json["groups"]; |
| 224 | + if (!intp(json["id"])) error("Expected integer"); | |
| 218 | 225 | retval.id = json["id"]; |
| 219 | 226 | retval.implementation_of = json["implementationOf"]; |
| 220 | 227 | retval.inherited_from = json["inheritedFrom"]; |
| 228 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 221 | 229 | retval.kind = json["kind"]; |
| 222 | 230 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 223 | 231 | retval.name = json["name"]; |
| @@ -266,7 +274,9 @@ TentacledChild TentacledChild_from_JSON(mixed json) { | ||
| 266 | 274 | retval.comment = json["comment"]; |
| 267 | 275 | retval.default_value = json["defaultValue"]; |
| 268 | 276 | retval.flags = json["flags"]; |
| 277 | + if (!intp(json["id"])) error("Expected integer"); | |
| 269 | 278 | retval.id = json["id"]; |
| 279 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 270 | 280 | retval.kind = json["kind"]; |
| 271 | 281 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 272 | 282 | retval.name = json["name"]; |
| @@ -364,7 +374,9 @@ PurpleSignature PurpleSignature_from_JSON(mixed json) { | ||
| 364 | 374 | |
| 365 | 375 | retval.comment = json["comment"]; |
| 366 | 376 | retval.flags = json["flags"]; |
| 377 | + if (!intp(json["id"])) error("Expected integer"); | |
| 367 | 378 | retval.id = json["id"]; |
| 379 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 368 | 380 | retval.kind = json["kind"]; |
| 369 | 381 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 370 | 382 | retval.name = json["name"]; |
| @@ -456,7 +468,9 @@ IndexSignatureElement IndexSignatureElement_from_JSON(mixed json) { | ||
| 456 | 468 | IndexSignatureElement retval = IndexSignatureElement(); |
| 457 | 469 | |
| 458 | 470 | retval.flags = json["flags"]; |
| 471 | + if (!intp(json["id"])) error("Expected integer"); | |
| 459 | 472 | retval.id = json["id"]; |
| 473 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 460 | 474 | retval.kind = json["kind"]; |
| 461 | 475 | retval.kind_string = json["kindString"]; |
| 462 | 476 | retval.name = json["name"]; |
| @@ -523,7 +537,9 @@ GetSignatureChild GetSignatureChild_from_JSON(mixed json) { | ||
| 523 | 537 | |
| 524 | 538 | retval.comment = json["comment"]; |
| 525 | 539 | retval.flags = json["flags"]; |
| 540 | + if (!intp(json["id"])) error("Expected integer"); | |
| 526 | 541 | retval.id = json["id"]; |
| 542 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 527 | 543 | retval.kind = json["kind"]; |
| 528 | 544 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 529 | 545 | retval.name = json["name"]; |
| @@ -579,7 +595,9 @@ GetSignature GetSignature_from_JSON(mixed json) { | ||
| 579 | 595 | retval.default_value = json["defaultValue"]; |
| 580 | 596 | retval.flags = json["flags"]; |
| 581 | 597 | retval.groups = json["groups"]; |
| 598 | + if (!intp(json["id"])) error("Expected integer"); | |
| 582 | 599 | retval.id = json["id"]; |
| 600 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 583 | 601 | retval.kind = json["kind"]; |
| 584 | 602 | retval.kind_string = json["kindString"]; |
| 585 | 603 | retval.name = json["name"]; |
| @@ -705,8 +723,10 @@ class Source { | ||
| 705 | 723 | Source Source_from_JSON(mixed json) { |
| 706 | 724 | Source retval = Source(); |
| 707 | 725 | |
| 726 | + if (!intp(json["character"])) error("Expected integer"); | |
| 708 | 727 | retval.character = json["character"]; |
| 709 | 728 | retval.file_name = FileName_from_JSON(json["fileName"]); |
| 729 | + if (!intp(json["line"])) error("Expected integer"); | |
| 710 | 730 | retval.line = json["line"]; |
| 711 | 731 | |
| 712 | 732 | return retval; |
| @@ -778,6 +798,7 @@ Group Group_from_JSON(mixed json) { | ||
| 778 | 798 | Group retval = Group(); |
| 779 | 799 | |
| 780 | 800 | retval.children = json["children"]; |
| 801 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 781 | 802 | retval.kind = json["kind"]; |
| 782 | 803 | retval.title = json["title"]; |
| 783 | 804 | |
| @@ -813,7 +834,9 @@ GetSignatureParameter GetSignatureParameter_from_JSON(mixed json) { | ||
| 813 | 834 | |
| 814 | 835 | retval.comment = json["comment"]; |
| 815 | 836 | retval.flags = json["flags"]; |
| 837 | + if (!intp(json["id"])) error("Expected integer"); | |
| 816 | 838 | retval.id = json["id"]; |
| 839 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 817 | 840 | retval.kind = json["kind"]; |
| 818 | 841 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 819 | 842 | retval.name = json["name"]; |
| @@ -961,7 +984,9 @@ PurpleDeclaration PurpleDeclaration_from_JSON(mixed json) { | ||
| 961 | 984 | retval.children = json["children"]; |
| 962 | 985 | retval.flags = json["flags"]; |
| 963 | 986 | retval.groups = json["groups"]; |
| 987 | + if (!intp(json["id"])) error("Expected integer"); | |
| 964 | 988 | retval.id = json["id"]; |
| 989 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 965 | 990 | retval.kind = json["kind"]; |
| 966 | 991 | retval.kind_string = json["kindString"]; |
| 967 | 992 | retval.name = json["name"]; |
| @@ -1162,9 +1187,11 @@ FluffySignature FluffySignature_from_JSON(mixed json) { | ||
| 1162 | 1187 | |
| 1163 | 1188 | retval.comment = json["comment"]; |
| 1164 | 1189 | retval.flags = json["flags"]; |
| 1190 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1165 | 1191 | retval.id = json["id"]; |
| 1166 | 1192 | retval.implementation_of = json["implementationOf"]; |
| 1167 | 1193 | retval.inherited_from = json["inheritedFrom"]; |
| 1194 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1168 | 1195 | retval.kind = json["kind"]; |
| 1169 | 1196 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1170 | 1197 | retval.name = json["name"]; |
| @@ -1228,7 +1255,9 @@ PurpleParameter PurpleParameter_from_JSON(mixed json) { | ||
| 1228 | 1255 | |
| 1229 | 1256 | retval.comment = json["comment"]; |
| 1230 | 1257 | retval.flags = json["flags"]; |
| 1258 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1231 | 1259 | retval.id = json["id"]; |
| 1260 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1232 | 1261 | retval.kind = json["kind"]; |
| 1233 | 1262 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 1234 | 1263 | retval.name = json["name"]; |
| @@ -1358,8 +1387,10 @@ FluffyDeclaration FluffyDeclaration_from_JSON(mixed json) { | ||
| 1358 | 1387 | retval.children = json["children"]; |
| 1359 | 1388 | retval.flags = json["flags"]; |
| 1360 | 1389 | retval.groups = json["groups"]; |
| 1390 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1361 | 1391 | retval.id = json["id"]; |
| 1362 | 1392 | retval.index_signature = json["indexSignature"]; |
| 1393 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1363 | 1394 | retval.kind = json["kind"]; |
| 1364 | 1395 | retval.kind_string = json["kindString"]; |
| 1365 | 1396 | retval.name = json["name"]; |
| @@ -1400,7 +1431,9 @@ StickyChild StickyChild_from_JSON(mixed json) { | ||
| 1400 | 1431 | |
| 1401 | 1432 | retval.comment = json["comment"]; |
| 1402 | 1433 | retval.flags = json["flags"]; |
| 1434 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1403 | 1435 | retval.id = json["id"]; |
| 1436 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1404 | 1437 | retval.kind = json["kind"]; |
| 1405 | 1438 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 1406 | 1439 | retval.name = json["name"]; |
| @@ -1467,7 +1500,9 @@ IndexSignature IndexSignature_from_JSON(mixed json) { | ||
| 1467 | 1500 | IndexSignature retval = IndexSignature(); |
| 1468 | 1501 | |
| 1469 | 1502 | retval.flags = json["flags"]; |
| 1503 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1470 | 1504 | retval.id = json["id"]; |
| 1505 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1471 | 1506 | retval.kind = json["kind"]; |
| 1472 | 1507 | retval.kind_string = json["kindString"]; |
| 1473 | 1508 | retval.name = json["name"]; |
| @@ -1531,7 +1566,9 @@ TentacledSignature TentacledSignature_from_JSON(mixed json) { | ||
| 1531 | 1566 | |
| 1532 | 1567 | retval.comment = json["comment"]; |
| 1533 | 1568 | retval.flags = json["flags"]; |
| 1569 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1534 | 1570 | retval.id = json["id"]; |
| 1571 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1535 | 1572 | retval.kind = json["kind"]; |
| 1536 | 1573 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1537 | 1574 | retval.name = json["name"]; |
| @@ -1595,7 +1632,9 @@ FluffyParameter FluffyParameter_from_JSON(mixed json) { | ||
| 1595 | 1632 | |
| 1596 | 1633 | retval.comment = json["comment"]; |
| 1597 | 1634 | retval.flags = json["flags"]; |
| 1635 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1598 | 1636 | retval.id = json["id"]; |
| 1637 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1599 | 1638 | retval.kind = json["kind"]; |
| 1600 | 1639 | retval.kind_string = json["kindString"]; |
| 1601 | 1640 | retval.name = json["name"]; |
| @@ -1717,7 +1756,9 @@ StickySignature StickySignature_from_JSON(mixed json) { | ||
| 1717 | 1756 | |
| 1718 | 1757 | retval.comment = json["comment"]; |
| 1719 | 1758 | retval.flags = json["flags"]; |
| 1759 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1720 | 1760 | retval.id = json["id"]; |
| 1761 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1721 | 1762 | retval.kind = json["kind"]; |
| 1722 | 1763 | retval.kind_string = SignatureKindString_from_JSON(json["kindString"]); |
| 1723 | 1764 | retval.name = json["name"]; |
| @@ -1762,7 +1803,9 @@ TentacledParameter TentacledParameter_from_JSON(mixed json) { | ||
| 1762 | 1803 | retval.comment = json["comment"]; |
| 1763 | 1804 | retval.default_value = json["defaultValue"]; |
| 1764 | 1805 | retval.flags = json["flags"]; |
| 1806 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1765 | 1807 | retval.id = json["id"]; |
| 1808 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1766 | 1809 | retval.kind = json["kind"]; |
| 1767 | 1810 | retval.kind_string = ParameterKindString_from_JSON(json["kindString"]); |
| 1768 | 1811 | retval.name = json["name"]; |
| @@ -1843,8 +1886,10 @@ TentacledDeclaration TentacledDeclaration_from_JSON(mixed json) { | ||
| 1843 | 1886 | retval.children = json["children"]; |
| 1844 | 1887 | retval.flags = json["flags"]; |
| 1845 | 1888 | retval.groups = json["groups"]; |
| 1889 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1846 | 1890 | retval.id = json["id"]; |
| 1847 | 1891 | retval.index_signature = json["indexSignature"]; |
| 1892 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1848 | 1893 | retval.kind = json["kind"]; |
| 1849 | 1894 | retval.kind_string = json["kindString"]; |
| 1850 | 1895 | retval.name = json["name"]; |
| @@ -1888,7 +1933,9 @@ IndigoChild IndigoChild_from_JSON(mixed json) { | ||
| 1888 | 1933 | retval.comment = json["comment"]; |
| 1889 | 1934 | retval.default_value = json["defaultValue"]; |
| 1890 | 1935 | retval.flags = json["flags"]; |
| 1936 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1891 | 1937 | retval.id = json["id"]; |
| 1938 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 1892 | 1939 | retval.kind = json["kind"]; |
| 1893 | 1940 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 1894 | 1941 | retval.name = json["name"]; |
| @@ -2008,7 +2055,9 @@ StickyDeclaration StickyDeclaration_from_JSON(mixed json) { | ||
| 2008 | 2055 | retval.children = json["children"]; |
| 2009 | 2056 | retval.flags = json["flags"]; |
| 2010 | 2057 | retval.groups = json["groups"]; |
| 2058 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2011 | 2059 | retval.id = json["id"]; |
| 2060 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2012 | 2061 | retval.kind = json["kind"]; |
| 2013 | 2062 | retval.kind_string = json["kindString"]; |
| 2014 | 2063 | retval.name = json["name"]; |
| @@ -2046,7 +2095,9 @@ IndecentChild IndecentChild_from_JSON(mixed json) { | ||
| 2046 | 2095 | IndecentChild retval = IndecentChild(); |
| 2047 | 2096 | |
| 2048 | 2097 | retval.flags = json["flags"]; |
| 2098 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2049 | 2099 | retval.id = json["id"]; |
| 2100 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2050 | 2101 | retval.kind = json["kind"]; |
| 2051 | 2102 | retval.kind_string = PurpleKindString_from_JSON(json["kindString"]); |
| 2052 | 2103 | retval.name = json["name"]; |
| @@ -2116,7 +2167,9 @@ IndigoDeclaration IndigoDeclaration_from_JSON(mixed json) { | ||
| 2116 | 2167 | retval.children = json["children"]; |
| 2117 | 2168 | retval.flags = json["flags"]; |
| 2118 | 2169 | retval.groups = json["groups"]; |
| 2170 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2119 | 2171 | retval.id = json["id"]; |
| 2172 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2120 | 2173 | retval.kind = json["kind"]; |
| 2121 | 2174 | retval.kind_string = json["kindString"]; |
| 2122 | 2175 | retval.name = json["name"]; |
| @@ -2178,7 +2231,9 @@ TypeParameter TypeParameter_from_JSON(mixed json) { | ||
| 2178 | 2231 | |
| 2179 | 2232 | retval.comment = json["comment"]; |
| 2180 | 2233 | retval.flags = json["flags"]; |
| 2234 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2181 | 2235 | retval.id = json["id"]; |
| 2236 | + if (!intp(json["kind"])) error("Expected integer"); | |
| 2182 | 2237 | retval.kind = json["kind"]; |
| 2183 | 2238 | retval.kind_string = json["kindString"]; |
| 2184 | 2239 | 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"]; |
| @@ -369,6 +370,7 @@ CimeliaClass CimeliaClass_from_JSON(mixed json) { | ||
| 369 | 370 | CimeliaClass retval = CimeliaClass(); |
| 370 | 371 | |
| 371 | 372 | retval.catharticalness = (float)json["catharticalness"]; |
| 373 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 372 | 374 | retval.chirotherium = json["Chirotherium"]; |
| 373 | 375 | retval.disdiapason = json["disdiapason"]; |
| 374 | 376 | if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool"); |
| @@ -1302,6 +1304,7 @@ Interacinar Interacinar_from_JSON(mixed json) { | ||
| 1302 | 1304 | if (json["benefactorship"] != Standards.JSON.true && json["benefactorship"] != Standards.JSON.false) error("Expected bool"); |
| 1303 | 1305 | retval.benefactorship = json["benefactorship"]; |
| 1304 | 1306 | retval.triseriatim = json["triseriatim"]; |
| 1307 | + if (!intp(json["tubbing"])) error("Expected integer"); | |
| 1305 | 1308 | retval.tubbing = json["tubbing"]; |
| 1306 | 1309 | 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
| @@ -387,6 +387,7 @@ QuebrachineClass QuebrachineClass_from_JSON(mixed json) { | ||
| 387 | 387 | QuebrachineClass retval = QuebrachineClass(); |
| 388 | 388 | |
| 389 | 389 | retval.catharticalness = (float)json["catharticalness"]; |
| 390 | + if (!intp(json["Chirotherium"])) error("Expected integer"); | |
| 390 | 391 | retval.chirotherium = json["Chirotherium"]; |
| 391 | 392 | retval.disdiapason = json["disdiapason"]; |
| 392 | 393 | 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
| @@ -38,6 +38,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 38 | 38 | retval.also = json["also"]; |
| 39 | 39 | if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool"); |
| 40 | 40 | retval.bar = json["bar"]; |
| 41 | + if (!intp(json["foo"])) error("Expected integer"); | |
| 41 | 42 | retval.foo = json["foo"]; |
| 42 | 43 | retval.moo = (float)json["moo"]; |
| 43 | 44 | retval.quux = json["quux"]; |
Test case
1 generated file · +8 −0test/inputs/json/priority/identifiers.json
Mpikedefault / TopLevel.pmod+8 −0
| @@ -41,6 +41,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 41 | 41 | retval.empty = json[""]; |
| 42 | 42 | retval.foo = json["foo"]; |
| 43 | 43 | retval.this_is_a_tough_one = json["ThisIsA\U0001f61cTough\"\n\nOne"]; |
| 44 | + if (!intp(json["!"])) error("Expected integer"); | |
| 44 | 45 | retval.top_level = json["!"]; |
| 45 | 46 | retval.top_level_empty = json["Empty"]; |
| 46 | 47 | |
| @@ -62,6 +63,7 @@ class TopLevelBla { | ||
| 62 | 63 | TopLevelBla TopLevelBla_from_JSON(mixed json) { |
| 63 | 64 | TopLevelBla retval = TopLevelBla(); |
| 64 | 65 | |
| 66 | + if (!intp(json["bar"])) error("Expected integer"); | |
| 65 | 67 | retval.bar = json["bar"]; |
| 66 | 68 | |
| 67 | 69 | return retval; |
| @@ -82,6 +84,7 @@ class Empty { | ||
| 82 | 84 | Empty Empty_from_JSON(mixed json) { |
| 83 | 85 | Empty retval = Empty(); |
| 84 | 86 | |
| 87 | + if (!intp(json["x"])) error("Expected integer"); | |
| 85 | 88 | retval.x = json["x"]; |
| 86 | 89 | |
| 87 | 90 | return retval; |
| @@ -107,7 +110,9 @@ Foo Foo_from_JSON(mixed json) { | ||
| 107 | 110 | Foo retval = Foo(); |
| 108 | 111 | |
| 109 | 112 | retval.bla = json["bla"]; |
| 113 | + if (!intp(json["_"])) error("Expected integer"); | |
| 110 | 114 | retval.empty = json["_"]; |
| 115 | + if (!intp(json["__"])) error("Expected integer"); | |
| 111 | 116 | retval.foo = json["__"]; |
| 112 | 117 | |
| 113 | 118 | return retval; |
| @@ -146,7 +151,9 @@ class ThisIsAToughOne { | ||
| 146 | 151 | ThisIsAToughOne ThisIsAToughOne_from_JSON(mixed json) { |
| 147 | 152 | ThisIsAToughOne retval = ThisIsAToughOne(); |
| 148 | 153 | |
| 154 | + if (!intp(json["\n\n\n"])) error("Expected integer"); | |
| 149 | 155 | retval.empty = json["\n\n\n"]; |
| 156 | + if (!intp(json["\""])) error("Expected integer"); | |
| 150 | 157 | retval.this_is_a_tough_one = json["\""]; |
| 151 | 158 | |
| 152 | 159 | return retval; |
| @@ -167,6 +174,7 @@ class EmptyClass { | ||
| 167 | 174 | EmptyClass EmptyClass_from_JSON(mixed json) { |
| 168 | 175 | EmptyClass retval = EmptyClass(); |
| 169 | 176 | |
| 177 | + if (!intp(json["y"])) error("Expected integer"); | |
| 170 | 178 | retval.y = json["y"]; |
| 171 | 179 | |
| 172 | 180 | 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 | retval.obj1 = json["obj1"]; |
| 42 | 43 | retval.obj2 = json["obj2"]; |
| @@ -243,6 +244,7 @@ Obj1 Obj1_from_JSON(mixed json) { | ||
| 243 | 244 | retval.declare = json["declare"]; |
| 244 | 245 | retval.decltype = json["decltype"]; |
| 245 | 246 | retval.decode_string = json["decode_string"]; |
| 247 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 246 | 248 | retval.dummy = json["dummy"]; |
| 247 | 249 | retval.empty = json["_"]; |
| 248 | 250 | retval.imaginery = json["_Imaginery"]; |
| @@ -277,6 +279,7 @@ class Abstract { | ||
| 277 | 279 | Abstract Abstract_from_JSON(mixed json) { |
| 278 | 280 | Abstract retval = Abstract(); |
| 279 | 281 | |
| 282 | + if (!intp(json["abstract"])) error("Expected integer"); | |
| 280 | 283 | retval.abstract = json["abstract"]; |
| 281 | 284 | |
| 282 | 285 | return retval; |
| @@ -297,6 +300,7 @@ class Alignas { | ||
| 297 | 300 | Alignas Alignas_from_JSON(mixed json) { |
| 298 | 301 | Alignas retval = Alignas(); |
| 299 | 302 | |
| 303 | + if (!intp(json["alignas"])) error("Expected integer"); | |
| 300 | 304 | retval.alignas = json["alignas"]; |
| 301 | 305 | |
| 302 | 306 | return retval; |
| @@ -317,6 +321,7 @@ class Alignof { | ||
| 317 | 321 | Alignof Alignof_from_JSON(mixed json) { |
| 318 | 322 | Alignof retval = Alignof(); |
| 319 | 323 | |
| 324 | + if (!intp(json["alignof"])) error("Expected integer"); | |
| 320 | 325 | retval.alignof = json["alignof"]; |
| 321 | 326 | |
| 322 | 327 | return retval; |
| @@ -337,6 +342,7 @@ class And { | ||
| 337 | 342 | And And_from_JSON(mixed json) { |
| 338 | 343 | And retval = And(); |
| 339 | 344 | |
| 345 | + if (!intp(json["and"])) error("Expected integer"); | |
| 340 | 346 | retval.and = json["and"]; |
| 341 | 347 | |
| 342 | 348 | return retval; |
| @@ -357,6 +363,7 @@ class AndEq { | ||
| 357 | 363 | AndEq AndEq_from_JSON(mixed json) { |
| 358 | 364 | AndEq retval = AndEq(); |
| 359 | 365 | |
| 366 | + if (!intp(json["and_eq"])) error("Expected integer"); | |
| 360 | 367 | retval.and_eq = json["and_eq"]; |
| 361 | 368 | |
| 362 | 369 | return retval; |
| @@ -377,6 +384,7 @@ class Any { | ||
| 377 | 384 | Any Any_from_JSON(mixed json) { |
| 378 | 385 | Any retval = Any(); |
| 379 | 386 | |
| 387 | + if (!intp(json["Any"])) error("Expected integer"); | |
| 380 | 388 | retval.any = json["Any"]; |
| 381 | 389 | |
| 382 | 390 | return retval; |
| @@ -397,6 +405,7 @@ class As { | ||
| 397 | 405 | As As_from_JSON(mixed json) { |
| 398 | 406 | As retval = As(); |
| 399 | 407 | |
| 408 | + if (!intp(json["as"])) error("Expected integer"); | |
| 400 | 409 | retval.as = json["as"]; |
| 401 | 410 | |
| 402 | 411 | return retval; |
| @@ -417,6 +426,7 @@ class Asm { | ||
| 417 | 426 | Asm Asm_from_JSON(mixed json) { |
| 418 | 427 | Asm retval = Asm(); |
| 419 | 428 | |
| 429 | + if (!intp(json["asm"])) error("Expected integer"); | |
| 420 | 430 | retval.asm = json["asm"]; |
| 421 | 431 | |
| 422 | 432 | return retval; |
| @@ -437,6 +447,7 @@ class Assert { | ||
| 437 | 447 | Assert Assert_from_JSON(mixed json) { |
| 438 | 448 | Assert retval = Assert(); |
| 439 | 449 | |
| 450 | + if (!intp(json["assert"])) error("Expected integer"); | |
| 440 | 451 | retval.assert = json["assert"]; |
| 441 | 452 | |
| 442 | 453 | return retval; |
| @@ -457,6 +468,7 @@ class Associatedtype { | ||
| 457 | 468 | Associatedtype Associatedtype_from_JSON(mixed json) { |
| 458 | 469 | Associatedtype retval = Associatedtype(); |
| 459 | 470 | |
| 471 | + if (!intp(json["associatedtype"])) error("Expected integer"); | |
| 460 | 472 | retval.associatedtype = json["associatedtype"]; |
| 461 | 473 | |
| 462 | 474 | return retval; |
| @@ -477,6 +489,7 @@ class Associativity { | ||
| 477 | 489 | Associativity Associativity_from_JSON(mixed json) { |
| 478 | 490 | Associativity retval = Associativity(); |
| 479 | 491 | |
| 492 | + if (!intp(json["associativity"])) error("Expected integer"); | |
| 480 | 493 | retval.associativity = json["associativity"]; |
| 481 | 494 | |
| 482 | 495 | return retval; |
| @@ -497,6 +510,7 @@ class Async { | ||
| 497 | 510 | Async Async_from_JSON(mixed json) { |
| 498 | 511 | Async retval = Async(); |
| 499 | 512 | |
| 513 | + if (!intp(json["async"])) error("Expected integer"); | |
| 500 | 514 | retval.async = json["async"]; |
| 501 | 515 | |
| 502 | 516 | return retval; |
| @@ -517,6 +531,7 @@ class Atomic { | ||
| 517 | 531 | Atomic Atomic_from_JSON(mixed json) { |
| 518 | 532 | Atomic retval = Atomic(); |
| 519 | 533 | |
| 534 | + if (!intp(json["atomic"])) error("Expected integer"); | |
| 520 | 535 | retval.atomic = json["atomic"]; |
| 521 | 536 | |
| 522 | 537 | return retval; |
| @@ -537,6 +552,7 @@ class AtomicCancel { | ||
| 537 | 552 | AtomicCancel AtomicCancel_from_JSON(mixed json) { |
| 538 | 553 | AtomicCancel retval = AtomicCancel(); |
| 539 | 554 | |
| 555 | + if (!intp(json["atomic_cancel"])) error("Expected integer"); | |
| 540 | 556 | retval.atomic_cancel = json["atomic_cancel"]; |
| 541 | 557 | |
| 542 | 558 | return retval; |
| @@ -557,6 +573,7 @@ class AtomicCommit { | ||
| 557 | 573 | AtomicCommit AtomicCommit_from_JSON(mixed json) { |
| 558 | 574 | AtomicCommit retval = AtomicCommit(); |
| 559 | 575 | |
| 576 | + if (!intp(json["atomic_commit"])) error("Expected integer"); | |
| 560 | 577 | retval.atomic_commit = json["atomic_commit"]; |
| 561 | 578 | |
| 562 | 579 | return retval; |
| @@ -577,6 +594,7 @@ class AtomicNoexcept { | ||
| 577 | 594 | AtomicNoexcept AtomicNoexcept_from_JSON(mixed json) { |
| 578 | 595 | AtomicNoexcept retval = AtomicNoexcept(); |
| 579 | 596 | |
| 597 | + if (!intp(json["atomic_noexcept"])) error("Expected integer"); | |
| 580 | 598 | retval.atomic_noexcept = json["atomic_noexcept"]; |
| 581 | 599 | |
| 582 | 600 | return retval; |
| @@ -597,6 +615,7 @@ class Await { | ||
| 597 | 615 | Await Await_from_JSON(mixed json) { |
| 598 | 616 | Await retval = Await(); |
| 599 | 617 | |
| 618 | + if (!intp(json["await"])) error("Expected integer"); | |
| 600 | 619 | retval.await = json["await"]; |
| 601 | 620 | |
| 602 | 621 | return retval; |
| @@ -617,6 +636,7 @@ class Base { | ||
| 617 | 636 | Base Base_from_JSON(mixed json) { |
| 618 | 637 | Base retval = Base(); |
| 619 | 638 | |
| 639 | + if (!intp(json["base"])) error("Expected integer"); | |
| 620 | 640 | retval.base = json["base"]; |
| 621 | 641 | |
| 622 | 642 | return retval; |
| @@ -637,6 +657,7 @@ class Bitand { | ||
| 637 | 657 | Bitand Bitand_from_JSON(mixed json) { |
| 638 | 658 | Bitand retval = Bitand(); |
| 639 | 659 | |
| 660 | + if (!intp(json["bitand"])) error("Expected integer"); | |
| 640 | 661 | retval.bitand = json["bitand"]; |
| 641 | 662 | |
| 642 | 663 | return retval; |
| @@ -657,6 +678,7 @@ class Bitor { | ||
| 657 | 678 | Bitor Bitor_from_JSON(mixed json) { |
| 658 | 679 | Bitor retval = Bitor(); |
| 659 | 680 | |
| 681 | + if (!intp(json["bitor"])) error("Expected integer"); | |
| 660 | 682 | retval.bitor = json["bitor"]; |
| 661 | 683 | |
| 662 | 684 | return retval; |
| @@ -677,6 +699,7 @@ class Bool { | ||
| 677 | 699 | Bool Bool_from_JSON(mixed json) { |
| 678 | 700 | Bool retval = Bool(); |
| 679 | 701 | |
| 702 | + if (!intp(json["BOOL"])) error("Expected integer"); | |
| 680 | 703 | retval.bool = json["BOOL"]; |
| 681 | 704 | |
| 682 | 705 | return retval; |
| @@ -697,6 +720,7 @@ class Boolean { | ||
| 697 | 720 | Boolean Boolean_from_JSON(mixed json) { |
| 698 | 721 | Boolean retval = Boolean(); |
| 699 | 722 | |
| 723 | + if (!intp(json["boolean"])) error("Expected integer"); | |
| 700 | 724 | retval.boolean = json["boolean"]; |
| 701 | 725 | |
| 702 | 726 | return retval; |
| @@ -717,6 +741,7 @@ class Bycopy { | ||
| 717 | 741 | Bycopy Bycopy_from_JSON(mixed json) { |
| 718 | 742 | Bycopy retval = Bycopy(); |
| 719 | 743 | |
| 744 | + if (!intp(json["bycopy"])) error("Expected integer"); | |
| 720 | 745 | retval.bycopy = json["bycopy"]; |
| 721 | 746 | |
| 722 | 747 | return retval; |
| @@ -737,6 +762,7 @@ class Byref { | ||
| 737 | 762 | Byref Byref_from_JSON(mixed json) { |
| 738 | 763 | Byref retval = Byref(); |
| 739 | 764 | |
| 765 | + if (!intp(json["byref"])) error("Expected integer"); | |
| 740 | 766 | retval.byref = json["byref"]; |
| 741 | 767 | |
| 742 | 768 | return retval; |
| @@ -757,6 +783,7 @@ class Byte { | ||
| 757 | 783 | Byte Byte_from_JSON(mixed json) { |
| 758 | 784 | Byte retval = Byte(); |
| 759 | 785 | |
| 786 | + if (!intp(json["byte"])) error("Expected integer"); | |
| 760 | 787 | retval.byte = json["byte"]; |
| 761 | 788 | |
| 762 | 789 | return retval; |
| @@ -777,6 +804,7 @@ class Chan { | ||
| 777 | 804 | Chan Chan_from_JSON(mixed json) { |
| 778 | 805 | Chan retval = Chan(); |
| 779 | 806 | |
| 807 | + if (!intp(json["chan"])) error("Expected integer"); | |
| 780 | 808 | retval.chan = json["chan"]; |
| 781 | 809 | |
| 782 | 810 | return retval; |
| @@ -797,6 +825,7 @@ class Char { | ||
| 797 | 825 | Char Char_from_JSON(mixed json) { |
| 798 | 826 | Char retval = Char(); |
| 799 | 827 | |
| 828 | + if (!intp(json["char"])) error("Expected integer"); | |
| 800 | 829 | retval.char = json["char"]; |
| 801 | 830 | |
| 802 | 831 | return retval; |
| @@ -817,6 +846,7 @@ class Char16T { | ||
| 817 | 846 | Char16T Char16T_from_JSON(mixed json) { |
| 818 | 847 | Char16T retval = Char16T(); |
| 819 | 848 | |
| 849 | + if (!intp(json["char16_t"])) error("Expected integer"); | |
| 820 | 850 | retval.char16_t = json["char16_t"]; |
| 821 | 851 | |
| 822 | 852 | return retval; |
| @@ -837,6 +867,7 @@ class Char32T { | ||
| 837 | 867 | Char32T Char32T_from_JSON(mixed json) { |
| 838 | 868 | Char32T retval = Char32T(); |
| 839 | 869 | |
| 870 | + if (!intp(json["char32_t"])) error("Expected integer"); | |
| 840 | 871 | retval.char32_t = json["char32_t"]; |
| 841 | 872 | |
| 842 | 873 | return retval; |
| @@ -857,6 +888,7 @@ class Checked { | ||
| 857 | 888 | Checked Checked_from_JSON(mixed json) { |
| 858 | 889 | Checked retval = Checked(); |
| 859 | 890 | |
| 891 | + if (!intp(json["checked"])) error("Expected integer"); | |
| 860 | 892 | retval.checked = json["checked"]; |
| 861 | 893 | |
| 862 | 894 | return retval; |
| @@ -877,6 +909,7 @@ class Clone { | ||
| 877 | 909 | Clone Clone_from_JSON(mixed json) { |
| 878 | 910 | Clone retval = Clone(); |
| 879 | 911 | |
| 912 | + if (!intp(json["clone"])) error("Expected integer"); | |
| 880 | 913 | retval.clone = json["clone"]; |
| 881 | 914 | |
| 882 | 915 | return retval; |
| @@ -897,6 +930,7 @@ class CoAwait { | ||
| 897 | 930 | CoAwait CoAwait_from_JSON(mixed json) { |
| 898 | 931 | CoAwait retval = CoAwait(); |
| 899 | 932 | |
| 933 | + if (!intp(json["co_await"])) error("Expected integer"); | |
| 900 | 934 | retval.co_await = json["co_await"]; |
| 901 | 935 | |
| 902 | 936 | return retval; |
| @@ -917,6 +951,7 @@ class CoReturn { | ||
| 917 | 951 | CoReturn CoReturn_from_JSON(mixed json) { |
| 918 | 952 | CoReturn retval = CoReturn(); |
| 919 | 953 | |
| 954 | + if (!intp(json["co_return"])) error("Expected integer"); | |
| 920 | 955 | retval.co_return = json["co_return"]; |
| 921 | 956 | |
| 922 | 957 | return retval; |
| @@ -937,6 +972,7 @@ class CoYield { | ||
| 937 | 972 | CoYield CoYield_from_JSON(mixed json) { |
| 938 | 973 | CoYield retval = CoYield(); |
| 939 | 974 | |
| 975 | + if (!intp(json["co_yield"])) error("Expected integer"); | |
| 940 | 976 | retval.co_yield = json["co_yield"]; |
| 941 | 977 | |
| 942 | 978 | return retval; |
| @@ -957,6 +993,7 @@ class Compl { | ||
| 957 | 993 | Compl Compl_from_JSON(mixed json) { |
| 958 | 994 | Compl retval = Compl(); |
| 959 | 995 | |
| 996 | + if (!intp(json["compl"])) error("Expected integer"); | |
| 960 | 997 | retval.compl = json["compl"]; |
| 961 | 998 | |
| 962 | 999 | return retval; |
| @@ -977,6 +1014,7 @@ class Complex { | ||
| 977 | 1014 | Complex Complex_from_JSON(mixed json) { |
| 978 | 1015 | Complex retval = Complex(); |
| 979 | 1016 | |
| 1017 | + if (!intp(json["_Complex"])) error("Expected integer"); | |
| 980 | 1018 | retval.complex = json["_Complex"]; |
| 981 | 1019 | |
| 982 | 1020 | return retval; |
| @@ -997,6 +1035,7 @@ class Concept { | ||
| 997 | 1035 | Concept Concept_from_JSON(mixed json) { |
| 998 | 1036 | Concept retval = Concept(); |
| 999 | 1037 | |
| 1038 | + if (!intp(json["concept"])) error("Expected integer"); | |
| 1000 | 1039 | retval.concept = json["concept"]; |
| 1001 | 1040 | |
| 1002 | 1041 | return retval; |
| @@ -1017,6 +1056,7 @@ class Console { | ||
| 1017 | 1056 | Console Console_from_JSON(mixed json) { |
| 1018 | 1057 | Console retval = Console(); |
| 1019 | 1058 | |
| 1059 | + if (!intp(json["console"])) error("Expected integer"); | |
| 1020 | 1060 | retval.console = json["console"]; |
| 1021 | 1061 | |
| 1022 | 1062 | return retval; |
| @@ -1037,6 +1077,7 @@ class ConstCast { | ||
| 1037 | 1077 | ConstCast ConstCast_from_JSON(mixed json) { |
| 1038 | 1078 | ConstCast retval = ConstCast(); |
| 1039 | 1079 | |
| 1080 | + if (!intp(json["const_cast"])) error("Expected integer"); | |
| 1040 | 1081 | retval.const_cast = json["const_cast"]; |
| 1041 | 1082 | |
| 1042 | 1083 | return retval; |
| @@ -1057,6 +1098,7 @@ class Constexpr { | ||
| 1057 | 1098 | Constexpr Constexpr_from_JSON(mixed json) { |
| 1058 | 1099 | Constexpr retval = Constexpr(); |
| 1059 | 1100 | |
| 1101 | + if (!intp(json["constexpr"])) error("Expected integer"); | |
| 1060 | 1102 | retval.constexpr = json["constexpr"]; |
| 1061 | 1103 | |
| 1062 | 1104 | return retval; |
| @@ -1077,6 +1119,7 @@ class Constructor { | ||
| 1077 | 1119 | Constructor Constructor_from_JSON(mixed json) { |
| 1078 | 1120 | Constructor retval = Constructor(); |
| 1079 | 1121 | |
| 1122 | + if (!intp(json["constructor"])) error("Expected integer"); | |
| 1080 | 1123 | retval.constructor = json["constructor"]; |
| 1081 | 1124 | |
| 1082 | 1125 | return retval; |
| @@ -1097,6 +1140,7 @@ class Convenience { | ||
| 1097 | 1140 | Convenience Convenience_from_JSON(mixed json) { |
| 1098 | 1141 | Convenience retval = Convenience(); |
| 1099 | 1142 | |
| 1143 | + if (!intp(json["convenience"])) error("Expected integer"); | |
| 1100 | 1144 | retval.convenience = json["convenience"]; |
| 1101 | 1145 | |
| 1102 | 1146 | return retval; |
| @@ -1117,6 +1161,7 @@ class Convert { | ||
| 1117 | 1161 | Convert Convert_from_JSON(mixed json) { |
| 1118 | 1162 | Convert retval = Convert(); |
| 1119 | 1163 | |
| 1164 | + if (!intp(json["convert"])) error("Expected integer"); | |
| 1120 | 1165 | retval.convert = json["convert"]; |
| 1121 | 1166 | |
| 1122 | 1167 | return retval; |
| @@ -1137,6 +1182,7 @@ class Converter { | ||
| 1137 | 1182 | Converter Converter_from_JSON(mixed json) { |
| 1138 | 1183 | Converter retval = Converter(); |
| 1139 | 1184 | |
| 1185 | + if (!intp(json["converter"])) error("Expected integer"); | |
| 1140 | 1186 | retval.converter = json["converter"]; |
| 1141 | 1187 | |
| 1142 | 1188 | return retval; |
| @@ -1157,6 +1203,7 @@ class Date { | ||
| 1157 | 1203 | Date Date_from_JSON(mixed json) { |
| 1158 | 1204 | Date retval = Date(); |
| 1159 | 1205 | |
| 1206 | + if (!intp(json["date"])) error("Expected integer"); | |
| 1160 | 1207 | retval.date = json["date"]; |
| 1161 | 1208 | |
| 1162 | 1209 | return retval; |
| @@ -1177,6 +1224,7 @@ class DateParseHandling { | ||
| 1177 | 1224 | DateParseHandling DateParseHandling_from_JSON(mixed json) { |
| 1178 | 1225 | DateParseHandling retval = DateParseHandling(); |
| 1179 | 1226 | |
| 1227 | + if (!intp(json["date_parse_handling"])) error("Expected integer"); | |
| 1180 | 1228 | retval.date_parse_handling = json["date_parse_handling"]; |
| 1181 | 1229 | |
| 1182 | 1230 | return retval; |
| @@ -1197,6 +1245,7 @@ class Debugger { | ||
| 1197 | 1245 | Debugger Debugger_from_JSON(mixed json) { |
| 1198 | 1246 | Debugger retval = Debugger(); |
| 1199 | 1247 | |
| 1248 | + if (!intp(json["debugger"])) error("Expected integer"); | |
| 1200 | 1249 | retval.debugger = json["debugger"]; |
| 1201 | 1250 | |
| 1202 | 1251 | return retval; |
| @@ -1217,6 +1266,7 @@ class Decimal { | ||
| 1217 | 1266 | Decimal Decimal_from_JSON(mixed json) { |
| 1218 | 1267 | Decimal retval = Decimal(); |
| 1219 | 1268 | |
| 1269 | + if (!intp(json["decimal"])) error("Expected integer"); | |
| 1220 | 1270 | retval.decimal = json["decimal"]; |
| 1221 | 1271 | |
| 1222 | 1272 | return retval; |
| @@ -1237,6 +1287,7 @@ class Declare { | ||
| 1237 | 1287 | Declare Declare_from_JSON(mixed json) { |
| 1238 | 1288 | Declare retval = Declare(); |
| 1239 | 1289 | |
| 1290 | + if (!intp(json["declare"])) error("Expected integer"); | |
| 1240 | 1291 | retval.declare = json["declare"]; |
| 1241 | 1292 | |
| 1242 | 1293 | return retval; |
| @@ -1257,6 +1308,7 @@ class Decltype { | ||
| 1257 | 1308 | Decltype Decltype_from_JSON(mixed json) { |
| 1258 | 1309 | Decltype retval = Decltype(); |
| 1259 | 1310 | |
| 1311 | + if (!intp(json["decltype"])) error("Expected integer"); | |
| 1260 | 1312 | retval.decltype = json["decltype"]; |
| 1261 | 1313 | |
| 1262 | 1314 | return retval; |
| @@ -1277,6 +1329,7 @@ class DecodeString { | ||
| 1277 | 1329 | DecodeString DecodeString_from_JSON(mixed json) { |
| 1278 | 1330 | DecodeString retval = DecodeString(); |
| 1279 | 1331 | |
| 1332 | + if (!intp(json["decode_string"])) error("Expected integer"); | |
| 1280 | 1333 | retval.decode_string = json["decode_string"]; |
| 1281 | 1334 | |
| 1282 | 1335 | return retval; |
| @@ -1297,6 +1350,7 @@ class Empty { | ||
| 1297 | 1350 | Empty Empty_from_JSON(mixed json) { |
| 1298 | 1351 | Empty retval = Empty(); |
| 1299 | 1352 | |
| 1353 | + if (!intp(json["_"])) error("Expected integer"); | |
| 1300 | 1354 | retval.empty = json["_"]; |
| 1301 | 1355 | |
| 1302 | 1356 | return retval; |
| @@ -1317,6 +1371,7 @@ class Imaginery { | ||
| 1317 | 1371 | Imaginery Imaginery_from_JSON(mixed json) { |
| 1318 | 1372 | Imaginery retval = Imaginery(); |
| 1319 | 1373 | |
| 1374 | + if (!intp(json["_Imaginery"])) error("Expected integer"); | |
| 1320 | 1375 | retval.imaginery = json["_Imaginery"]; |
| 1321 | 1376 | |
| 1322 | 1377 | return retval; |
| @@ -1337,6 +1392,7 @@ class AnyClass { | ||
| 1337 | 1392 | AnyClass AnyClass_from_JSON(mixed json) { |
| 1338 | 1393 | AnyClass retval = AnyClass(); |
| 1339 | 1394 | |
| 1395 | + if (!intp(json["any"])) error("Expected integer"); | |
| 1340 | 1396 | retval.any = json["any"]; |
| 1341 | 1397 | |
| 1342 | 1398 | return retval; |
| @@ -1357,6 +1413,7 @@ class Array { | ||
| 1357 | 1413 | Array Array_from_JSON(mixed json) { |
| 1358 | 1414 | Array retval = Array(); |
| 1359 | 1415 | |
| 1416 | + if (!intp(json["array"])) error("Expected integer"); | |
| 1360 | 1417 | retval.array_array = json["array"]; |
| 1361 | 1418 | |
| 1362 | 1419 | return retval; |
| @@ -1377,6 +1434,7 @@ class Auto { | ||
| 1377 | 1434 | Auto Auto_from_JSON(mixed json) { |
| 1378 | 1435 | Auto retval = Auto(); |
| 1379 | 1436 | |
| 1437 | + if (!intp(json["auto"])) error("Expected integer"); | |
| 1380 | 1438 | retval.auto_auto = json["auto"]; |
| 1381 | 1439 | |
| 1382 | 1440 | return retval; |
| @@ -1397,6 +1455,7 @@ class BoolClass { | ||
| 1397 | 1455 | BoolClass BoolClass_from_JSON(mixed json) { |
| 1398 | 1456 | BoolClass retval = BoolClass(); |
| 1399 | 1457 | |
| 1458 | + if (!intp(json["_Bool"])) error("Expected integer"); | |
| 1400 | 1459 | retval.bool = json["_Bool"]; |
| 1401 | 1460 | |
| 1402 | 1461 | return retval; |
| @@ -1417,6 +1476,7 @@ class Break { | ||
| 1417 | 1476 | Break Break_from_JSON(mixed json) { |
| 1418 | 1477 | Break retval = Break(); |
| 1419 | 1478 | |
| 1479 | + if (!intp(json["break"])) error("Expected integer"); | |
| 1420 | 1480 | retval.break_break = json["break"]; |
| 1421 | 1481 | |
| 1422 | 1482 | return retval; |
| @@ -1437,6 +1497,7 @@ class Case { | ||
| 1437 | 1497 | Case Case_from_JSON(mixed json) { |
| 1438 | 1498 | Case retval = Case(); |
| 1439 | 1499 | |
| 1500 | + if (!intp(json["case"])) error("Expected integer"); | |
| 1440 | 1501 | retval.case_case = json["case"]; |
| 1441 | 1502 | |
| 1442 | 1503 | return retval; |
| @@ -1457,6 +1518,7 @@ class Catch { | ||
| 1457 | 1518 | Catch Catch_from_JSON(mixed json) { |
| 1458 | 1519 | Catch retval = Catch(); |
| 1459 | 1520 | |
| 1521 | + if (!intp(json["catch"])) error("Expected integer"); | |
| 1460 | 1522 | retval.catch_catch = json["catch"]; |
| 1461 | 1523 | |
| 1462 | 1524 | return retval; |
| @@ -1477,6 +1539,7 @@ class Class { | ||
| 1477 | 1539 | Class Class_from_JSON(mixed json) { |
| 1478 | 1540 | Class retval = Class(); |
| 1479 | 1541 | |
| 1542 | + if (!intp(json["Class"])) error("Expected integer"); | |
| 1480 | 1543 | retval.class_class = json["Class"]; |
| 1481 | 1544 | |
| 1482 | 1545 | return retval; |
| @@ -1497,6 +1560,7 @@ class Const { | ||
| 1497 | 1560 | Const Const_from_JSON(mixed json) { |
| 1498 | 1561 | Const retval = Const(); |
| 1499 | 1562 | |
| 1563 | + if (!intp(json["const"])) error("Expected integer"); | |
| 1500 | 1564 | retval.const_const = json["const"]; |
| 1501 | 1565 | |
| 1502 | 1566 | return retval; |
| @@ -1517,6 +1581,7 @@ class Continue { | ||
| 1517 | 1581 | Continue Continue_from_JSON(mixed json) { |
| 1518 | 1582 | Continue retval = Continue(); |
| 1519 | 1583 | |
| 1584 | + if (!intp(json["continue"])) error("Expected integer"); | |
| 1520 | 1585 | retval.continue_continue = json["continue"]; |
| 1521 | 1586 | |
| 1522 | 1587 | return retval; |
| @@ -1537,6 +1602,7 @@ class Obj1Bool { | ||
| 1537 | 1602 | Obj1Bool Obj1Bool_from_JSON(mixed json) { |
| 1538 | 1603 | Obj1Bool retval = Obj1Bool(); |
| 1539 | 1604 | |
| 1605 | + if (!intp(json["bool"])) error("Expected integer"); | |
| 1540 | 1606 | retval.bool = json["bool"]; |
| 1541 | 1607 | |
| 1542 | 1608 | return retval; |
| @@ -1557,6 +1623,7 @@ class ClassClass { | ||
| 1557 | 1623 | ClassClass ClassClass_from_JSON(mixed json) { |
| 1558 | 1624 | ClassClass retval = ClassClass(); |
| 1559 | 1625 | |
| 1626 | + if (!intp(json["class"])) error("Expected integer"); | |
| 1560 | 1627 | retval.class_class = json["class"]; |
| 1561 | 1628 | |
| 1562 | 1629 | return retval; |
| @@ -1717,6 +1784,7 @@ Obj2 Obj2_from_JSON(mixed json) { | ||
| 1717 | 1784 | retval.dictionary = json["dictionary"]; |
| 1718 | 1785 | retval.did_set = json["didSet"]; |
| 1719 | 1786 | retval.double = json["double"]; |
| 1787 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 1720 | 1788 | retval.dummy = json["dummy"]; |
| 1721 | 1789 | retval.dynamic = json["dynamic"]; |
| 1722 | 1790 | retval.dynamic_cast = json["dynamic_cast"]; |
| @@ -1792,6 +1860,7 @@ class Def { | ||
| 1792 | 1860 | Def Def_from_JSON(mixed json) { |
| 1793 | 1861 | Def retval = Def(); |
| 1794 | 1862 | |
| 1863 | + if (!intp(json["def"])) error("Expected integer"); | |
| 1795 | 1864 | retval.def = json["def"]; |
| 1796 | 1865 | |
| 1797 | 1866 | return retval; |
| @@ -1812,6 +1881,7 @@ class Defer { | ||
| 1812 | 1881 | Defer Defer_from_JSON(mixed json) { |
| 1813 | 1882 | Defer retval = Defer(); |
| 1814 | 1883 | |
| 1884 | + if (!intp(json["defer"])) error("Expected integer"); | |
| 1815 | 1885 | retval.defer = json["defer"]; |
| 1816 | 1886 | |
| 1817 | 1887 | return retval; |
| @@ -1832,6 +1902,7 @@ class Deinit { | ||
| 1832 | 1902 | Deinit Deinit_from_JSON(mixed json) { |
| 1833 | 1903 | Deinit retval = Deinit(); |
| 1834 | 1904 | |
| 1905 | + if (!intp(json["deinit"])) error("Expected integer"); | |
| 1835 | 1906 | retval.deinit = json["deinit"]; |
| 1836 | 1907 | |
| 1837 | 1908 | return retval; |
| @@ -1852,6 +1923,7 @@ class Del { | ||
| 1852 | 1923 | Del Del_from_JSON(mixed json) { |
| 1853 | 1924 | Del retval = Del(); |
| 1854 | 1925 | |
| 1926 | + if (!intp(json["del"])) error("Expected integer"); | |
| 1855 | 1927 | retval.del = json["del"]; |
| 1856 | 1928 | |
| 1857 | 1929 | return retval; |
| @@ -1872,6 +1944,7 @@ class Delegate { | ||
| 1872 | 1944 | Delegate Delegate_from_JSON(mixed json) { |
| 1873 | 1945 | Delegate retval = Delegate(); |
| 1874 | 1946 | |
| 1947 | + if (!intp(json["delegate"])) error("Expected integer"); | |
| 1875 | 1948 | retval.delegate = json["delegate"]; |
| 1876 | 1949 | |
| 1877 | 1950 | return retval; |
| @@ -1892,6 +1965,7 @@ class Delete { | ||
| 1892 | 1965 | Delete Delete_from_JSON(mixed json) { |
| 1893 | 1966 | Delete retval = Delete(); |
| 1894 | 1967 | |
| 1968 | + if (!intp(json["delete"])) error("Expected integer"); | |
| 1895 | 1969 | retval.delete = json["delete"]; |
| 1896 | 1970 | |
| 1897 | 1971 | return retval; |
| @@ -1912,6 +1986,7 @@ class Dict { | ||
| 1912 | 1986 | Dict Dict_from_JSON(mixed json) { |
| 1913 | 1987 | Dict retval = Dict(); |
| 1914 | 1988 | |
| 1989 | + if (!intp(json["dict"])) error("Expected integer"); | |
| 1915 | 1990 | retval.dict = json["dict"]; |
| 1916 | 1991 | |
| 1917 | 1992 | return retval; |
| @@ -1932,6 +2007,7 @@ class Dictionary { | ||
| 1932 | 2007 | Dictionary Dictionary_from_JSON(mixed json) { |
| 1933 | 2008 | Dictionary retval = Dictionary(); |
| 1934 | 2009 | |
| 2010 | + if (!intp(json["dictionary"])) error("Expected integer"); | |
| 1935 | 2011 | retval.dictionary = json["dictionary"]; |
| 1936 | 2012 | |
| 1937 | 2013 | return retval; |
| @@ -1952,6 +2028,7 @@ class DidSet { | ||
| 1952 | 2028 | DidSet DidSet_from_JSON(mixed json) { |
| 1953 | 2029 | DidSet retval = DidSet(); |
| 1954 | 2030 | |
| 2031 | + if (!intp(json["didSet"])) error("Expected integer"); | |
| 1955 | 2032 | retval.did_set = json["didSet"]; |
| 1956 | 2033 | |
| 1957 | 2034 | return retval; |
| @@ -1972,6 +2049,7 @@ class Double { | ||
| 1972 | 2049 | Double Double_from_JSON(mixed json) { |
| 1973 | 2050 | Double retval = Double(); |
| 1974 | 2051 | |
| 2052 | + if (!intp(json["double"])) error("Expected integer"); | |
| 1975 | 2053 | retval.double = json["double"]; |
| 1976 | 2054 | |
| 1977 | 2055 | return retval; |
| @@ -1992,6 +2070,7 @@ class Dynamic { | ||
| 1992 | 2070 | Dynamic Dynamic_from_JSON(mixed json) { |
| 1993 | 2071 | Dynamic retval = Dynamic(); |
| 1994 | 2072 | |
| 2073 | + if (!intp(json["dynamic"])) error("Expected integer"); | |
| 1995 | 2074 | retval.dynamic = json["dynamic"]; |
| 1996 | 2075 | |
| 1997 | 2076 | return retval; |
| @@ -2012,6 +2091,7 @@ class DynamicCast { | ||
| 2012 | 2091 | DynamicCast DynamicCast_from_JSON(mixed json) { |
| 2013 | 2092 | DynamicCast retval = DynamicCast(); |
| 2014 | 2093 | |
| 2094 | + if (!intp(json["dynamic_cast"])) error("Expected integer"); | |
| 2015 | 2095 | retval.dynamic_cast = json["dynamic_cast"]; |
| 2016 | 2096 | |
| 2017 | 2097 | return retval; |
| @@ -2032,6 +2112,7 @@ class Elif { | ||
| 2032 | 2112 | Elif Elif_from_JSON(mixed json) { |
| 2033 | 2113 | Elif retval = Elif(); |
| 2034 | 2114 | |
| 2115 | + if (!intp(json["elif"])) error("Expected integer"); | |
| 2035 | 2116 | retval.elif = json["elif"]; |
| 2036 | 2117 | |
| 2037 | 2118 | return retval; |
| @@ -2052,6 +2133,7 @@ class EncodeQuickType { | ||
| 2052 | 2133 | EncodeQuickType EncodeQuickType_from_JSON(mixed json) { |
| 2053 | 2134 | EncodeQuickType retval = EncodeQuickType(); |
| 2054 | 2135 | |
| 2136 | + if (!intp(json["encode_quick_type"])) error("Expected integer"); | |
| 2055 | 2137 | retval.encode_quick_type = json["encode_quick_type"]; |
| 2056 | 2138 | |
| 2057 | 2139 | return retval; |
| @@ -2072,6 +2154,7 @@ class EqualityContract { | ||
| 2072 | 2154 | EqualityContract EqualityContract_from_JSON(mixed json) { |
| 2073 | 2155 | EqualityContract retval = EqualityContract(); |
| 2074 | 2156 | |
| 2157 | + if (!intp(json["equalityContract"])) error("Expected integer"); | |
| 2075 | 2158 | retval.equality_contract = json["equalityContract"]; |
| 2076 | 2159 | |
| 2077 | 2160 | return retval; |
| @@ -2092,6 +2175,7 @@ class Event { | ||
| 2092 | 2175 | Event Event_from_JSON(mixed json) { |
| 2093 | 2176 | Event retval = Event(); |
| 2094 | 2177 | |
| 2178 | + if (!intp(json["event"])) error("Expected integer"); | |
| 2095 | 2179 | retval.event = json["event"]; |
| 2096 | 2180 | |
| 2097 | 2181 | return retval; |
| @@ -2112,6 +2196,7 @@ class Except { | ||
| 2112 | 2196 | Except Except_from_JSON(mixed json) { |
| 2113 | 2197 | Except retval = Except(); |
| 2114 | 2198 | |
| 2199 | + if (!intp(json["except"])) error("Expected integer"); | |
| 2115 | 2200 | retval.except = json["except"]; |
| 2116 | 2201 | |
| 2117 | 2202 | return retval; |
| @@ -2132,6 +2217,7 @@ class Exception { | ||
| 2132 | 2217 | Exception Exception_from_JSON(mixed json) { |
| 2133 | 2218 | Exception retval = Exception(); |
| 2134 | 2219 | |
| 2220 | + if (!intp(json["exception"])) error("Expected integer"); | |
| 2135 | 2221 | retval.exception = json["exception"]; |
| 2136 | 2222 | |
| 2137 | 2223 | return retval; |
| @@ -2152,6 +2238,7 @@ class Explicit { | ||
| 2152 | 2238 | Explicit Explicit_from_JSON(mixed json) { |
| 2153 | 2239 | Explicit retval = Explicit(); |
| 2154 | 2240 | |
| 2241 | + if (!intp(json["explicit"])) error("Expected integer"); | |
| 2155 | 2242 | retval.explicit = json["explicit"]; |
| 2156 | 2243 | |
| 2157 | 2244 | return retval; |
| @@ -2172,6 +2259,7 @@ class Export { | ||
| 2172 | 2259 | Export Export_from_JSON(mixed json) { |
| 2173 | 2260 | Export retval = Export(); |
| 2174 | 2261 | |
| 2262 | + if (!intp(json["export"])) error("Expected integer"); | |
| 2175 | 2263 | retval.export = json["export"]; |
| 2176 | 2264 | |
| 2177 | 2265 | return retval; |
| @@ -2192,6 +2280,7 @@ class Exposing { | ||
| 2192 | 2280 | Exposing Exposing_from_JSON(mixed json) { |
| 2193 | 2281 | Exposing retval = Exposing(); |
| 2194 | 2282 | |
| 2283 | + if (!intp(json["exposing"])) error("Expected integer"); | |
| 2195 | 2284 | retval.exposing = json["exposing"]; |
| 2196 | 2285 | |
| 2197 | 2286 | return retval; |
| @@ -2212,6 +2301,7 @@ class Extends { | ||
| 2212 | 2301 | Extends Extends_from_JSON(mixed json) { |
| 2213 | 2302 | Extends retval = Extends(); |
| 2214 | 2303 | |
| 2304 | + if (!intp(json["extends"])) error("Expected integer"); | |
| 2215 | 2305 | retval.extends = json["extends"]; |
| 2216 | 2306 | |
| 2217 | 2307 | return retval; |
| @@ -2232,6 +2322,7 @@ class Extension { | ||
| 2232 | 2322 | Extension Extension_from_JSON(mixed json) { |
| 2233 | 2323 | Extension retval = Extension(); |
| 2234 | 2324 | |
| 2325 | + if (!intp(json["extension"])) error("Expected integer"); | |
| 2235 | 2326 | retval.extension = json["extension"]; |
| 2236 | 2327 | |
| 2237 | 2328 | return retval; |
| @@ -2252,6 +2343,7 @@ class Fallthrough { | ||
| 2252 | 2343 | Fallthrough Fallthrough_from_JSON(mixed json) { |
| 2253 | 2344 | Fallthrough retval = Fallthrough(); |
| 2254 | 2345 | |
| 2346 | + if (!intp(json["fallthrough"])) error("Expected integer"); | |
| 2255 | 2347 | retval.fallthrough = json["fallthrough"]; |
| 2256 | 2348 | |
| 2257 | 2349 | return retval; |
| @@ -2272,6 +2364,7 @@ class False { | ||
| 2272 | 2364 | False False_from_JSON(mixed json) { |
| 2273 | 2365 | False retval = False(); |
| 2274 | 2366 | |
| 2367 | + if (!intp(json["False"])) error("Expected integer"); | |
| 2275 | 2368 | retval.false = json["False"]; |
| 2276 | 2369 | |
| 2277 | 2370 | return retval; |
| @@ -2292,6 +2385,7 @@ class Fileprivate { | ||
| 2292 | 2385 | Fileprivate Fileprivate_from_JSON(mixed json) { |
| 2293 | 2386 | Fileprivate retval = Fileprivate(); |
| 2294 | 2387 | |
| 2388 | + if (!intp(json["fileprivate"])) error("Expected integer"); | |
| 2295 | 2389 | retval.fileprivate = json["fileprivate"]; |
| 2296 | 2390 | |
| 2297 | 2391 | return retval; |
| @@ -2312,6 +2406,7 @@ class Finally { | ||
| 2312 | 2406 | Finally Finally_from_JSON(mixed json) { |
| 2313 | 2407 | Finally retval = Finally(); |
| 2314 | 2408 | |
| 2409 | + if (!intp(json["finally"])) error("Expected integer"); | |
| 2315 | 2410 | retval.finally = json["finally"]; |
| 2316 | 2411 | |
| 2317 | 2412 | return retval; |
| @@ -2332,6 +2427,7 @@ class Fixed { | ||
| 2332 | 2427 | Fixed Fixed_from_JSON(mixed json) { |
| 2333 | 2428 | Fixed retval = Fixed(); |
| 2334 | 2429 | |
| 2430 | + if (!intp(json["fixed"])) error("Expected integer"); | |
| 2335 | 2431 | retval.fixed = json["fixed"]; |
| 2336 | 2432 | |
| 2337 | 2433 | return retval; |
| @@ -2352,6 +2448,7 @@ class Friend { | ||
| 2352 | 2448 | Friend Friend_from_JSON(mixed json) { |
| 2353 | 2449 | Friend retval = Friend(); |
| 2354 | 2450 | |
| 2451 | + if (!intp(json["friend"])) error("Expected integer"); | |
| 2355 | 2452 | retval.friend = json["friend"]; |
| 2356 | 2453 | |
| 2357 | 2454 | return retval; |
| @@ -2372,6 +2469,7 @@ class From { | ||
| 2372 | 2469 | From From_from_JSON(mixed json) { |
| 2373 | 2470 | From retval = From(); |
| 2374 | 2471 | |
| 2472 | + if (!intp(json["from"])) error("Expected integer"); | |
| 2375 | 2473 | retval.from = json["from"]; |
| 2376 | 2474 | |
| 2377 | 2475 | return retval; |
| @@ -2392,6 +2490,7 @@ class FromJson { | ||
| 2392 | 2490 | FromJson FromJson_from_JSON(mixed json) { |
| 2393 | 2491 | FromJson retval = FromJson(); |
| 2394 | 2492 | |
| 2493 | + if (!intp(json["from_json"])) error("Expected integer"); | |
| 2395 | 2494 | retval.from_json = json["from_json"]; |
| 2396 | 2495 | |
| 2397 | 2496 | return retval; |
| @@ -2412,6 +2511,7 @@ class Func { | ||
| 2412 | 2511 | Func Func_from_JSON(mixed json) { |
| 2413 | 2512 | Func retval = Func(); |
| 2414 | 2513 | |
| 2514 | + if (!intp(json["func"])) error("Expected integer"); | |
| 2415 | 2515 | retval.func = json["func"]; |
| 2416 | 2516 | |
| 2417 | 2517 | return retval; |
| @@ -2432,6 +2532,7 @@ class Get { | ||
| 2432 | 2532 | Get Get_from_JSON(mixed json) { |
| 2433 | 2533 | Get retval = Get(); |
| 2434 | 2534 | |
| 2535 | + if (!intp(json["get"])) error("Expected integer"); | |
| 2435 | 2536 | retval.get = json["get"]; |
| 2436 | 2537 | |
| 2437 | 2538 | return retval; |
| @@ -2452,6 +2553,7 @@ class Go { | ||
| 2452 | 2553 | Go Go_from_JSON(mixed json) { |
| 2453 | 2554 | Go retval = Go(); |
| 2454 | 2555 | |
| 2556 | + if (!intp(json["go"])) error("Expected integer"); | |
| 2455 | 2557 | retval.go = json["go"]; |
| 2456 | 2558 | |
| 2457 | 2559 | return retval; |
| @@ -2472,6 +2574,7 @@ class Goto { | ||
| 2472 | 2574 | Goto Goto_from_JSON(mixed json) { |
| 2473 | 2575 | Goto retval = Goto(); |
| 2474 | 2576 | |
| 2577 | + if (!intp(json["goto"])) error("Expected integer"); | |
| 2475 | 2578 | retval.goto = json["goto"]; |
| 2476 | 2579 | |
| 2477 | 2580 | return retval; |
| @@ -2492,6 +2595,7 @@ class Guard { | ||
| 2492 | 2595 | Guard Guard_from_JSON(mixed json) { |
| 2493 | 2596 | Guard retval = Guard(); |
| 2494 | 2597 | |
| 2598 | + if (!intp(json["guard"])) error("Expected integer"); | |
| 2495 | 2599 | retval.guard = json["guard"]; |
| 2496 | 2600 | |
| 2497 | 2601 | return retval; |
| @@ -2512,6 +2616,7 @@ class HasOwnProperty { | ||
| 2512 | 2616 | HasOwnProperty HasOwnProperty_from_JSON(mixed json) { |
| 2513 | 2617 | HasOwnProperty retval = HasOwnProperty(); |
| 2514 | 2618 | |
| 2619 | + if (!intp(json["hasOwnProperty"])) error("Expected integer"); | |
| 2515 | 2620 | retval.has_own_property = json["hasOwnProperty"]; |
| 2516 | 2621 | |
| 2517 | 2622 | return retval; |
| @@ -2532,6 +2637,7 @@ class Id { | ||
| 2532 | 2637 | Id Id_from_JSON(mixed json) { |
| 2533 | 2638 | Id retval = Id(); |
| 2534 | 2639 | |
| 2640 | + if (!intp(json["id"])) error("Expected integer"); | |
| 2535 | 2641 | retval.id = json["id"]; |
| 2536 | 2642 | |
| 2537 | 2643 | return retval; |
| @@ -2552,6 +2658,7 @@ class Imp { | ||
| 2552 | 2658 | Imp Imp_from_JSON(mixed json) { |
| 2553 | 2659 | Imp retval = Imp(); |
| 2554 | 2660 | |
| 2661 | + if (!intp(json["IMP"])) error("Expected integer"); | |
| 2555 | 2662 | retval.imp = json["IMP"]; |
| 2556 | 2663 | |
| 2557 | 2664 | return retval; |
| @@ -2572,6 +2679,7 @@ class Implements { | ||
| 2572 | 2679 | Implements Implements_from_JSON(mixed json) { |
| 2573 | 2680 | Implements retval = Implements(); |
| 2574 | 2681 | |
| 2682 | + if (!intp(json["implements"])) error("Expected integer"); | |
| 2575 | 2683 | retval.implements = json["implements"]; |
| 2576 | 2684 | |
| 2577 | 2685 | return retval; |
| @@ -2592,6 +2700,7 @@ class Implicit { | ||
| 2592 | 2700 | Implicit Implicit_from_JSON(mixed json) { |
| 2593 | 2701 | Implicit retval = Implicit(); |
| 2594 | 2702 | |
| 2703 | + if (!intp(json["implicit"])) error("Expected integer"); | |
| 2595 | 2704 | retval.implicit = json["implicit"]; |
| 2596 | 2705 | |
| 2597 | 2706 | return retval; |
| @@ -2612,6 +2721,7 @@ class In { | ||
| 2612 | 2721 | In In_from_JSON(mixed json) { |
| 2613 | 2722 | In retval = In(); |
| 2614 | 2723 | |
| 2724 | + if (!intp(json["in"])) error("Expected integer"); | |
| 2615 | 2725 | retval.in = json["in"]; |
| 2616 | 2726 | |
| 2617 | 2727 | return retval; |
| @@ -2632,6 +2742,7 @@ class Indirect { | ||
| 2632 | 2742 | Indirect Indirect_from_JSON(mixed json) { |
| 2633 | 2743 | Indirect retval = Indirect(); |
| 2634 | 2744 | |
| 2745 | + if (!intp(json["indirect"])) error("Expected integer"); | |
| 2635 | 2746 | retval.indirect = json["indirect"]; |
| 2636 | 2747 | |
| 2637 | 2748 | return retval; |
| @@ -2652,6 +2763,7 @@ class Infix { | ||
| 2652 | 2763 | Infix Infix_from_JSON(mixed json) { |
| 2653 | 2764 | Infix retval = Infix(); |
| 2654 | 2765 | |
| 2766 | + if (!intp(json["infix"])) error("Expected integer"); | |
| 2655 | 2767 | retval.infix = json["infix"]; |
| 2656 | 2768 | |
| 2657 | 2769 | return retval; |
| @@ -2672,6 +2784,7 @@ class Init { | ||
| 2672 | 2784 | Init Init_from_JSON(mixed json) { |
| 2673 | 2785 | Init retval = Init(); |
| 2674 | 2786 | |
| 2787 | + if (!intp(json["init"])) error("Expected integer"); | |
| 2675 | 2788 | retval.init = json["init"]; |
| 2676 | 2789 | |
| 2677 | 2790 | return retval; |
| @@ -2692,6 +2805,7 @@ class Inout { | ||
| 2692 | 2805 | Inout Inout_from_JSON(mixed json) { |
| 2693 | 2806 | Inout retval = Inout(); |
| 2694 | 2807 | |
| 2808 | + if (!intp(json["inout"])) error("Expected integer"); | |
| 2695 | 2809 | retval.inout = json["inout"]; |
| 2696 | 2810 | |
| 2697 | 2811 | return retval; |
| @@ -2712,6 +2826,7 @@ class Instanceof { | ||
| 2712 | 2826 | Instanceof Instanceof_from_JSON(mixed json) { |
| 2713 | 2827 | Instanceof retval = Instanceof(); |
| 2714 | 2828 | |
| 2829 | + if (!intp(json["instanceof"])) error("Expected integer"); | |
| 2715 | 2830 | retval.instanceof = json["instanceof"]; |
| 2716 | 2831 | |
| 2717 | 2832 | return retval; |
| @@ -2732,6 +2847,7 @@ class Interface { | ||
| 2732 | 2847 | Interface Interface_from_JSON(mixed json) { |
| 2733 | 2848 | Interface retval = Interface(); |
| 2734 | 2849 | |
| 2850 | + if (!intp(json["interface"])) error("Expected integer"); | |
| 2735 | 2851 | retval.interface = json["interface"]; |
| 2736 | 2852 | |
| 2737 | 2853 | return retval; |
| @@ -2752,6 +2868,7 @@ class Internal { | ||
| 2752 | 2868 | Internal Internal_from_JSON(mixed json) { |
| 2753 | 2869 | Internal retval = Internal(); |
| 2754 | 2870 | |
| 2871 | + if (!intp(json["internal"])) error("Expected integer"); | |
| 2755 | 2872 | retval.internal = json["internal"]; |
| 2756 | 2873 | |
| 2757 | 2874 | return retval; |
| @@ -2772,6 +2889,7 @@ class Default { | ||
| 2772 | 2889 | Default Default_from_JSON(mixed json) { |
| 2773 | 2890 | Default retval = Default(); |
| 2774 | 2891 | |
| 2892 | + if (!intp(json["default"])) error("Expected integer"); | |
| 2775 | 2893 | retval.default_default = json["default"]; |
| 2776 | 2894 | |
| 2777 | 2895 | return retval; |
| @@ -2792,6 +2910,7 @@ class Do { | ||
| 2792 | 2910 | Do Do_from_JSON(mixed json) { |
| 2793 | 2911 | Do retval = Do(); |
| 2794 | 2912 | |
| 2913 | + if (!intp(json["do"])) error("Expected integer"); | |
| 2795 | 2914 | retval.do_do = json["do"]; |
| 2796 | 2915 | |
| 2797 | 2916 | return retval; |
| @@ -2812,6 +2931,7 @@ class Else { | ||
| 2812 | 2931 | Else Else_from_JSON(mixed json) { |
| 2813 | 2932 | Else retval = Else(); |
| 2814 | 2933 | |
| 2934 | + if (!intp(json["else"])) error("Expected integer"); | |
| 2815 | 2935 | retval.else_else = json["else"]; |
| 2816 | 2936 | |
| 2817 | 2937 | return retval; |
| @@ -2832,6 +2952,7 @@ class Enum { | ||
| 2832 | 2952 | Enum Enum_from_JSON(mixed json) { |
| 2833 | 2953 | Enum retval = Enum(); |
| 2834 | 2954 | |
| 2955 | + if (!intp(json["enum"])) error("Expected integer"); | |
| 2835 | 2956 | retval.enum_enum = json["enum"]; |
| 2836 | 2957 | |
| 2837 | 2958 | return retval; |
| @@ -2852,6 +2973,7 @@ class Extern { | ||
| 2852 | 2973 | Extern Extern_from_JSON(mixed json) { |
| 2853 | 2974 | Extern retval = Extern(); |
| 2854 | 2975 | |
| 2976 | + if (!intp(json["extern"])) error("Expected integer"); | |
| 2855 | 2977 | retval.extern_extern = json["extern"]; |
| 2856 | 2978 | |
| 2857 | 2979 | return retval; |
| @@ -2872,6 +2994,7 @@ class FalseClass { | ||
| 2872 | 2994 | FalseClass FalseClass_from_JSON(mixed json) { |
| 2873 | 2995 | FalseClass retval = FalseClass(); |
| 2874 | 2996 | |
| 2997 | + if (!intp(json["false"])) error("Expected integer"); | |
| 2875 | 2998 | retval.false = json["false"]; |
| 2876 | 2999 | |
| 2877 | 3000 | return retval; |
| @@ -2892,6 +3015,7 @@ class Final { | ||
| 2892 | 3015 | Final Final_from_JSON(mixed json) { |
| 2893 | 3016 | Final retval = Final(); |
| 2894 | 3017 | |
| 3018 | + if (!intp(json["final"])) error("Expected integer"); | |
| 2895 | 3019 | retval.final_final = json["final"]; |
| 2896 | 3020 | |
| 2897 | 3021 | return retval; |
| @@ -2912,6 +3036,7 @@ class Float { | ||
| 2912 | 3036 | Float Float_from_JSON(mixed json) { |
| 2913 | 3037 | Float retval = Float(); |
| 2914 | 3038 | |
| 3039 | + if (!intp(json["float"])) error("Expected integer"); | |
| 2915 | 3040 | retval.float_float = json["float"]; |
| 2916 | 3041 | |
| 2917 | 3042 | return retval; |
| @@ -2932,6 +3057,7 @@ class For { | ||
| 2932 | 3057 | For For_from_JSON(mixed json) { |
| 2933 | 3058 | For retval = For(); |
| 2934 | 3059 | |
| 3060 | + if (!intp(json["for"])) error("Expected integer"); | |
| 2935 | 3061 | retval.for_for = json["for"]; |
| 2936 | 3062 | |
| 2937 | 3063 | return retval; |
| @@ -2952,6 +3078,7 @@ class Foreach { | ||
| 2952 | 3078 | Foreach Foreach_from_JSON(mixed json) { |
| 2953 | 3079 | Foreach retval = Foreach(); |
| 2954 | 3080 | |
| 3081 | + if (!intp(json["foreach"])) error("Expected integer"); | |
| 2955 | 3082 | retval.foreach_foreach = json["foreach"]; |
| 2956 | 3083 | |
| 2957 | 3084 | return retval; |
| @@ -2972,6 +3099,7 @@ class Function { | ||
| 2972 | 3099 | Function Function_from_JSON(mixed json) { |
| 2973 | 3100 | Function retval = Function(); |
| 2974 | 3101 | |
| 3102 | + if (!intp(json["function"])) error("Expected integer"); | |
| 2975 | 3103 | retval.function_function = json["function"]; |
| 2976 | 3104 | |
| 2977 | 3105 | return retval; |
| @@ -2992,6 +3120,7 @@ class Global { | ||
| 2992 | 3120 | Global Global_from_JSON(mixed json) { |
| 2993 | 3121 | Global retval = Global(); |
| 2994 | 3122 | |
| 3123 | + if (!intp(json["global"])) error("Expected integer"); | |
| 2995 | 3124 | retval.global_global = json["global"]; |
| 2996 | 3125 | |
| 2997 | 3126 | return retval; |
| @@ -3012,6 +3141,7 @@ class If { | ||
| 3012 | 3141 | If If_from_JSON(mixed json) { |
| 3013 | 3142 | If retval = If(); |
| 3014 | 3143 | |
| 3144 | + if (!intp(json["if"])) error("Expected integer"); | |
| 3015 | 3145 | retval.if_if = json["if"]; |
| 3016 | 3146 | |
| 3017 | 3147 | return retval; |
| @@ -3032,6 +3162,7 @@ class Import { | ||
| 3032 | 3162 | Import Import_from_JSON(mixed json) { |
| 3033 | 3163 | Import retval = Import(); |
| 3034 | 3164 | |
| 3165 | + if (!intp(json["import"])) error("Expected integer"); | |
| 3035 | 3166 | retval.import_import = json["import"]; |
| 3036 | 3167 | |
| 3037 | 3168 | return retval; |
| @@ -3052,6 +3183,7 @@ class Inline { | ||
| 3052 | 3183 | Inline Inline_from_JSON(mixed json) { |
| 3053 | 3184 | Inline retval = Inline(); |
| 3054 | 3185 | |
| 3186 | + if (!intp(json["inline"])) error("Expected integer"); | |
| 3055 | 3187 | retval.inline_inline = json["inline"]; |
| 3056 | 3188 | |
| 3057 | 3189 | return retval; |
| @@ -3072,6 +3204,7 @@ class Int { | ||
| 3072 | 3204 | Int Int_from_JSON(mixed json) { |
| 3073 | 3205 | Int retval = Int(); |
| 3074 | 3206 | |
| 3207 | + if (!intp(json["int"])) error("Expected integer"); | |
| 3075 | 3208 | retval.int_int = json["int"]; |
| 3076 | 3209 | |
| 3077 | 3210 | return retval; |
| @@ -3222,6 +3355,7 @@ class Obj3 { | ||
| 3222 | 3355 | Obj3 Obj3_from_JSON(mixed json) { |
| 3223 | 3356 | Obj3 retval = Obj3(); |
| 3224 | 3357 | |
| 3358 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 3225 | 3359 | retval.dummy = json["dummy"]; |
| 3226 | 3360 | retval.is = json["is"]; |
| 3227 | 3361 | retval.iterable = json["iterable"]; |
| @@ -3307,6 +3441,7 @@ class Is { | ||
| 3307 | 3441 | Is Is_from_JSON(mixed json) { |
| 3308 | 3442 | Is retval = Is(); |
| 3309 | 3443 | |
| 3444 | + if (!intp(json["is"])) error("Expected integer"); | |
| 3310 | 3445 | retval.is = json["is"]; |
| 3311 | 3446 | |
| 3312 | 3447 | return retval; |
| @@ -3327,6 +3462,7 @@ class Iterable { | ||
| 3327 | 3462 | Iterable Iterable_from_JSON(mixed json) { |
| 3328 | 3463 | Iterable retval = Iterable(); |
| 3329 | 3464 | |
| 3465 | + if (!intp(json["iterable"])) error("Expected integer"); | |
| 3330 | 3466 | retval.iterable = json["iterable"]; |
| 3331 | 3467 | |
| 3332 | 3468 | return retval; |
| @@ -3347,6 +3483,7 @@ class Jdec { | ||
| 3347 | 3483 | Jdec Jdec_from_JSON(mixed json) { |
| 3348 | 3484 | Jdec retval = Jdec(); |
| 3349 | 3485 | |
| 3486 | + if (!intp(json["jdec"])) error("Expected integer"); | |
| 3350 | 3487 | retval.jdec = json["jdec"]; |
| 3351 | 3488 | |
| 3352 | 3489 | return retval; |
| @@ -3367,6 +3504,7 @@ class Jenc { | ||
| 3367 | 3504 | Jenc Jenc_from_JSON(mixed json) { |
| 3368 | 3505 | Jenc retval = Jenc(); |
| 3369 | 3506 | |
| 3507 | + if (!intp(json["jenc"])) error("Expected integer"); | |
| 3370 | 3508 | retval.jenc = json["jenc"]; |
| 3371 | 3509 | |
| 3372 | 3510 | return retval; |
| @@ -3387,6 +3525,7 @@ class Jpipe { | ||
| 3387 | 3525 | Jpipe Jpipe_from_JSON(mixed json) { |
| 3388 | 3526 | Jpipe retval = Jpipe(); |
| 3389 | 3527 | |
| 3528 | + if (!intp(json["jpipe"])) error("Expected integer"); | |
| 3390 | 3529 | retval.jpipe = json["jpipe"]; |
| 3391 | 3530 | |
| 3392 | 3531 | return retval; |
| @@ -3407,6 +3546,7 @@ class Json { | ||
| 3407 | 3546 | Json Json_from_JSON(mixed json) { |
| 3408 | 3547 | Json retval = Json(); |
| 3409 | 3548 | |
| 3549 | + if (!intp(json["json"])) error("Expected integer"); | |
| 3410 | 3550 | retval.json = json["json"]; |
| 3411 | 3551 | |
| 3412 | 3552 | return retval; |
| @@ -3427,6 +3567,7 @@ class JsonConverter { | ||
| 3427 | 3567 | JsonConverter JsonConverter_from_JSON(mixed json) { |
| 3428 | 3568 | JsonConverter retval = JsonConverter(); |
| 3429 | 3569 | |
| 3570 | + if (!intp(json["json_converter"])) error("Expected integer"); | |
| 3430 | 3571 | retval.json_converter = json["json_converter"]; |
| 3431 | 3572 | |
| 3432 | 3573 | return retval; |
| @@ -3447,6 +3588,7 @@ class JsonSerializer { | ||
| 3447 | 3588 | JsonSerializer JsonSerializer_from_JSON(mixed json) { |
| 3448 | 3589 | JsonSerializer retval = JsonSerializer(); |
| 3449 | 3590 | |
| 3591 | + if (!intp(json["json_serializer"])) error("Expected integer"); | |
| 3450 | 3592 | retval.json_serializer = json["json_serializer"]; |
| 3451 | 3593 | |
| 3452 | 3594 | return retval; |
| @@ -3467,6 +3609,7 @@ class JsonToken { | ||
| 3467 | 3609 | JsonToken JsonToken_from_JSON(mixed json) { |
| 3468 | 3610 | JsonToken retval = JsonToken(); |
| 3469 | 3611 | |
| 3612 | + if (!intp(json["json_token"])) error("Expected integer"); | |
| 3470 | 3613 | retval.json_token = json["json_token"]; |
| 3471 | 3614 | |
| 3472 | 3615 | return retval; |
| @@ -3487,6 +3630,7 @@ class JsonWriter { | ||
| 3487 | 3630 | JsonWriter JsonWriter_from_JSON(mixed json) { |
| 3488 | 3631 | JsonWriter retval = JsonWriter(); |
| 3489 | 3632 | |
| 3633 | + if (!intp(json["json_writer"])) error("Expected integer"); | |
| 3490 | 3634 | retval.json_writer = json["json_writer"]; |
| 3491 | 3635 | |
| 3492 | 3636 | return retval; |
| @@ -3507,6 +3651,7 @@ class Lazy { | ||
| 3507 | 3651 | Lazy Lazy_from_JSON(mixed json) { |
| 3508 | 3652 | Lazy retval = Lazy(); |
| 3509 | 3653 | |
| 3654 | + if (!intp(json["lazy"])) error("Expected integer"); | |
| 3510 | 3655 | retval.lazy = json["lazy"]; |
| 3511 | 3656 | |
| 3512 | 3657 | return retval; |
| @@ -3527,6 +3672,7 @@ class Left { | ||
| 3527 | 3672 | Left Left_from_JSON(mixed json) { |
| 3528 | 3673 | Left retval = Left(); |
| 3529 | 3674 | |
| 3675 | + if (!intp(json["left"])) error("Expected integer"); | |
| 3530 | 3676 | retval.left = json["left"]; |
| 3531 | 3677 | |
| 3532 | 3678 | return retval; |
| @@ -3547,6 +3693,7 @@ class Let { | ||
| 3547 | 3693 | Let Let_from_JSON(mixed json) { |
| 3548 | 3694 | Let retval = Let(); |
| 3549 | 3695 | |
| 3696 | + if (!intp(json["let"])) error("Expected integer"); | |
| 3550 | 3697 | retval.let = json["let"]; |
| 3551 | 3698 | |
| 3552 | 3699 | return retval; |
| @@ -3567,6 +3714,7 @@ class List { | ||
| 3567 | 3714 | List List_from_JSON(mixed json) { |
| 3568 | 3715 | List retval = List(); |
| 3569 | 3716 | |
| 3717 | + if (!intp(json["list"])) error("Expected integer"); | |
| 3570 | 3718 | retval.list = json["list"]; |
| 3571 | 3719 | |
| 3572 | 3720 | return retval; |
| @@ -3587,6 +3735,7 @@ class Lock { | ||
| 3587 | 3735 | Lock Lock_from_JSON(mixed json) { |
| 3588 | 3736 | Lock retval = Lock(); |
| 3589 | 3737 | |
| 3738 | + if (!intp(json["lock"])) error("Expected integer"); | |
| 3590 | 3739 | retval.lock = json["lock"]; |
| 3591 | 3740 | |
| 3592 | 3741 | return retval; |
| @@ -3607,6 +3756,7 @@ class Long { | ||
| 3607 | 3756 | Long Long_from_JSON(mixed json) { |
| 3608 | 3757 | Long retval = Long(); |
| 3609 | 3758 | |
| 3759 | + if (!intp(json["long"])) error("Expected integer"); | |
| 3610 | 3760 | retval.long = json["long"]; |
| 3611 | 3761 | |
| 3612 | 3762 | return retval; |
| @@ -3627,6 +3777,7 @@ class Map { | ||
| 3627 | 3777 | Map Map_from_JSON(mixed json) { |
| 3628 | 3778 | Map retval = Map(); |
| 3629 | 3779 | |
| 3780 | + if (!intp(json["map"])) error("Expected integer"); | |
| 3630 | 3781 | retval.map = json["map"]; |
| 3631 | 3782 | |
| 3632 | 3783 | return retval; |
| @@ -3647,6 +3798,7 @@ class MetadataPropertyHandling { | ||
| 3647 | 3798 | MetadataPropertyHandling MetadataPropertyHandling_from_JSON(mixed json) { |
| 3648 | 3799 | MetadataPropertyHandling retval = MetadataPropertyHandling(); |
| 3649 | 3800 | |
| 3801 | + if (!intp(json["metadata_property_handling"])) error("Expected integer"); | |
| 3650 | 3802 | retval.metadata_property_handling = json["metadata_property_handling"]; |
| 3651 | 3803 | |
| 3652 | 3804 | return retval; |
| @@ -3667,6 +3819,7 @@ class Module { | ||
| 3667 | 3819 | Module Module_from_JSON(mixed json) { |
| 3668 | 3820 | Module retval = Module(); |
| 3669 | 3821 | |
| 3822 | + if (!intp(json["module"])) error("Expected integer"); | |
| 3670 | 3823 | retval.module = json["module"]; |
| 3671 | 3824 | |
| 3672 | 3825 | return retval; |
| @@ -3687,6 +3840,7 @@ class Mutable { | ||
| 3687 | 3840 | Mutable Mutable_from_JSON(mixed json) { |
| 3688 | 3841 | Mutable retval = Mutable(); |
| 3689 | 3842 | |
| 3843 | + if (!intp(json["mutable"])) error("Expected integer"); | |
| 3690 | 3844 | retval.mutable = json["mutable"]; |
| 3691 | 3845 | |
| 3692 | 3846 | return retval; |
| @@ -3707,6 +3861,7 @@ class Mutating { | ||
| 3707 | 3861 | Mutating Mutating_from_JSON(mixed json) { |
| 3708 | 3862 | Mutating retval = Mutating(); |
| 3709 | 3863 | |
| 3864 | + if (!intp(json["mutating"])) error("Expected integer"); | |
| 3710 | 3865 | retval.mutating = json["mutating"]; |
| 3711 | 3866 | |
| 3712 | 3867 | return retval; |
| @@ -3727,6 +3882,7 @@ class Namespace { | ||
| 3727 | 3882 | Namespace Namespace_from_JSON(mixed json) { |
| 3728 | 3883 | Namespace retval = Namespace(); |
| 3729 | 3884 | |
| 3885 | + if (!intp(json["namespace"])) error("Expected integer"); | |
| 3730 | 3886 | retval.namespace = json["namespace"]; |
| 3731 | 3887 | |
| 3732 | 3888 | return retval; |
| @@ -3747,6 +3903,7 @@ class Native { | ||
| 3747 | 3903 | Native Native_from_JSON(mixed json) { |
| 3748 | 3904 | Native retval = Native(); |
| 3749 | 3905 | |
| 3906 | + if (!intp(json["native"])) error("Expected integer"); | |
| 3750 | 3907 | retval.native = json["native"]; |
| 3751 | 3908 | |
| 3752 | 3909 | return retval; |
| @@ -3767,6 +3924,7 @@ class New { | ||
| 3767 | 3924 | New New_from_JSON(mixed json) { |
| 3768 | 3925 | New retval = New(); |
| 3769 | 3926 | |
| 3927 | + if (!intp(json["new"])) error("Expected integer"); | |
| 3770 | 3928 | retval.new = json["new"]; |
| 3771 | 3929 | |
| 3772 | 3930 | return retval; |
| @@ -3787,6 +3945,7 @@ class Newtonsoft { | ||
| 3787 | 3945 | Newtonsoft Newtonsoft_from_JSON(mixed json) { |
| 3788 | 3946 | Newtonsoft retval = Newtonsoft(); |
| 3789 | 3947 | |
| 3948 | + if (!intp(json["newtonsoft"])) error("Expected integer"); | |
| 3790 | 3949 | retval.newtonsoft = json["newtonsoft"]; |
| 3791 | 3950 | |
| 3792 | 3951 | return retval; |
| @@ -3807,6 +3966,7 @@ class Nil { | ||
| 3807 | 3966 | Nil Nil_from_JSON(mixed json) { |
| 3808 | 3967 | Nil retval = Nil(); |
| 3809 | 3968 | |
| 3969 | + if (!intp(json["nil"])) error("Expected integer"); | |
| 3810 | 3970 | retval.nil = json["nil"]; |
| 3811 | 3971 | |
| 3812 | 3972 | return retval; |
| @@ -3827,6 +3987,7 @@ class No { | ||
| 3827 | 3987 | No No_from_JSON(mixed json) { |
| 3828 | 3988 | No retval = No(); |
| 3829 | 3989 | |
| 3990 | + if (!intp(json["NO"])) error("Expected integer"); | |
| 3830 | 3991 | retval.no = json["NO"]; |
| 3831 | 3992 | |
| 3832 | 3993 | return retval; |
| @@ -3847,6 +4008,7 @@ class Noexcept { | ||
| 3847 | 4008 | Noexcept Noexcept_from_JSON(mixed json) { |
| 3848 | 4009 | Noexcept retval = Noexcept(); |
| 3849 | 4010 | |
| 4011 | + if (!intp(json["noexcept"])) error("Expected integer"); | |
| 3850 | 4012 | retval.noexcept = json["noexcept"]; |
| 3851 | 4013 | |
| 3852 | 4014 | return retval; |
| @@ -3867,6 +4029,7 @@ class Nonatomic { | ||
| 3867 | 4029 | Nonatomic Nonatomic_from_JSON(mixed json) { |
| 3868 | 4030 | Nonatomic retval = Nonatomic(); |
| 3869 | 4031 | |
| 4032 | + if (!intp(json["nonatomic"])) error("Expected integer"); | |
| 3870 | 4033 | retval.nonatomic = json["nonatomic"]; |
| 3871 | 4034 | |
| 3872 | 4035 | return retval; |
| @@ -3887,6 +4050,7 @@ class None { | ||
| 3887 | 4050 | None None_from_JSON(mixed json) { |
| 3888 | 4051 | None retval = None(); |
| 3889 | 4052 | |
| 4053 | + if (!intp(json["None"])) error("Expected integer"); | |
| 3890 | 4054 | retval.none = json["None"]; |
| 3891 | 4055 | |
| 3892 | 4056 | return retval; |
| @@ -3907,6 +4071,7 @@ class Nonlocal { | ||
| 3907 | 4071 | Nonlocal Nonlocal_from_JSON(mixed json) { |
| 3908 | 4072 | Nonlocal retval = Nonlocal(); |
| 3909 | 4073 | |
| 4074 | + if (!intp(json["nonlocal"])) error("Expected integer"); | |
| 3910 | 4075 | retval.nonlocal = json["nonlocal"]; |
| 3911 | 4076 | |
| 3912 | 4077 | return retval; |
| @@ -3927,6 +4092,7 @@ class Nonmutating { | ||
| 3927 | 4092 | Nonmutating Nonmutating_from_JSON(mixed json) { |
| 3928 | 4093 | Nonmutating retval = Nonmutating(); |
| 3929 | 4094 | |
| 4095 | + if (!intp(json["nonmutating"])) error("Expected integer"); | |
| 3930 | 4096 | retval.nonmutating = json["nonmutating"]; |
| 3931 | 4097 | |
| 3932 | 4098 | return retval; |
| @@ -3947,6 +4113,7 @@ class Not { | ||
| 3947 | 4113 | Not Not_from_JSON(mixed json) { |
| 3948 | 4114 | Not retval = Not(); |
| 3949 | 4115 | |
| 4116 | + if (!intp(json["not"])) error("Expected integer"); | |
| 3950 | 4117 | retval.not = json["not"]; |
| 3951 | 4118 | |
| 3952 | 4119 | return retval; |
| @@ -3967,6 +4134,7 @@ class NotEq { | ||
| 3967 | 4134 | NotEq NotEq_from_JSON(mixed json) { |
| 3968 | 4135 | NotEq retval = NotEq(); |
| 3969 | 4136 | |
| 4137 | + if (!intp(json["not_eq"])) error("Expected integer"); | |
| 3970 | 4138 | retval.not_eq = json["not_eq"]; |
| 3971 | 4139 | |
| 3972 | 4140 | return retval; |
| @@ -3987,6 +4155,7 @@ class NsString { | ||
| 3987 | 4155 | NsString NsString_from_JSON(mixed json) { |
| 3988 | 4156 | NsString retval = NsString(); |
| 3989 | 4157 | |
| 4158 | + if (!intp(json["NSString"])) error("Expected integer"); | |
| 3990 | 4159 | retval.ns_string = json["NSString"]; |
| 3991 | 4160 | |
| 3992 | 4161 | return retval; |
| @@ -4007,6 +4176,7 @@ class Null { | ||
| 4007 | 4176 | Null Null_from_JSON(mixed json) { |
| 4008 | 4177 | Null retval = Null(); |
| 4009 | 4178 | |
| 4179 | + if (!intp(json["NULL"])) error("Expected integer"); | |
| 4010 | 4180 | retval.null = json["NULL"]; |
| 4011 | 4181 | |
| 4012 | 4182 | return retval; |
| @@ -4027,6 +4197,7 @@ class Nullptr { | ||
| 4027 | 4197 | Nullptr Nullptr_from_JSON(mixed json) { |
| 4028 | 4198 | Nullptr retval = Nullptr(); |
| 4029 | 4199 | |
| 4200 | + if (!intp(json["nullptr"])) error("Expected integer"); | |
| 4030 | 4201 | retval.nullptr = json["nullptr"]; |
| 4031 | 4202 | |
| 4032 | 4203 | return retval; |
| @@ -4047,6 +4218,7 @@ class Number { | ||
| 4047 | 4218 | Number Number_from_JSON(mixed json) { |
| 4048 | 4219 | Number retval = Number(); |
| 4049 | 4220 | |
| 4221 | + if (!intp(json["number"])) error("Expected integer"); | |
| 4050 | 4222 | retval.number = json["number"]; |
| 4051 | 4223 | |
| 4052 | 4224 | return retval; |
| @@ -4067,6 +4239,7 @@ class Lambda { | ||
| 4067 | 4239 | Lambda Lambda_from_JSON(mixed json) { |
| 4068 | 4240 | Lambda retval = Lambda(); |
| 4069 | 4241 | |
| 4242 | + if (!intp(json["lambda"])) error("Expected integer"); | |
| 4070 | 4243 | retval.lambda_lambda = json["lambda"]; |
| 4071 | 4244 | |
| 4072 | 4245 | return retval; |
| @@ -4087,6 +4260,7 @@ class NoneClass { | ||
| 4087 | 4260 | NoneClass NoneClass_from_JSON(mixed json) { |
| 4088 | 4261 | NoneClass retval = NoneClass(); |
| 4089 | 4262 | |
| 4263 | + if (!intp(json["none"])) error("Expected integer"); | |
| 4090 | 4264 | retval.none = json["none"]; |
| 4091 | 4265 | |
| 4092 | 4266 | return retval; |
| @@ -4107,6 +4281,7 @@ class NullClass { | ||
| 4107 | 4281 | NullClass NullClass_from_JSON(mixed json) { |
| 4108 | 4282 | NullClass retval = NullClass(); |
| 4109 | 4283 | |
| 4284 | + if (!intp(json["null"])) error("Expected integer"); | |
| 4110 | 4285 | retval.null = json["null"]; |
| 4111 | 4286 | |
| 4112 | 4287 | return retval; |
| @@ -4127,6 +4302,7 @@ class Object { | ||
| 4127 | 4302 | Object Object_from_JSON(mixed json) { |
| 4128 | 4303 | Object retval = Object(); |
| 4129 | 4304 | |
| 4305 | + if (!intp(json["object"])) error("Expected integer"); | |
| 4130 | 4306 | retval.object_object = json["object"]; |
| 4131 | 4307 | |
| 4132 | 4308 | return retval; |
| @@ -4147,6 +4323,7 @@ class Optional { | ||
| 4147 | 4323 | Optional Optional_from_JSON(mixed json) { |
| 4148 | 4324 | Optional retval = Optional(); |
| 4149 | 4325 | |
| 4326 | + if (!intp(json["optional"])) error("Expected integer"); | |
| 4150 | 4327 | retval.optional_optional = json["optional"]; |
| 4151 | 4328 | |
| 4152 | 4329 | return retval; |
| @@ -4167,6 +4344,7 @@ class Private { | ||
| 4167 | 4344 | Private Private_from_JSON(mixed json) { |
| 4168 | 4345 | Private retval = Private(); |
| 4169 | 4346 | |
| 4347 | + if (!intp(json["private"])) error("Expected integer"); | |
| 4170 | 4348 | retval.private_private = json["private"]; |
| 4171 | 4349 | |
| 4172 | 4350 | return retval; |
| @@ -4187,6 +4365,7 @@ class Protected { | ||
| 4187 | 4365 | Protected Protected_from_JSON(mixed json) { |
| 4188 | 4366 | Protected retval = Protected(); |
| 4189 | 4367 | |
| 4368 | + if (!intp(json["protected"])) error("Expected integer"); | |
| 4190 | 4369 | retval.protected_protected = json["protected"]; |
| 4191 | 4370 | |
| 4192 | 4371 | return retval; |
| @@ -4207,6 +4386,7 @@ class ProtocolClass { | ||
| 4207 | 4386 | ProtocolClass ProtocolClass_from_JSON(mixed json) { |
| 4208 | 4387 | ProtocolClass retval = ProtocolClass(); |
| 4209 | 4388 | |
| 4389 | + if (!intp(json["protocol"])) error("Expected integer"); | |
| 4210 | 4390 | retval.protocol = json["protocol"]; |
| 4211 | 4391 | |
| 4212 | 4392 | return retval; |
| @@ -4227,6 +4407,7 @@ class Of { | ||
| 4227 | 4407 | Of Of_from_JSON(mixed json) { |
| 4228 | 4408 | Of retval = Of(); |
| 4229 | 4409 | |
| 4410 | + if (!intp(json["of"])) error("Expected integer"); | |
| 4230 | 4411 | retval.of = json["of"]; |
| 4231 | 4412 | |
| 4232 | 4413 | return retval; |
| @@ -4247,6 +4428,7 @@ class Oneway { | ||
| 4247 | 4428 | Oneway Oneway_from_JSON(mixed json) { |
| 4248 | 4429 | Oneway retval = Oneway(); |
| 4249 | 4430 | |
| 4431 | + if (!intp(json["oneway"])) error("Expected integer"); | |
| 4250 | 4432 | retval.oneway = json["oneway"]; |
| 4251 | 4433 | |
| 4252 | 4434 | return retval; |
| @@ -4267,6 +4449,7 @@ class Open { | ||
| 4267 | 4449 | Open Open_from_JSON(mixed json) { |
| 4268 | 4450 | Open retval = Open(); |
| 4269 | 4451 | |
| 4452 | + if (!intp(json["open"])) error("Expected integer"); | |
| 4270 | 4453 | retval.open = json["open"]; |
| 4271 | 4454 | |
| 4272 | 4455 | return retval; |
| @@ -4287,6 +4470,7 @@ class Operator { | ||
| 4287 | 4470 | Operator Operator_from_JSON(mixed json) { |
| 4288 | 4471 | Operator retval = Operator(); |
| 4289 | 4472 | |
| 4473 | + if (!intp(json["operator"])) error("Expected integer"); | |
| 4290 | 4474 | retval.operator = json["operator"]; |
| 4291 | 4475 | |
| 4292 | 4476 | return retval; |
| @@ -4307,6 +4491,7 @@ class Or { | ||
| 4307 | 4491 | Or Or_from_JSON(mixed json) { |
| 4308 | 4492 | Or retval = Or(); |
| 4309 | 4493 | |
| 4494 | + if (!intp(json["or"])) error("Expected integer"); | |
| 4310 | 4495 | retval.or = json["or"]; |
| 4311 | 4496 | |
| 4312 | 4497 | return retval; |
| @@ -4327,6 +4512,7 @@ class OrEq { | ||
| 4327 | 4512 | OrEq OrEq_from_JSON(mixed json) { |
| 4328 | 4513 | OrEq retval = OrEq(); |
| 4329 | 4514 | |
| 4515 | + if (!intp(json["or_eq"])) error("Expected integer"); | |
| 4330 | 4516 | retval.or_eq = json["or_eq"]; |
| 4331 | 4517 | |
| 4332 | 4518 | return retval; |
| @@ -4347,6 +4533,7 @@ class Out { | ||
| 4347 | 4533 | Out Out_from_JSON(mixed json) { |
| 4348 | 4534 | Out retval = Out(); |
| 4349 | 4535 | |
| 4536 | + if (!intp(json["out"])) error("Expected integer"); | |
| 4350 | 4537 | retval.out = json["out"]; |
| 4351 | 4538 | |
| 4352 | 4539 | return retval; |
| @@ -4367,6 +4554,7 @@ class Override { | ||
| 4367 | 4554 | Override Override_from_JSON(mixed json) { |
| 4368 | 4555 | Override retval = Override(); |
| 4369 | 4556 | |
| 4557 | + if (!intp(json["override"])) error("Expected integer"); | |
| 4370 | 4558 | retval.override = json["override"]; |
| 4371 | 4559 | |
| 4372 | 4560 | return retval; |
| @@ -4387,6 +4575,7 @@ class Package { | ||
| 4387 | 4575 | Package Package_from_JSON(mixed json) { |
| 4388 | 4576 | Package retval = Package(); |
| 4389 | 4577 | |
| 4578 | + if (!intp(json["package"])) error("Expected integer"); | |
| 4390 | 4579 | retval.package = json["package"]; |
| 4391 | 4580 | |
| 4392 | 4581 | return retval; |
| @@ -4407,6 +4596,7 @@ class Params { | ||
| 4407 | 4596 | Params Params_from_JSON(mixed json) { |
| 4408 | 4597 | Params retval = Params(); |
| 4409 | 4598 | |
| 4599 | + if (!intp(json["params"])) error("Expected integer"); | |
| 4410 | 4600 | retval.params = json["params"]; |
| 4411 | 4601 | |
| 4412 | 4602 | return retval; |
| @@ -4427,6 +4617,7 @@ class Pass { | ||
| 4427 | 4617 | Pass Pass_from_JSON(mixed json) { |
| 4428 | 4618 | Pass retval = Pass(); |
| 4429 | 4619 | |
| 4620 | + if (!intp(json["pass"])) error("Expected integer"); | |
| 4430 | 4621 | retval.pass = json["pass"]; |
| 4431 | 4622 | |
| 4432 | 4623 | return retval; |
| @@ -4447,6 +4638,7 @@ class Port { | ||
| 4447 | 4638 | Port Port_from_JSON(mixed json) { |
| 4448 | 4639 | Port retval = Port(); |
| 4449 | 4640 | |
| 4641 | + if (!intp(json["port"])) error("Expected integer"); | |
| 4450 | 4642 | retval.port = json["port"]; |
| 4451 | 4643 | |
| 4452 | 4644 | return retval; |
| @@ -4467,6 +4659,7 @@ class Postfix { | ||
| 4467 | 4659 | Postfix Postfix_from_JSON(mixed json) { |
| 4468 | 4660 | Postfix retval = Postfix(); |
| 4469 | 4661 | |
| 4662 | + if (!intp(json["postfix"])) error("Expected integer"); | |
| 4470 | 4663 | retval.postfix = json["postfix"]; |
| 4471 | 4664 | |
| 4472 | 4665 | return retval; |
| @@ -4487,6 +4680,7 @@ class Precedence { | ||
| 4487 | 4680 | Precedence Precedence_from_JSON(mixed json) { |
| 4488 | 4681 | Precedence retval = Precedence(); |
| 4489 | 4682 | |
| 4683 | + if (!intp(json["precedence"])) error("Expected integer"); | |
| 4490 | 4684 | retval.precedence = json["precedence"]; |
| 4491 | 4685 | |
| 4492 | 4686 | return retval; |
| @@ -4507,6 +4701,7 @@ class Prefix { | ||
| 4507 | 4701 | Prefix Prefix_from_JSON(mixed json) { |
| 4508 | 4702 | Prefix retval = Prefix(); |
| 4509 | 4703 | |
| 4704 | + if (!intp(json["prefix"])) error("Expected integer"); | |
| 4510 | 4705 | retval.prefix = json["prefix"]; |
| 4511 | 4706 | |
| 4512 | 4707 | return retval; |
| @@ -4527,6 +4722,7 @@ class Print { | ||
| 4527 | 4722 | Print Print_from_JSON(mixed json) { |
| 4528 | 4723 | Print retval = Print(); |
| 4529 | 4724 | |
| 4725 | + if (!intp(json["print"])) error("Expected integer"); | |
| 4530 | 4726 | retval.print = json["print"]; |
| 4531 | 4727 | |
| 4532 | 4728 | return retval; |
| @@ -4547,6 +4743,7 @@ class PrintMembers { | ||
| 4547 | 4743 | PrintMembers PrintMembers_from_JSON(mixed json) { |
| 4548 | 4744 | PrintMembers retval = PrintMembers(); |
| 4549 | 4745 | |
| 4746 | + if (!intp(json["printMembers"])) error("Expected integer"); | |
| 4550 | 4747 | retval.print_members = json["printMembers"]; |
| 4551 | 4748 | |
| 4552 | 4749 | return retval; |
| @@ -4567,6 +4764,7 @@ class Printf { | ||
| 4567 | 4764 | Printf Printf_from_JSON(mixed json) { |
| 4568 | 4765 | Printf retval = Printf(); |
| 4569 | 4766 | |
| 4767 | + if (!intp(json["printf"])) error("Expected integer"); | |
| 4570 | 4768 | retval.printf = json["printf"]; |
| 4571 | 4769 | |
| 4572 | 4770 | return retval; |
| @@ -4587,6 +4785,7 @@ class Protocol { | ||
| 4587 | 4785 | Protocol Protocol_from_JSON(mixed json) { |
| 4588 | 4786 | Protocol retval = Protocol(); |
| 4589 | 4787 | |
| 4788 | + if (!intp(json["Protocol"])) error("Expected integer"); | |
| 4590 | 4789 | retval.protocol = json["Protocol"]; |
| 4591 | 4790 | |
| 4592 | 4791 | return retval; |
| @@ -4735,6 +4934,7 @@ class Obj4 { | ||
| 4735 | 4934 | Obj4 Obj4_from_JSON(mixed json) { |
| 4736 | 4935 | Obj4 retval = Obj4(); |
| 4737 | 4936 | |
| 4937 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 4738 | 4938 | retval.dummy = json["dummy"]; |
| 4739 | 4939 | retval.obj4_public = json["public"]; |
| 4740 | 4940 | retval.obj4_return = json["return"]; |
| @@ -4819,6 +5019,7 @@ class Public { | ||
| 4819 | 5019 | Public Public_from_JSON(mixed json) { |
| 4820 | 5020 | Public retval = Public(); |
| 4821 | 5021 | |
| 5022 | + if (!intp(json["public"])) error("Expected integer"); | |
| 4822 | 5023 | retval.public_public = json["public"]; |
| 4823 | 5024 | |
| 4824 | 5025 | return retval; |
| @@ -4839,6 +5040,7 @@ class Return { | ||
| 4839 | 5040 | Return Return_from_JSON(mixed json) { |
| 4840 | 5041 | Return retval = Return(); |
| 4841 | 5042 | |
| 5043 | + if (!intp(json["return"])) error("Expected integer"); | |
| 4842 | 5044 | retval.return_return = json["return"]; |
| 4843 | 5045 | |
| 4844 | 5046 | return retval; |
| @@ -4859,6 +5061,7 @@ class SelfClass { | ||
| 4859 | 5061 | SelfClass SelfClass_from_JSON(mixed json) { |
| 4860 | 5062 | SelfClass retval = SelfClass(); |
| 4861 | 5063 | |
| 5064 | + if (!intp(json["self"])) error("Expected integer"); | |
| 4862 | 5065 | retval.self = json["self"]; |
| 4863 | 5066 | |
| 4864 | 5067 | return retval; |
| @@ -4879,6 +5082,7 @@ class Static { | ||
| 4879 | 5082 | Static Static_from_JSON(mixed json) { |
| 4880 | 5083 | Static retval = Static(); |
| 4881 | 5084 | |
| 5085 | + if (!intp(json["static"])) error("Expected integer"); | |
| 4882 | 5086 | retval.static_static = json["static"]; |
| 4883 | 5087 | |
| 4884 | 5088 | return retval; |
| @@ -4899,6 +5103,7 @@ class String { | ||
| 4899 | 5103 | String String_from_JSON(mixed json) { |
| 4900 | 5104 | String retval = String(); |
| 4901 | 5105 | |
| 5106 | + if (!intp(json["string"])) error("Expected integer"); | |
| 4902 | 5107 | retval.string_string = json["string"]; |
| 4903 | 5108 | |
| 4904 | 5109 | return retval; |
| @@ -4919,6 +5124,7 @@ class Switch { | ||
| 4919 | 5124 | Switch Switch_from_JSON(mixed json) { |
| 4920 | 5125 | Switch retval = Switch(); |
| 4921 | 5126 | |
| 5127 | + if (!intp(json["switch"])) error("Expected integer"); | |
| 4922 | 5128 | retval.switch_switch = json["switch"]; |
| 4923 | 5129 | |
| 4924 | 5130 | return retval; |
| @@ -4939,6 +5145,7 @@ class TrueClass { | ||
| 4939 | 5145 | TrueClass TrueClass_from_JSON(mixed json) { |
| 4940 | 5146 | TrueClass retval = TrueClass(); |
| 4941 | 5147 | |
| 5148 | + if (!intp(json["true"])) error("Expected integer"); | |
| 4942 | 5149 | retval.true = json["true"]; |
| 4943 | 5150 | |
| 4944 | 5151 | return retval; |
| @@ -4959,6 +5166,7 @@ class TypeClass { | ||
| 4959 | 5166 | TypeClass TypeClass_from_JSON(mixed json) { |
| 4960 | 5167 | TypeClass retval = TypeClass(); |
| 4961 | 5168 | |
| 5169 | + if (!intp(json["type"])) error("Expected integer"); | |
| 4962 | 5170 | retval.type = json["type"]; |
| 4963 | 5171 | |
| 4964 | 5172 | return retval; |
| @@ -4979,6 +5187,7 @@ class Typedef { | ||
| 4979 | 5187 | Typedef Typedef_from_JSON(mixed json) { |
| 4980 | 5188 | Typedef retval = Typedef(); |
| 4981 | 5189 | |
| 5190 | + if (!intp(json["typedef"])) error("Expected integer"); | |
| 4982 | 5191 | retval.typedef_typedef = json["typedef"]; |
| 4983 | 5192 | |
| 4984 | 5193 | return retval; |
| @@ -4999,6 +5208,7 @@ class Typeof { | ||
| 4999 | 5208 | Typeof Typeof_from_JSON(mixed json) { |
| 5000 | 5209 | Typeof retval = Typeof(); |
| 5001 | 5210 | |
| 5211 | + if (!intp(json["typeof"])) error("Expected integer"); | |
| 5002 | 5212 | retval.typeof_typeof = json["typeof"]; |
| 5003 | 5213 | |
| 5004 | 5214 | return retval; |
| @@ -5019,6 +5229,7 @@ class Quicktype { | ||
| 5019 | 5229 | Quicktype Quicktype_from_JSON(mixed json) { |
| 5020 | 5230 | Quicktype retval = Quicktype(); |
| 5021 | 5231 | |
| 5232 | + if (!intp(json["quicktype"])) error("Expected integer"); | |
| 5022 | 5233 | retval.quicktype = json["quicktype"]; |
| 5023 | 5234 | |
| 5024 | 5235 | return retval; |
| @@ -5039,6 +5250,7 @@ class Raise { | ||
| 5039 | 5250 | Raise Raise_from_JSON(mixed json) { |
| 5040 | 5251 | Raise retval = Raise(); |
| 5041 | 5252 | |
| 5253 | + if (!intp(json["raise"])) error("Expected integer"); | |
| 5042 | 5254 | retval.raise = json["raise"]; |
| 5043 | 5255 | |
| 5044 | 5256 | return retval; |
| @@ -5059,6 +5271,7 @@ class Range { | ||
| 5059 | 5271 | Range Range_from_JSON(mixed json) { |
| 5060 | 5272 | Range retval = Range(); |
| 5061 | 5273 | |
| 5274 | + if (!intp(json["range"])) error("Expected integer"); | |
| 5062 | 5275 | retval.range = json["range"]; |
| 5063 | 5276 | |
| 5064 | 5277 | return retval; |
| @@ -5079,6 +5292,7 @@ class Readonly { | ||
| 5079 | 5292 | Readonly Readonly_from_JSON(mixed json) { |
| 5080 | 5293 | Readonly retval = Readonly(); |
| 5081 | 5294 | |
| 5295 | + if (!intp(json["readonly"])) error("Expected integer"); | |
| 5082 | 5296 | retval.readonly = json["readonly"]; |
| 5083 | 5297 | |
| 5084 | 5298 | return retval; |
| @@ -5099,6 +5313,7 @@ class Ref { | ||
| 5099 | 5313 | Ref Ref_from_JSON(mixed json) { |
| 5100 | 5314 | Ref retval = Ref(); |
| 5101 | 5315 | |
| 5316 | + if (!intp(json["ref"])) error("Expected integer"); | |
| 5102 | 5317 | retval.ref = json["ref"]; |
| 5103 | 5318 | |
| 5104 | 5319 | return retval; |
| @@ -5119,6 +5334,7 @@ class Register { | ||
| 5119 | 5334 | Register Register_from_JSON(mixed json) { |
| 5120 | 5335 | Register retval = Register(); |
| 5121 | 5336 | |
| 5337 | + if (!intp(json["register"])) error("Expected integer"); | |
| 5122 | 5338 | retval.register = json["register"]; |
| 5123 | 5339 | |
| 5124 | 5340 | return retval; |
| @@ -5139,6 +5355,7 @@ class ReinterpretCast { | ||
| 5139 | 5355 | ReinterpretCast ReinterpretCast_from_JSON(mixed json) { |
| 5140 | 5356 | ReinterpretCast retval = ReinterpretCast(); |
| 5141 | 5357 | |
| 5358 | + if (!intp(json["reinterpret_cast"])) error("Expected integer"); | |
| 5142 | 5359 | retval.reinterpret_cast = json["reinterpret_cast"]; |
| 5143 | 5360 | |
| 5144 | 5361 | return retval; |
| @@ -5159,6 +5376,7 @@ class Repeat { | ||
| 5159 | 5376 | Repeat Repeat_from_JSON(mixed json) { |
| 5160 | 5377 | Repeat retval = Repeat(); |
| 5161 | 5378 | |
| 5379 | + if (!intp(json["repeat"])) error("Expected integer"); | |
| 5162 | 5380 | retval.repeat = json["repeat"]; |
| 5163 | 5381 | |
| 5164 | 5382 | return retval; |
| @@ -5179,6 +5397,7 @@ class Require { | ||
| 5179 | 5397 | Require Require_from_JSON(mixed json) { |
| 5180 | 5398 | Require retval = Require(); |
| 5181 | 5399 | |
| 5400 | + if (!intp(json["require"])) error("Expected integer"); | |
| 5182 | 5401 | retval.require = json["require"]; |
| 5183 | 5402 | |
| 5184 | 5403 | return retval; |
| @@ -5199,6 +5418,7 @@ class Required { | ||
| 5199 | 5418 | Required Required_from_JSON(mixed json) { |
| 5200 | 5419 | Required retval = Required(); |
| 5201 | 5420 | |
| 5421 | + if (!intp(json["required"])) error("Expected integer"); | |
| 5202 | 5422 | retval.required = json["required"]; |
| 5203 | 5423 | |
| 5204 | 5424 | return retval; |
| @@ -5219,6 +5439,7 @@ class Requires { | ||
| 5219 | 5439 | Requires Requires_from_JSON(mixed json) { |
| 5220 | 5440 | Requires retval = Requires(); |
| 5221 | 5441 | |
| 5442 | + if (!intp(json["requires"])) error("Expected integer"); | |
| 5222 | 5443 | retval.requires = json["requires"]; |
| 5223 | 5444 | |
| 5224 | 5445 | return retval; |
| @@ -5239,6 +5460,7 @@ class Restrict { | ||
| 5239 | 5460 | Restrict Restrict_from_JSON(mixed json) { |
| 5240 | 5461 | Restrict retval = Restrict(); |
| 5241 | 5462 | |
| 5463 | + if (!intp(json["restrict"])) error("Expected integer"); | |
| 5242 | 5464 | retval.restrict = json["restrict"]; |
| 5243 | 5465 | |
| 5244 | 5466 | return retval; |
| @@ -5259,6 +5481,7 @@ class Retain { | ||
| 5259 | 5481 | Retain Retain_from_JSON(mixed json) { |
| 5260 | 5482 | Retain retval = Retain(); |
| 5261 | 5483 | |
| 5484 | + if (!intp(json["retain"])) error("Expected integer"); | |
| 5262 | 5485 | retval.retain = json["retain"]; |
| 5263 | 5486 | |
| 5264 | 5487 | return retval; |
| @@ -5279,6 +5502,7 @@ class Rethrows { | ||
| 5279 | 5502 | Rethrows Rethrows_from_JSON(mixed json) { |
| 5280 | 5503 | Rethrows retval = Rethrows(); |
| 5281 | 5504 | |
| 5505 | + if (!intp(json["rethrows"])) error("Expected integer"); | |
| 5282 | 5506 | retval.rethrows = json["rethrows"]; |
| 5283 | 5507 | |
| 5284 | 5508 | return retval; |
| @@ -5299,6 +5523,7 @@ class Right { | ||
| 5299 | 5523 | Right Right_from_JSON(mixed json) { |
| 5300 | 5524 | Right retval = Right(); |
| 5301 | 5525 | |
| 5526 | + if (!intp(json["right"])) error("Expected integer"); | |
| 5302 | 5527 | retval.right = json["right"]; |
| 5303 | 5528 | |
| 5304 | 5529 | return retval; |
| @@ -5319,6 +5544,7 @@ class Sbyte { | ||
| 5319 | 5544 | Sbyte Sbyte_from_JSON(mixed json) { |
| 5320 | 5545 | Sbyte retval = Sbyte(); |
| 5321 | 5546 | |
| 5547 | + if (!intp(json["sbyte"])) error("Expected integer"); | |
| 5322 | 5548 | retval.sbyte = json["sbyte"]; |
| 5323 | 5549 | |
| 5324 | 5550 | return retval; |
| @@ -5339,6 +5565,7 @@ class Sealed { | ||
| 5339 | 5565 | Sealed Sealed_from_JSON(mixed json) { |
| 5340 | 5566 | Sealed retval = Sealed(); |
| 5341 | 5567 | |
| 5568 | + if (!intp(json["sealed"])) error("Expected integer"); | |
| 5342 | 5569 | retval.sealed = json["sealed"]; |
| 5343 | 5570 | |
| 5344 | 5571 | return retval; |
| @@ -5359,6 +5586,7 @@ class Sel { | ||
| 5359 | 5586 | Sel Sel_from_JSON(mixed json) { |
| 5360 | 5587 | Sel retval = Sel(); |
| 5361 | 5588 | |
| 5589 | + if (!intp(json["SEL"])) error("Expected integer"); | |
| 5362 | 5590 | retval.sel = json["SEL"]; |
| 5363 | 5591 | |
| 5364 | 5592 | return retval; |
| @@ -5379,6 +5607,7 @@ class Select { | ||
| 5379 | 5607 | Select Select_from_JSON(mixed json) { |
| 5380 | 5608 | Select retval = Select(); |
| 5381 | 5609 | |
| 5610 | + if (!intp(json["select"])) error("Expected integer"); | |
| 5382 | 5611 | retval.select = json["select"]; |
| 5383 | 5612 | |
| 5384 | 5613 | return retval; |
| @@ -5399,6 +5628,7 @@ class Self { | ||
| 5399 | 5628 | Self Self_from_JSON(mixed json) { |
| 5400 | 5629 | Self retval = Self(); |
| 5401 | 5630 | |
| 5631 | + if (!intp(json["Self"])) error("Expected integer"); | |
| 5402 | 5632 | retval.self = json["Self"]; |
| 5403 | 5633 | |
| 5404 | 5634 | return retval; |
| @@ -5419,6 +5649,7 @@ class Serialize { | ||
| 5419 | 5649 | Serialize Serialize_from_JSON(mixed json) { |
| 5420 | 5650 | Serialize retval = Serialize(); |
| 5421 | 5651 | |
| 5652 | + if (!intp(json["serialize"])) error("Expected integer"); | |
| 5422 | 5653 | retval.serialize = json["serialize"]; |
| 5423 | 5654 | |
| 5424 | 5655 | return retval; |
| @@ -5439,6 +5670,7 @@ class Set { | ||
| 5439 | 5670 | Set Set_from_JSON(mixed json) { |
| 5440 | 5671 | Set retval = Set(); |
| 5441 | 5672 | |
| 5673 | + if (!intp(json["set"])) error("Expected integer"); | |
| 5442 | 5674 | retval.set = json["set"]; |
| 5443 | 5675 | |
| 5444 | 5676 | return retval; |
| @@ -5459,6 +5691,7 @@ class Short { | ||
| 5459 | 5691 | Short Short_from_JSON(mixed json) { |
| 5460 | 5692 | Short retval = Short(); |
| 5461 | 5693 | |
| 5694 | + if (!intp(json["short"])) error("Expected integer"); | |
| 5462 | 5695 | retval.short = json["short"]; |
| 5463 | 5696 | |
| 5464 | 5697 | return retval; |
| @@ -5479,6 +5712,7 @@ class Signed { | ||
| 5479 | 5712 | Signed Signed_from_JSON(mixed json) { |
| 5480 | 5713 | Signed retval = Signed(); |
| 5481 | 5714 | |
| 5715 | + if (!intp(json["signed"])) error("Expected integer"); | |
| 5482 | 5716 | retval.signed = json["signed"]; |
| 5483 | 5717 | |
| 5484 | 5718 | return retval; |
| @@ -5499,6 +5733,7 @@ class Sizeof { | ||
| 5499 | 5733 | Sizeof Sizeof_from_JSON(mixed json) { |
| 5500 | 5734 | Sizeof retval = Sizeof(); |
| 5501 | 5735 | |
| 5736 | + if (!intp(json["sizeof"])) error("Expected integer"); | |
| 5502 | 5737 | retval.sizeof = json["sizeof"]; |
| 5503 | 5738 | |
| 5504 | 5739 | return retval; |
| @@ -5519,6 +5754,7 @@ class Stackalloc { | ||
| 5519 | 5754 | Stackalloc Stackalloc_from_JSON(mixed json) { |
| 5520 | 5755 | Stackalloc retval = Stackalloc(); |
| 5521 | 5756 | |
| 5757 | + if (!intp(json["stackalloc"])) error("Expected integer"); | |
| 5522 | 5758 | retval.stackalloc = json["stackalloc"]; |
| 5523 | 5759 | |
| 5524 | 5760 | return retval; |
| @@ -5539,6 +5775,7 @@ class StaticAssert { | ||
| 5539 | 5775 | StaticAssert StaticAssert_from_JSON(mixed json) { |
| 5540 | 5776 | StaticAssert retval = StaticAssert(); |
| 5541 | 5777 | |
| 5778 | + if (!intp(json["static_assert"])) error("Expected integer"); | |
| 5542 | 5779 | retval.static_assert = json["static_assert"]; |
| 5543 | 5780 | |
| 5544 | 5781 | return retval; |
| @@ -5559,6 +5796,7 @@ class StaticCast { | ||
| 5559 | 5796 | StaticCast StaticCast_from_JSON(mixed json) { |
| 5560 | 5797 | StaticCast retval = StaticCast(); |
| 5561 | 5798 | |
| 5799 | + if (!intp(json["static_cast"])) error("Expected integer"); | |
| 5562 | 5800 | retval.static_cast = json["static_cast"]; |
| 5563 | 5801 | |
| 5564 | 5802 | return retval; |
| @@ -5579,6 +5817,7 @@ class Strictfp { | ||
| 5579 | 5817 | Strictfp Strictfp_from_JSON(mixed json) { |
| 5580 | 5818 | Strictfp retval = Strictfp(); |
| 5581 | 5819 | |
| 5820 | + if (!intp(json["strictfp"])) error("Expected integer"); | |
| 5582 | 5821 | retval.strictfp = json["strictfp"]; |
| 5583 | 5822 | |
| 5584 | 5823 | return retval; |
| @@ -5599,6 +5838,7 @@ class Struct { | ||
| 5599 | 5838 | Struct Struct_from_JSON(mixed json) { |
| 5600 | 5839 | Struct retval = Struct(); |
| 5601 | 5840 | |
| 5841 | + if (!intp(json["struct"])) error("Expected integer"); | |
| 5602 | 5842 | retval.struct = json["struct"]; |
| 5603 | 5843 | |
| 5604 | 5844 | return retval; |
| @@ -5619,6 +5859,7 @@ class Subscript { | ||
| 5619 | 5859 | Subscript Subscript_from_JSON(mixed json) { |
| 5620 | 5860 | Subscript retval = Subscript(); |
| 5621 | 5861 | |
| 5862 | + if (!intp(json["subscript"])) error("Expected integer"); | |
| 5622 | 5863 | retval.subscript = json["subscript"]; |
| 5623 | 5864 | |
| 5624 | 5865 | return retval; |
| @@ -5639,6 +5880,7 @@ class Super { | ||
| 5639 | 5880 | Super Super_from_JSON(mixed json) { |
| 5640 | 5881 | Super retval = Super(); |
| 5641 | 5882 | |
| 5883 | + if (!intp(json["super"])) error("Expected integer"); | |
| 5642 | 5884 | retval.super = json["super"]; |
| 5643 | 5885 | |
| 5644 | 5886 | return retval; |
| @@ -5659,6 +5901,7 @@ class Symbol { | ||
| 5659 | 5901 | Symbol Symbol_from_JSON(mixed json) { |
| 5660 | 5902 | Symbol retval = Symbol(); |
| 5661 | 5903 | |
| 5904 | + if (!intp(json["symbol"])) error("Expected integer"); | |
| 5662 | 5905 | retval.symbol = json["symbol"]; |
| 5663 | 5906 | |
| 5664 | 5907 | return retval; |
| @@ -5679,6 +5922,7 @@ class Synchronized { | ||
| 5679 | 5922 | Synchronized Synchronized_from_JSON(mixed json) { |
| 5680 | 5923 | Synchronized retval = Synchronized(); |
| 5681 | 5924 | |
| 5925 | + if (!intp(json["synchronized"])) error("Expected integer"); | |
| 5682 | 5926 | retval.synchronized = json["synchronized"]; |
| 5683 | 5927 | |
| 5684 | 5928 | return retval; |
| @@ -5699,6 +5943,7 @@ class System { | ||
| 5699 | 5943 | System System_from_JSON(mixed json) { |
| 5700 | 5944 | System retval = System(); |
| 5701 | 5945 | |
| 5946 | + if (!intp(json["system"])) error("Expected integer"); | |
| 5702 | 5947 | retval.system = json["system"]; |
| 5703 | 5948 | |
| 5704 | 5949 | return retval; |
| @@ -5719,6 +5964,7 @@ class Template { | ||
| 5719 | 5964 | Template Template_from_JSON(mixed json) { |
| 5720 | 5965 | Template retval = Template(); |
| 5721 | 5966 | |
| 5967 | + if (!intp(json["template"])) error("Expected integer"); | |
| 5722 | 5968 | retval.template = json["template"]; |
| 5723 | 5969 | |
| 5724 | 5970 | return retval; |
| @@ -5739,6 +5985,7 @@ class Then { | ||
| 5739 | 5985 | Then Then_from_JSON(mixed json) { |
| 5740 | 5986 | Then retval = Then(); |
| 5741 | 5987 | |
| 5988 | + if (!intp(json["then"])) error("Expected integer"); | |
| 5742 | 5989 | retval.then = json["then"]; |
| 5743 | 5990 | |
| 5744 | 5991 | return retval; |
| @@ -5759,6 +6006,7 @@ class This { | ||
| 5759 | 6006 | This This_from_JSON(mixed json) { |
| 5760 | 6007 | This retval = This(); |
| 5761 | 6008 | |
| 6009 | + if (!intp(json["this"])) error("Expected integer"); | |
| 5762 | 6010 | retval.this = json["this"]; |
| 5763 | 6011 | |
| 5764 | 6012 | return retval; |
| @@ -5779,6 +6027,7 @@ class ThreadLocal { | ||
| 5779 | 6027 | ThreadLocal ThreadLocal_from_JSON(mixed json) { |
| 5780 | 6028 | ThreadLocal retval = ThreadLocal(); |
| 5781 | 6029 | |
| 6030 | + if (!intp(json["thread_local"])) error("Expected integer"); | |
| 5782 | 6031 | retval.thread_local = json["thread_local"]; |
| 5783 | 6032 | |
| 5784 | 6033 | return retval; |
| @@ -5799,6 +6048,7 @@ class Throw { | ||
| 5799 | 6048 | Throw Throw_from_JSON(mixed json) { |
| 5800 | 6049 | Throw retval = Throw(); |
| 5801 | 6050 | |
| 6051 | + if (!intp(json["throw"])) error("Expected integer"); | |
| 5802 | 6052 | retval.throw = json["throw"]; |
| 5803 | 6053 | |
| 5804 | 6054 | return retval; |
| @@ -5819,6 +6069,7 @@ class Throws { | ||
| 5819 | 6069 | Throws Throws_from_JSON(mixed json) { |
| 5820 | 6070 | Throws retval = Throws(); |
| 5821 | 6071 | |
| 6072 | + if (!intp(json["throws"])) error("Expected integer"); | |
| 5822 | 6073 | retval.throws = json["throws"]; |
| 5823 | 6074 | |
| 5824 | 6075 | return retval; |
| @@ -5839,6 +6090,7 @@ class ToJson { | ||
| 5839 | 6090 | ToJson ToJson_from_JSON(mixed json) { |
| 5840 | 6091 | ToJson retval = ToJson(); |
| 5841 | 6092 | |
| 6093 | + if (!intp(json["to_json"])) error("Expected integer"); | |
| 5842 | 6094 | retval.to_json = json["to_json"]; |
| 5843 | 6095 | |
| 5844 | 6096 | return retval; |
| @@ -5859,6 +6111,7 @@ class TopLevelClass { | ||
| 5859 | 6111 | TopLevelClass TopLevelClass_from_JSON(mixed json) { |
| 5860 | 6112 | TopLevelClass retval = TopLevelClass(); |
| 5861 | 6113 | |
| 6114 | + if (!intp(json["top_level"])) error("Expected integer"); | |
| 5862 | 6115 | retval.top_level = json["top_level"]; |
| 5863 | 6116 | |
| 5864 | 6117 | return retval; |
| @@ -5879,6 +6132,7 @@ class Transient { | ||
| 5879 | 6132 | Transient Transient_from_JSON(mixed json) { |
| 5880 | 6133 | Transient retval = Transient(); |
| 5881 | 6134 | |
| 6135 | + if (!intp(json["transient"])) error("Expected integer"); | |
| 5882 | 6136 | retval.transient = json["transient"]; |
| 5883 | 6137 | |
| 5884 | 6138 | return retval; |
| @@ -5899,6 +6153,7 @@ class True { | ||
| 5899 | 6153 | True True_from_JSON(mixed json) { |
| 5900 | 6154 | True retval = True(); |
| 5901 | 6155 | |
| 6156 | + if (!intp(json["True"])) error("Expected integer"); | |
| 5902 | 6157 | retval.true = json["True"]; |
| 5903 | 6158 | |
| 5904 | 6159 | return retval; |
| @@ -5919,6 +6174,7 @@ class Try { | ||
| 5919 | 6174 | Try Try_from_JSON(mixed json) { |
| 5920 | 6175 | Try retval = Try(); |
| 5921 | 6176 | |
| 6177 | + if (!intp(json["try"])) error("Expected integer"); | |
| 5922 | 6178 | retval.try = json["try"]; |
| 5923 | 6179 | |
| 5924 | 6180 | return retval; |
| @@ -5939,6 +6195,7 @@ class Type { | ||
| 5939 | 6195 | Type Type_from_JSON(mixed json) { |
| 5940 | 6196 | Type retval = Type(); |
| 5941 | 6197 | |
| 6198 | + if (!intp(json["Type"])) error("Expected integer"); | |
| 5942 | 6199 | retval.type = json["Type"]; |
| 5943 | 6200 | |
| 5944 | 6201 | return retval; |
| @@ -5959,6 +6216,7 @@ class Typealias { | ||
| 5959 | 6216 | Typealias Typealias_from_JSON(mixed json) { |
| 5960 | 6217 | Typealias retval = Typealias(); |
| 5961 | 6218 | |
| 6219 | + if (!intp(json["typealias"])) error("Expected integer"); | |
| 5962 | 6220 | retval.typealias = json["typealias"]; |
| 5963 | 6221 | |
| 5964 | 6222 | return retval; |
| @@ -5979,6 +6237,7 @@ class Typeid { | ||
| 5979 | 6237 | Typeid Typeid_from_JSON(mixed json) { |
| 5980 | 6238 | Typeid retval = Typeid(); |
| 5981 | 6239 | |
| 6240 | + if (!intp(json["typeid"])) error("Expected integer"); | |
| 5982 | 6241 | retval.typeid = json["typeid"]; |
| 5983 | 6242 | |
| 5984 | 6243 | return retval; |
| @@ -5999,6 +6258,7 @@ class Typename { | ||
| 5999 | 6258 | Typename Typename_from_JSON(mixed json) { |
| 6000 | 6259 | Typename retval = Typename(); |
| 6001 | 6260 | |
| 6261 | + if (!intp(json["typename"])) error("Expected integer"); | |
| 6002 | 6262 | retval.typename = json["typename"]; |
| 6003 | 6263 | |
| 6004 | 6264 | return retval; |
| @@ -6019,6 +6279,7 @@ class Uint { | ||
| 6019 | 6279 | Uint Uint_from_JSON(mixed json) { |
| 6020 | 6280 | Uint retval = Uint(); |
| 6021 | 6281 | |
| 6282 | + if (!intp(json["uint"])) error("Expected integer"); | |
| 6022 | 6283 | retval.uint = json["uint"]; |
| 6023 | 6284 | |
| 6024 | 6285 | return retval; |
| @@ -6039,6 +6300,7 @@ class Ulong { | ||
| 6039 | 6300 | Ulong Ulong_from_JSON(mixed json) { |
| 6040 | 6301 | Ulong retval = Ulong(); |
| 6041 | 6302 | |
| 6303 | + if (!intp(json["ulong"])) error("Expected integer"); | |
| 6042 | 6304 | retval.ulong = json["ulong"]; |
| 6043 | 6305 | |
| 6044 | 6306 | return retval; |
| @@ -6059,6 +6321,7 @@ class Unchecked { | ||
| 6059 | 6321 | Unchecked Unchecked_from_JSON(mixed json) { |
| 6060 | 6322 | Unchecked retval = Unchecked(); |
| 6061 | 6323 | |
| 6324 | + if (!intp(json["unchecked"])) error("Expected integer"); | |
| 6062 | 6325 | retval.unchecked = json["unchecked"]; |
| 6063 | 6326 | |
| 6064 | 6327 | return retval; |
| @@ -6079,6 +6342,7 @@ class Undefined { | ||
| 6079 | 6342 | Undefined Undefined_from_JSON(mixed json) { |
| 6080 | 6343 | Undefined retval = Undefined(); |
| 6081 | 6344 | |
| 6345 | + if (!intp(json["undefined"])) error("Expected integer"); | |
| 6082 | 6346 | retval.undefined = json["undefined"]; |
| 6083 | 6347 | |
| 6084 | 6348 | return retval; |
| @@ -6139,6 +6403,7 @@ class Obj5 { | ||
| 6139 | 6403 | Obj5 Obj5_from_JSON(mixed json) { |
| 6140 | 6404 | Obj5 retval = Obj5(); |
| 6141 | 6405 | |
| 6406 | + if (!intp(json["dummy"])) error("Expected integer"); | |
| 6142 | 6407 | retval.dummy = json["dummy"]; |
| 6143 | 6408 | retval.obj5_void = json["void"]; |
| 6144 | 6409 | retval.obj5_while = json["while"]; |
| @@ -6179,6 +6444,7 @@ class Void { | ||
| 6179 | 6444 | Void Void_from_JSON(mixed json) { |
| 6180 | 6445 | Void retval = Void(); |
| 6181 | 6446 | |
| 6447 | + if (!intp(json["void"])) error("Expected integer"); | |
| 6182 | 6448 | retval.void_void = json["void"]; |
| 6183 | 6449 | |
| 6184 | 6450 | return retval; |
| @@ -6199,6 +6465,7 @@ class While { | ||
| 6199 | 6465 | While While_from_JSON(mixed json) { |
| 6200 | 6466 | While retval = While(); |
| 6201 | 6467 | |
| 6468 | + if (!intp(json["while"])) error("Expected integer"); | |
| 6202 | 6469 | retval.while_while = json["while"]; |
| 6203 | 6470 | |
| 6204 | 6471 | return retval; |
| @@ -6219,6 +6486,7 @@ class Union { | ||
| 6219 | 6486 | Union Union_from_JSON(mixed json) { |
| 6220 | 6487 | Union retval = Union(); |
| 6221 | 6488 | |
| 6489 | + if (!intp(json["union"])) error("Expected integer"); | |
| 6222 | 6490 | retval.union = json["union"]; |
| 6223 | 6491 | |
| 6224 | 6492 | return retval; |
| @@ -6239,6 +6507,7 @@ class Unowned { | ||
| 6239 | 6507 | Unowned Unowned_from_JSON(mixed json) { |
| 6240 | 6508 | Unowned retval = Unowned(); |
| 6241 | 6509 | |
| 6510 | + if (!intp(json["unowned"])) error("Expected integer"); | |
| 6242 | 6511 | retval.unowned = json["unowned"]; |
| 6243 | 6512 | |
| 6244 | 6513 | return retval; |
| @@ -6259,6 +6528,7 @@ class Unsafe { | ||
| 6259 | 6528 | Unsafe Unsafe_from_JSON(mixed json) { |
| 6260 | 6529 | Unsafe retval = Unsafe(); |
| 6261 | 6530 | |
| 6531 | + if (!intp(json["unsafe"])) error("Expected integer"); | |
| 6262 | 6532 | retval.unsafe = json["unsafe"]; |
| 6263 | 6533 | |
| 6264 | 6534 | return retval; |
| @@ -6279,6 +6549,7 @@ class Unsigned { | ||
| 6279 | 6549 | Unsigned Unsigned_from_JSON(mixed json) { |
| 6280 | 6550 | Unsigned retval = Unsigned(); |
| 6281 | 6551 | |
| 6552 | + if (!intp(json["unsigned"])) error("Expected integer"); | |
| 6282 | 6553 | retval.unsigned = json["unsigned"]; |
| 6283 | 6554 | |
| 6284 | 6555 | return retval; |
| @@ -6299,6 +6570,7 @@ class Ushort { | ||
| 6299 | 6570 | Ushort Ushort_from_JSON(mixed json) { |
| 6300 | 6571 | Ushort retval = Ushort(); |
| 6301 | 6572 | |
| 6573 | + if (!intp(json["ushort"])) error("Expected integer"); | |
| 6302 | 6574 | retval.ushort = json["ushort"]; |
| 6303 | 6575 | |
| 6304 | 6576 | return retval; |
| @@ -6319,6 +6591,7 @@ class Using { | ||
| 6319 | 6591 | Using Using_from_JSON(mixed json) { |
| 6320 | 6592 | Using retval = Using(); |
| 6321 | 6593 | |
| 6594 | + if (!intp(json["using"])) error("Expected integer"); | |
| 6322 | 6595 | retval.using = json["using"]; |
| 6323 | 6596 | |
| 6324 | 6597 | return retval; |
| @@ -6339,6 +6612,7 @@ class Var { | ||
| 6339 | 6612 | Var Var_from_JSON(mixed json) { |
| 6340 | 6613 | Var retval = Var(); |
| 6341 | 6614 | |
| 6615 | + if (!intp(json["var"])) error("Expected integer"); | |
| 6342 | 6616 | retval.var = json["var"]; |
| 6343 | 6617 | |
| 6344 | 6618 | return retval; |
| @@ -6359,6 +6633,7 @@ class Virtual { | ||
| 6359 | 6633 | Virtual Virtual_from_JSON(mixed json) { |
| 6360 | 6634 | Virtual retval = Virtual(); |
| 6361 | 6635 | |
| 6636 | + if (!intp(json["virtual"])) error("Expected integer"); | |
| 6362 | 6637 | retval.virtual = json["virtual"]; |
| 6363 | 6638 | |
| 6364 | 6639 | return retval; |
| @@ -6379,6 +6654,7 @@ class Volatile { | ||
| 6379 | 6654 | Volatile Volatile_from_JSON(mixed json) { |
| 6380 | 6655 | Volatile retval = Volatile(); |
| 6381 | 6656 | |
| 6657 | + if (!intp(json["volatile"])) error("Expected integer"); | |
| 6382 | 6658 | retval.volatile = json["volatile"]; |
| 6383 | 6659 | |
| 6384 | 6660 | return retval; |
| @@ -6399,6 +6675,7 @@ class WcharT { | ||
| 6399 | 6675 | WcharT WcharT_from_JSON(mixed json) { |
| 6400 | 6676 | WcharT retval = WcharT(); |
| 6401 | 6677 | |
| 6678 | + if (!intp(json["wchar_t"])) error("Expected integer"); | |
| 6402 | 6679 | retval.wchar_t = json["wchar_t"]; |
| 6403 | 6680 | |
| 6404 | 6681 | return retval; |
| @@ -6419,6 +6696,7 @@ class Weak { | ||
| 6419 | 6696 | Weak Weak_from_JSON(mixed json) { |
| 6420 | 6697 | Weak retval = Weak(); |
| 6421 | 6698 | |
| 6699 | + if (!intp(json["weak"])) error("Expected integer"); | |
| 6422 | 6700 | retval.weak = json["weak"]; |
| 6423 | 6701 | |
| 6424 | 6702 | return retval; |
| @@ -6439,6 +6717,7 @@ class Where { | ||
| 6439 | 6717 | Where Where_from_JSON(mixed json) { |
| 6440 | 6718 | Where retval = Where(); |
| 6441 | 6719 | |
| 6720 | + if (!intp(json["where"])) error("Expected integer"); | |
| 6442 | 6721 | retval.where = json["where"]; |
| 6443 | 6722 | |
| 6444 | 6723 | return retval; |
| @@ -6459,6 +6738,7 @@ class WillSet { | ||
| 6459 | 6738 | WillSet WillSet_from_JSON(mixed json) { |
| 6460 | 6739 | WillSet retval = WillSet(); |
| 6461 | 6740 | |
| 6741 | + if (!intp(json["willSet"])) error("Expected integer"); | |
| 6462 | 6742 | retval.will_set = json["willSet"]; |
| 6463 | 6743 | |
| 6464 | 6744 | return retval; |
| @@ -6479,6 +6759,7 @@ class With { | ||
| 6479 | 6759 | With With_from_JSON(mixed json) { |
| 6480 | 6760 | With retval = With(); |
| 6481 | 6761 | |
| 6762 | + if (!intp(json["with"])) error("Expected integer"); | |
| 6482 | 6763 | retval.with = json["with"]; |
| 6483 | 6764 | |
| 6484 | 6765 | return retval; |
| @@ -6499,6 +6780,7 @@ class Xor { | ||
| 6499 | 6780 | Xor Xor_from_JSON(mixed json) { |
| 6500 | 6781 | Xor retval = Xor(); |
| 6501 | 6782 | |
| 6783 | + if (!intp(json["xor"])) error("Expected integer"); | |
| 6502 | 6784 | retval.xor = json["xor"]; |
| 6503 | 6785 | |
| 6504 | 6786 | return retval; |
| @@ -6519,6 +6801,7 @@ class XorEq { | ||
| 6519 | 6801 | XorEq XorEq_from_JSON(mixed json) { |
| 6520 | 6802 | XorEq retval = XorEq(); |
| 6521 | 6803 | |
| 6804 | + if (!intp(json["xor_eq"])) error("Expected integer"); | |
| 6522 | 6805 | retval.xor_eq = json["xor_eq"]; |
| 6523 | 6806 | |
| 6524 | 6807 | return retval; |
| @@ -6539,6 +6822,7 @@ class Yes { | ||
| 6539 | 6822 | Yes Yes_from_JSON(mixed json) { |
| 6540 | 6823 | Yes retval = Yes(); |
| 6541 | 6824 | |
| 6825 | + if (!intp(json["YES"])) error("Expected integer"); | |
| 6542 | 6826 | retval.yes = json["YES"]; |
| 6543 | 6827 | |
| 6544 | 6828 | return retval; |
| @@ -6559,6 +6843,7 @@ class Yield { | ||
| 6559 | 6843 | Yield Yield_from_JSON(mixed json) { |
| 6560 | 6844 | Yield retval = Yield(); |
| 6561 | 6845 | |
| 6846 | + if (!intp(json["yield"])) error("Expected integer"); | |
| 6562 | 6847 | retval.yield = json["yield"]; |
| 6563 | 6848 | |
| 6564 | 6849 | 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 | retval.next = 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,14 +78,19 @@ 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 | retval.scorers = json["scorers"]; |
| 84 | 91 | retval.timeline = json["timeline"]; |
| 85 | 92 | retval.tm = json["tm"]; |
| 93 | + if (!intp(json["totalTimeAdded"])) error("Expected integer"); | |
| 86 | 94 | retval.total_time_added = json["totalTimeAdded"]; |
| 87 | 95 | retval.totallds = json["totallds"]; |
| 88 | 96 | |
| @@ -145,13 +153,16 @@ Othermatch Othermatch_from_JSON(mixed json) { | ||
| 145 | 153 | retval.clock = json["clock"]; |
| 146 | 154 | retval.competition_name = json["competitionName"]; |
| 147 | 155 | retval.id = json["id"]; |
| 156 | + if (!intp(json["period"])) error("Expected integer"); | |
| 148 | 157 | retval.period = json["period"]; |
| 149 | 158 | retval.period_type = PerType_from_JSON(json["periodType"]); |
| 150 | 159 | retval.team1 = json["team1"]; |
| 151 | 160 | retval.team1_name = json["team1Name"]; |
| 161 | + if (!intp(json["team1Score"])) error("Expected integer"); | |
| 152 | 162 | retval.team1_score = json["team1Score"]; |
| 153 | 163 | retval.team2 = json["team2"]; |
| 154 | 164 | retval.team2_name = json["team2Name"]; |
| 165 | + if (!intp(json["team2Score"])) error("Expected integer"); | |
| 155 | 166 | retval.team2_score = json["team2Score"]; |
| 156 | 167 | |
| 157 | 168 | return retval; |
| @@ -265,19 +276,27 @@ Pbp Pbp_from_JSON(mixed json) { | ||
| 265 | 276 | retval.international_family_name_initial = FamilyNameInitial_from_JSON(json["internationalFamilyNameInitial"]); |
| 266 | 277 | retval.international_first_name = json["internationalFirstName"]; |
| 267 | 278 | retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]); |
| 279 | + if (!intp(json["lead"])) error("Expected integer"); | |
| 268 | 280 | retval.lead = json["lead"]; |
| 281 | + if (!intp(json["period"])) error("Expected integer"); | |
| 269 | 282 | retval.period = json["period"]; |
| 270 | 283 | retval.period_type = PerType_from_JSON(json["periodType"]); |
| 271 | 284 | retval.player = json["player"]; |
| 285 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 272 | 286 | retval.pno = json["pno"]; |
| 273 | 287 | retval.qualifier = json["qualifier"]; |
| 288 | + if (!intp(json["s1"])) error("Expected integer"); | |
| 274 | 289 | retval.s1 = json["s1"]; |
| 290 | + if (!intp(json["s2"])) error("Expected integer"); | |
| 275 | 291 | retval.s2 = json["s2"]; |
| 276 | 292 | retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]); |
| 293 | + if (!intp(json["scoring"])) error("Expected integer"); | |
| 277 | 294 | retval.scoring = json["scoring"]; |
| 278 | 295 | retval.shirt_number = json["shirtNumber"]; |
| 279 | 296 | retval.sub_type = json["subType"]; |
| 297 | + if (!intp(json["success"])) error("Expected integer"); | |
| 280 | 298 | retval.success = json["success"]; |
| 299 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 281 | 300 | retval.tno = json["tno"]; |
| 282 | 301 | |
| 283 | 302 | return retval; |
| @@ -423,11 +442,13 @@ Scorer Scorer_from_JSON(mixed json) { | ||
| 423 | 442 | retval.per = json["per"]; |
| 424 | 443 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 425 | 444 | retval.player = json["player"]; |
| 445 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 426 | 446 | retval.pno = json["pno"]; |
| 427 | 447 | retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]); |
| 428 | 448 | retval.shirt_number = json["shirtNumber"]; |
| 429 | 449 | retval.summary = json["summary"]; |
| 430 | 450 | retval.times = json["times"]; |
| 451 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 431 | 452 | retval.tno = json["tno"]; |
| 432 | 453 | retval.tot = json["tot"]; |
| 433 | 454 | |
| @@ -454,6 +475,7 @@ Time Time_from_JSON(mixed json) { | ||
| 454 | 475 | Time retval = Time(); |
| 455 | 476 | |
| 456 | 477 | retval.gt = json["gt"]; |
| 478 | + if (!intp(json["per"])) error("Expected integer"); | |
| 457 | 479 | retval.per = json["per"]; |
| 458 | 480 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 459 | 481 | |
| @@ -605,68 +627,120 @@ Tm Tm_from_JSON(mixed json) { | ||
| 605 | 627 | |
| 606 | 628 | retval.code = json["code"]; |
| 607 | 629 | retval.code_international = json["codeInternational"]; |
| 630 | + if (!intp(json["fouls"])) error("Expected integer"); | |
| 608 | 631 | retval.fouls = json["fouls"]; |
| 632 | + if (!intp(json["full_score"])) error("Expected integer"); | |
| 609 | 633 | retval.full_score = json["full_score"]; |
| 610 | 634 | retval.lds = json["lds"]; |
| 611 | 635 | retval.logo = json["logo"]; |
| 612 | 636 | retval.name = json["name"]; |
| 613 | 637 | retval.name_international = json["nameInternational"]; |
| 638 | + if (!intp(json["p1_score"])) error("Expected integer"); | |
| 614 | 639 | retval.p1_score = json["p1_score"]; |
| 640 | + if (!intp(json["p2_score"])) error("Expected integer"); | |
| 615 | 641 | retval.p2_score = json["p2_score"]; |
| 642 | + if (!intp(json["p3_score"])) error("Expected integer"); | |
| 616 | 643 | retval.p3_score = json["p3_score"]; |
| 644 | + if (!intp(json["p4_score"])) error("Expected integer"); | |
| 617 | 645 | retval.p4_score = json["p4_score"]; |
| 618 | 646 | retval.pl = json["pl"]; |
| 647 | + if (!intp(json["score"])) error("Expected integer"); | |
| 619 | 648 | retval.score = json["score"]; |
| 620 | 649 | retval.scoring = json["scoring"]; |
| 621 | 650 | retval.short_name = json["shortName"]; |
| 622 | 651 | retval.short_name_international = json["shortNameInternational"]; |
| 623 | 652 | retval.shot = json["shot"]; |
| 653 | + if (!intp(json["timeouts"])) error("Expected integer"); | |
| 624 | 654 | retval.timeouts = json["timeouts"]; |
| 655 | + if (!intp(json["tot_eff_1"])) error("Expected integer"); | |
| 625 | 656 | retval.tot_eff_1 = json["tot_eff_1"]; |
| 657 | + if (!intp(json["tot_eff_2"])) error("Expected integer"); | |
| 626 | 658 | retval.tot_eff_2 = json["tot_eff_2"]; |
| 627 | 659 | retval.tot_eff_3 = (float)json["tot_eff_3"]; |
| 660 | + if (!intp(json["tot_eff_4"])) error("Expected integer"); | |
| 628 | 661 | retval.tot_eff_4 = json["tot_eff_4"]; |
| 662 | + if (!intp(json["tot_eff_5"])) error("Expected integer"); | |
| 629 | 663 | retval.tot_eff_5 = json["tot_eff_5"]; |
| 664 | + if (!intp(json["tot_eff_6"])) error("Expected integer"); | |
| 630 | 665 | retval.tot_eff_6 = json["tot_eff_6"]; |
| 666 | + if (!intp(json["tot_eff_7"])) error("Expected integer"); | |
| 631 | 667 | retval.tot_eff_7 = json["tot_eff_7"]; |
| 668 | + if (!intp(json["tot_sAssists"])) error("Expected integer"); | |
| 632 | 669 | retval.tot_s_assists = json["tot_sAssists"]; |
| 670 | + if (!intp(json["tot_sBenchPoints"])) error("Expected integer"); | |
| 633 | 671 | retval.tot_s_bench_points = json["tot_sBenchPoints"]; |
| 672 | + if (!intp(json["tot_sBiggestLead"])) error("Expected integer"); | |
| 634 | 673 | retval.tot_s_biggest_lead = json["tot_sBiggestLead"]; |
| 674 | + if (!intp(json["tot_sBiggestScoringRun"])) error("Expected integer"); | |
| 635 | 675 | retval.tot_s_biggest_scoring_run = json["tot_sBiggestScoringRun"]; |
| 676 | + if (!intp(json["tot_sBlocks"])) error("Expected integer"); | |
| 636 | 677 | retval.tot_s_blocks = json["tot_sBlocks"]; |
| 678 | + if (!intp(json["tot_sBlocksReceived"])) error("Expected integer"); | |
| 637 | 679 | retval.tot_s_blocks_received = json["tot_sBlocksReceived"]; |
| 680 | + if (!intp(json["tot_sFieldGoalsAttempted"])) error("Expected integer"); | |
| 638 | 681 | retval.tot_s_field_goals_attempted = json["tot_sFieldGoalsAttempted"]; |
| 682 | + if (!intp(json["tot_sFieldGoalsMade"])) error("Expected integer"); | |
| 639 | 683 | retval.tot_s_field_goals_made = json["tot_sFieldGoalsMade"]; |
| 684 | + if (!intp(json["tot_sFieldGoalsPercentage"])) error("Expected integer"); | |
| 640 | 685 | retval.tot_s_field_goals_percentage = json["tot_sFieldGoalsPercentage"]; |
| 686 | + if (!intp(json["tot_sFoulsOn"])) error("Expected integer"); | |
| 641 | 687 | retval.tot_s_fouls_on = json["tot_sFoulsOn"]; |
| 688 | + if (!intp(json["tot_sFoulsPersonal"])) error("Expected integer"); | |
| 642 | 689 | retval.tot_s_fouls_personal = json["tot_sFoulsPersonal"]; |
| 690 | + if (!intp(json["tot_sFoulsTeam"])) error("Expected integer"); | |
| 643 | 691 | retval.tot_s_fouls_team = json["tot_sFoulsTeam"]; |
| 692 | + if (!intp(json["tot_sFreeThrowsAttempted"])) error("Expected integer"); | |
| 644 | 693 | retval.tot_s_free_throws_attempted = json["tot_sFreeThrowsAttempted"]; |
| 694 | + if (!intp(json["tot_sFreeThrowsMade"])) error("Expected integer"); | |
| 645 | 695 | retval.tot_s_free_throws_made = json["tot_sFreeThrowsMade"]; |
| 696 | + if (!intp(json["tot_sFreeThrowsPercentage"])) error("Expected integer"); | |
| 646 | 697 | retval.tot_s_free_throws_percentage = json["tot_sFreeThrowsPercentage"]; |
| 698 | + if (!intp(json["tot_sLeadChanges"])) error("Expected integer"); | |
| 647 | 699 | retval.tot_s_lead_changes = json["tot_sLeadChanges"]; |
| 700 | + if (!intp(json["tot_sMinutes"])) error("Expected integer"); | |
| 648 | 701 | retval.tot_s_minutes = json["tot_sMinutes"]; |
| 702 | + if (!intp(json["tot_sPoints"])) error("Expected integer"); | |
| 649 | 703 | retval.tot_s_points = json["tot_sPoints"]; |
| 704 | + if (!intp(json["tot_sPointsFastBreak"])) error("Expected integer"); | |
| 650 | 705 | retval.tot_s_points_fast_break = json["tot_sPointsFastBreak"]; |
| 706 | + if (!intp(json["tot_sPointsFromTurnovers"])) error("Expected integer"); | |
| 651 | 707 | retval.tot_s_points_from_turnovers = json["tot_sPointsFromTurnovers"]; |
| 708 | + if (!intp(json["tot_sPointsInThePaint"])) error("Expected integer"); | |
| 652 | 709 | retval.tot_s_points_in_the_paint = json["tot_sPointsInThePaint"]; |
| 710 | + if (!intp(json["tot_sPointsSecondChance"])) error("Expected integer"); | |
| 653 | 711 | retval.tot_s_points_second_chance = json["tot_sPointsSecondChance"]; |
| 712 | + if (!intp(json["tot_sReboundsDefensive"])) error("Expected integer"); | |
| 654 | 713 | retval.tot_s_rebounds_defensive = json["tot_sReboundsDefensive"]; |
| 714 | + if (!intp(json["tot_sReboundsOffensive"])) error("Expected integer"); | |
| 655 | 715 | retval.tot_s_rebounds_offensive = json["tot_sReboundsOffensive"]; |
| 716 | + if (!intp(json["tot_sReboundsTeam"])) error("Expected integer"); | |
| 656 | 717 | retval.tot_s_rebounds_team = json["tot_sReboundsTeam"]; |
| 718 | + if (!intp(json["tot_sReboundsTeamDefensive"])) error("Expected integer"); | |
| 657 | 719 | retval.tot_s_rebounds_team_defensive = json["tot_sReboundsTeamDefensive"]; |
| 720 | + if (!intp(json["tot_sReboundsTeamOffensive"])) error("Expected integer"); | |
| 658 | 721 | retval.tot_s_rebounds_team_offensive = json["tot_sReboundsTeamOffensive"]; |
| 722 | + if (!intp(json["tot_sReboundsTotal"])) error("Expected integer"); | |
| 659 | 723 | retval.tot_s_rebounds_total = json["tot_sReboundsTotal"]; |
| 724 | + if (!intp(json["tot_sSteals"])) error("Expected integer"); | |
| 660 | 725 | retval.tot_s_steals = json["tot_sSteals"]; |
| 726 | + if (!intp(json["tot_sThreePointersAttempted"])) error("Expected integer"); | |
| 661 | 727 | retval.tot_s_three_pointers_attempted = json["tot_sThreePointersAttempted"]; |
| 728 | + if (!intp(json["tot_sThreePointersMade"])) error("Expected integer"); | |
| 662 | 729 | retval.tot_s_three_pointers_made = json["tot_sThreePointersMade"]; |
| 730 | + if (!intp(json["tot_sThreePointersPercentage"])) error("Expected integer"); | |
| 663 | 731 | retval.tot_s_three_pointers_percentage = json["tot_sThreePointersPercentage"]; |
| 664 | 732 | retval.tot_s_time_leading = (float)json["tot_sTimeLeading"]; |
| 733 | + if (!intp(json["tot_sTimesScoresLevel"])) error("Expected integer"); | |
| 665 | 734 | retval.tot_s_times_scores_level = json["tot_sTimesScoresLevel"]; |
| 735 | + if (!intp(json["tot_sTurnovers"])) error("Expected integer"); | |
| 666 | 736 | retval.tot_s_turnovers = json["tot_sTurnovers"]; |
| 737 | + if (!intp(json["tot_sTurnoversTeam"])) error("Expected integer"); | |
| 667 | 738 | retval.tot_s_turnovers_team = json["tot_sTurnoversTeam"]; |
| 739 | + if (!intp(json["tot_sTwoPointersAttempted"])) error("Expected integer"); | |
| 668 | 740 | retval.tot_s_two_pointers_attempted = json["tot_sTwoPointersAttempted"]; |
| 741 | + if (!intp(json["tot_sTwoPointersMade"])) error("Expected integer"); | |
| 669 | 742 | retval.tot_s_two_pointers_made = json["tot_sTwoPointersMade"]; |
| 743 | + if (!intp(json["tot_sTwoPointersPercentage"])) error("Expected integer"); | |
| 670 | 744 | retval.tot_s_two_pointers_percentage = json["tot_sTwoPointersPercentage"]; |
| 671 | 745 | |
| 672 | 746 | return retval; |
| @@ -837,15 +911,21 @@ class Pl { | ||
| 837 | 911 | Pl Pl_from_JSON(mixed json) { |
| 838 | 912 | Pl retval = Pl(); |
| 839 | 913 | |
| 914 | + if (!intp(json["active"])) error("Expected integer"); | |
| 840 | 915 | retval.active = json["active"]; |
| 841 | 916 | retval.captain = json["captain"]; |
| 842 | 917 | retval.comp = json["comp"]; |
| 918 | + if (!intp(json["eff_1"])) error("Expected integer"); | |
| 843 | 919 | retval.eff_1 = json["eff_1"]; |
| 920 | + if (!intp(json["eff_2"])) error("Expected integer"); | |
| 844 | 921 | retval.eff_2 = json["eff_2"]; |
| 845 | 922 | retval.eff_3 = (float)json["eff_3"]; |
| 846 | 923 | retval.eff_4 = (float)json["eff_4"]; |
| 924 | + if (!intp(json["eff_5"])) error("Expected integer"); | |
| 847 | 925 | retval.eff_5 = json["eff_5"]; |
| 926 | + if (!intp(json["eff_6"])) error("Expected integer"); | |
| 848 | 927 | retval.eff_6 = json["eff_6"]; |
| 928 | + if (!intp(json["eff_7"])) error("Expected integer"); | |
| 849 | 929 | retval.eff_7 = json["eff_7"]; |
| 850 | 930 | retval.family_name = json["familyName"]; |
| 851 | 931 | retval.family_name_initial = FamilyNameInitial_from_JSON(json["familyNameInitial"]); |
| @@ -857,36 +937,64 @@ Pl Pl_from_JSON(mixed json) { | ||
| 857 | 937 | retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]); |
| 858 | 938 | retval.name = json["name"]; |
| 859 | 939 | retval.playing_position = json["playingPosition"]; |
| 940 | + if (!intp(json["sAssists"])) error("Expected integer"); | |
| 860 | 941 | retval.s_assists = json["sAssists"]; |
| 942 | + if (!intp(json["sBlocks"])) error("Expected integer"); | |
| 861 | 943 | retval.s_blocks = json["sBlocks"]; |
| 944 | + if (!intp(json["sBlocksReceived"])) error("Expected integer"); | |
| 862 | 945 | retval.s_blocks_received = json["sBlocksReceived"]; |
| 946 | + if (!intp(json["sFieldGoalsAttempted"])) error("Expected integer"); | |
| 863 | 947 | retval.s_field_goals_attempted = json["sFieldGoalsAttempted"]; |
| 948 | + if (!intp(json["sFieldGoalsMade"])) error("Expected integer"); | |
| 864 | 949 | retval.s_field_goals_made = json["sFieldGoalsMade"]; |
| 950 | + if (!intp(json["sFieldGoalsPercentage"])) error("Expected integer"); | |
| 865 | 951 | retval.s_field_goals_percentage = json["sFieldGoalsPercentage"]; |
| 952 | + if (!intp(json["sFoulsOn"])) error("Expected integer"); | |
| 866 | 953 | retval.s_fouls_on = json["sFoulsOn"]; |
| 954 | + if (!intp(json["sFoulsPersonal"])) error("Expected integer"); | |
| 867 | 955 | retval.s_fouls_personal = json["sFoulsPersonal"]; |
| 956 | + if (!intp(json["sFreeThrowsAttempted"])) error("Expected integer"); | |
| 868 | 957 | retval.s_free_throws_attempted = json["sFreeThrowsAttempted"]; |
| 958 | + if (!intp(json["sFreeThrowsMade"])) error("Expected integer"); | |
| 869 | 959 | retval.s_free_throws_made = json["sFreeThrowsMade"]; |
| 960 | + if (!intp(json["sFreeThrowsPercentage"])) error("Expected integer"); | |
| 870 | 961 | retval.s_free_throws_percentage = json["sFreeThrowsPercentage"]; |
| 871 | 962 | if (arrayp(json["sMinutes"])) error("Unexpected array"); |
| 872 | 963 | retval.s_minutes = json["sMinutes"]; |
| 964 | + if (!intp(json["sPlusMinusPoints"])) error("Expected integer"); | |
| 873 | 965 | retval.s_plus_minus_points = json["sPlusMinusPoints"]; |
| 966 | + if (!intp(json["sPoints"])) error("Expected integer"); | |
| 874 | 967 | retval.s_points = json["sPoints"]; |
| 968 | + if (!intp(json["sPointsFastBreak"])) error("Expected integer"); | |
| 875 | 969 | retval.s_points_fast_break = json["sPointsFastBreak"]; |
| 970 | + if (!intp(json["sPointsInThePaint"])) error("Expected integer"); | |
| 876 | 971 | retval.s_points_in_the_paint = json["sPointsInThePaint"]; |
| 972 | + if (!intp(json["sPointsSecondChance"])) error("Expected integer"); | |
| 877 | 973 | retval.s_points_second_chance = json["sPointsSecondChance"]; |
| 974 | + if (!intp(json["sReboundsDefensive"])) error("Expected integer"); | |
| 878 | 975 | retval.s_rebounds_defensive = json["sReboundsDefensive"]; |
| 976 | + if (!intp(json["sReboundsOffensive"])) error("Expected integer"); | |
| 879 | 977 | retval.s_rebounds_offensive = json["sReboundsOffensive"]; |
| 978 | + if (!intp(json["sReboundsTotal"])) error("Expected integer"); | |
| 880 | 979 | retval.s_rebounds_total = json["sReboundsTotal"]; |
| 980 | + if (!intp(json["sSteals"])) error("Expected integer"); | |
| 881 | 981 | retval.s_steals = json["sSteals"]; |
| 982 | + if (!intp(json["sThreePointersAttempted"])) error("Expected integer"); | |
| 882 | 983 | retval.s_three_pointers_attempted = json["sThreePointersAttempted"]; |
| 984 | + if (!intp(json["sThreePointersMade"])) error("Expected integer"); | |
| 883 | 985 | retval.s_three_pointers_made = json["sThreePointersMade"]; |
| 986 | + if (!intp(json["sThreePointersPercentage"])) error("Expected integer"); | |
| 884 | 987 | retval.s_three_pointers_percentage = json["sThreePointersPercentage"]; |
| 988 | + if (!intp(json["sTurnovers"])) error("Expected integer"); | |
| 885 | 989 | retval.s_turnovers = json["sTurnovers"]; |
| 990 | + if (!intp(json["sTwoPointersAttempted"])) error("Expected integer"); | |
| 886 | 991 | retval.s_two_pointers_attempted = json["sTwoPointersAttempted"]; |
| 992 | + if (!intp(json["sTwoPointersMade"])) error("Expected integer"); | |
| 887 | 993 | retval.s_two_pointers_made = json["sTwoPointersMade"]; |
| 994 | + if (!intp(json["sTwoPointersPercentage"])) error("Expected integer"); | |
| 888 | 995 | retval.s_two_pointers_percentage = json["sTwoPointersPercentage"]; |
| 889 | 996 | retval.shirt_number = json["shirtNumber"]; |
| 997 | + if (!intp(json["starter"])) error("Expected integer"); | |
| 890 | 998 | retval.starter = json["starter"]; |
| 891 | 999 | |
| 892 | 1000 | return retval; |
| @@ -965,16 +1073,23 @@ Shot Shot_from_JSON(mixed json) { | ||
| 965 | 1073 | Shot retval = Shot(); |
| 966 | 1074 | |
| 967 | 1075 | retval.action_type = ActionType_from_JSON(json["actionType"]); |
| 1076 | + if (!intp(json["p"])) error("Expected integer"); | |
| 968 | 1077 | retval.p = json["p"]; |
| 1078 | + if (!intp(json["per"])) error("Expected integer"); | |
| 969 | 1079 | retval.per = json["per"]; |
| 970 | 1080 | retval.per_type = PerType_from_JSON(json["perType"]); |
| 971 | 1081 | retval.player = json["player"]; |
| 1082 | + if (!intp(json["pno"])) error("Expected integer"); | |
| 972 | 1083 | retval.pno = json["pno"]; |
| 1084 | + if (!intp(json["r"])) error("Expected integer"); | |
| 973 | 1085 | retval.r = json["r"]; |
| 974 | 1086 | retval.shirt_number = json["shirtNumber"]; |
| 975 | 1087 | retval.sub_type = SubType_from_JSON(json["subType"]); |
| 1088 | + if (!intp(json["tno"])) error("Expected integer"); | |
| 976 | 1089 | retval.tno = json["tno"]; |
| 1090 | + if (!intp(json["x"])) error("Expected integer"); | |
| 977 | 1091 | retval.x = json["x"]; |
| 1092 | + if (!intp(json["y"])) error("Expected integer"); | |
| 978 | 1093 | retval.y = json["y"]; |
| 979 | 1094 | |
| 980 | 1095 | return retval; |
Test case
1 generated file · +3 −0test/inputs/json/priority/nst-test-suite.json
Mpikedefault / TopLevel.pmod+3 −0
| @@ -296,6 +296,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 296 | 296 | retval.y_string_with_del_character_json = json["y_string_with_del_character.json"]; |
| 297 | 297 | if (json["y_structure_lonely_false.json"] != Standards.JSON.true && json["y_structure_lonely_false.json"] != Standards.JSON.false) error("Expected bool"); |
| 298 | 298 | retval.y_structure_lonely_false_json = json["y_structure_lonely_false.json"]; |
| 299 | + if (!intp(json["y_structure_lonely_int.json"])) error("Expected integer"); | |
| 299 | 300 | retval.y_structure_lonely_int_json = json["y_structure_lonely_int.json"]; |
| 300 | 301 | retval.y_structure_lonely_negative_real_json = (float)json["y_structure_lonely_negative_real.json"]; |
| 301 | 302 | retval.y_structure_lonely_null_json = json["y_structure_lonely_null.json"]; |
| @@ -367,6 +368,7 @@ class YObjectEmptyKeyJson { | ||
| 367 | 368 | YObjectEmptyKeyJson YObjectEmptyKeyJson_from_JSON(mixed json) { |
| 368 | 369 | YObjectEmptyKeyJson retval = YObjectEmptyKeyJson(); |
| 369 | 370 | |
| 371 | + if (!intp(json[""])) error("Expected integer"); | |
| 370 | 372 | retval.empty = json[""]; |
| 371 | 373 | |
| 372 | 374 | return retval; |
| @@ -387,6 +389,7 @@ class YObjectEscapedNullInKeyJson { | ||
| 387 | 389 | YObjectEscapedNullInKeyJson YObjectEscapedNullInKeyJson_from_JSON(mixed json) { |
| 388 | 390 | YObjectEscapedNullInKeyJson retval = YObjectEscapedNullInKeyJson(); |
| 389 | 391 | |
| 392 | + if (!intp(json["foo\u0000bar"])) error("Expected integer"); | |
| 390 | 393 | retval.foo_bar = json["foo\u0000bar"]; |
| 391 | 394 | |
| 392 | 395 | 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
| @@ -48,13 +48,18 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 48 | 48 | retval.category = json["category"]; |
| 49 | 49 | retval.details = json["details"]; |
| 50 | 50 | retval.match = json["match"]; |
| 51 | + if (!intp(json["page"])) error("Expected integer"); | |
| 51 | 52 | retval.page = json["page"]; |
| 52 | 53 | retval.product = json["product"]; |
| 53 | 54 | if (json["schk"] != Standards.JSON.true && json["schk"] != Standards.JSON.false) error("Expected bool"); |
| 54 | 55 | retval.schk = json["schk"]; |
| 56 | + if (!intp(json["totallooseoffers"])) error("Expected integer"); | |
| 55 | 57 | retval.totallooseoffers = json["totallooseoffers"]; |
| 58 | + if (!intp(json["totalpages"])) error("Expected integer"); | |
| 56 | 59 | retval.totalpages = json["totalpages"]; |
| 60 | + if (!intp(json["totalresultsavailable"])) error("Expected integer"); | |
| 57 | 61 | retval.totalresultsavailable = json["totalresultsavailable"]; |
| 62 | + if (!intp(json["totalresultsreturned"])) error("Expected integer"); | |
| 58 | 63 | retval.totalresultsreturned = json["totalresultsreturned"]; |
| 59 | 64 | |
| 60 | 65 | return retval; |
| @@ -93,11 +98,13 @@ Category Category_from_JSON(mixed json) { | ||
| 93 | 98 | retval.concatenatecategoryname = json["concatenatecategoryname"]; |
| 94 | 99 | if (json["hasoffer"] != Standards.JSON.true && json["hasoffer"] != Standards.JSON.false) error("Expected bool"); |
| 95 | 100 | retval.hasoffer = json["hasoffer"]; |
| 101 | + if (!intp(json["id"])) error("Expected integer"); | |
| 96 | 102 | retval.id = json["id"]; |
| 97 | 103 | if (json["isfinal"] != Standards.JSON.true && json["isfinal"] != Standards.JSON.false) error("Expected bool"); |
| 98 | 104 | retval.isfinal = json["isfinal"]; |
| 99 | 105 | retval.links = json["links"]; |
| 100 | 106 | retval.name = json["name"]; |
| 107 | + if (!intp(json["parentcategoryid"])) error("Expected integer"); | |
| 101 | 108 | retval.parentcategoryid = json["parentcategoryid"]; |
| 102 | 109 | retval.thumbnail = json["thumbnail"]; |
| 103 | 110 | |
| @@ -196,8 +203,10 @@ Details Details_from_JSON(mixed json) { | ||
| 196 | 203 | |
| 197 | 204 | retval.applicationid = json["applicationid"]; |
| 198 | 205 | retval.applicationversion = json["applicationversion"]; |
| 206 | + if (!intp(json["code"])) error("Expected integer"); | |
| 199 | 207 | retval.code = json["code"]; |
| 200 | 208 | retval.date = json["date"]; |
| 209 | + if (!intp(json["elapsedtime"])) error("Expected integer"); | |
| 201 | 210 | retval.elapsedtime = json["elapsedtime"]; |
| 202 | 211 | retval.message = json["message"]; |
| 203 | 212 | retval.status = json["status"]; |
| @@ -240,17 +249,25 @@ class Date { | ||
| 240 | 249 | Date Date_from_JSON(mixed json) { |
| 241 | 250 | Date retval = Date(); |
| 242 | 251 | |
| 252 | + if (!intp(json["day"])) error("Expected integer"); | |
| 243 | 253 | retval.day = json["day"]; |
| 244 | 254 | retval.eonandyear = json["eonandyear"]; |
| 255 | + if (!intp(json["hour"])) error("Expected integer"); | |
| 245 | 256 | retval.hour = json["hour"]; |
| 257 | + if (!intp(json["millisecond"])) error("Expected integer"); | |
| 246 | 258 | retval.millisecond = json["millisecond"]; |
| 259 | + if (!intp(json["minute"])) error("Expected integer"); | |
| 247 | 260 | retval.minute = json["minute"]; |
| 261 | + if (!intp(json["month"])) error("Expected integer"); | |
| 248 | 262 | retval.month = json["month"]; |
| 263 | + if (!intp(json["second"])) error("Expected integer"); | |
| 249 | 264 | retval.second = json["second"]; |
| 265 | + if (!intp(json["timezone"])) error("Expected integer"); | |
| 250 | 266 | retval.timezone = json["timezone"]; |
| 251 | 267 | if (json["valid"] != Standards.JSON.true && json["valid"] != Standards.JSON.false) error("Expected bool"); |
| 252 | 268 | retval.valid = json["valid"]; |
| 253 | 269 | retval.xmlschematype = json["xmlschematype"]; |
| 270 | + if (!intp(json["year"])) error("Expected integer"); | |
| 254 | 271 | retval.year = json["year"]; |
| 255 | 272 | |
| 256 | 273 | return retval; |
| @@ -271,6 +288,7 @@ class Eonandyear { | ||
| 271 | 288 | Eonandyear Eonandyear_from_JSON(mixed json) { |
| 272 | 289 | Eonandyear retval = Eonandyear(); |
| 273 | 290 | |
| 291 | + if (!intp(json["lowestsetbit"])) error("Expected integer"); | |
| 274 | 292 | retval.lowestsetbit = json["lowestsetbit"]; |
| 275 | 293 | |
| 276 | 294 | return retval; |
| @@ -367,6 +385,7 @@ class ProductProduct { | ||
| 367 | 385 | ProductProduct ProductProduct_from_JSON(mixed json) { |
| 368 | 386 | ProductProduct retval = ProductProduct(); |
| 369 | 387 | |
| 388 | + if (!intp(json["categoryid"])) error("Expected integer"); | |
| 370 | 389 | retval.categoryid = json["categoryid"]; |
| 371 | 390 | retval.currency = json["currency"]; |
| 372 | 391 | if (json["eco"] != Standards.JSON.true && json["eco"] != Standards.JSON.false) error("Expected bool"); |
| @@ -375,16 +394,20 @@ ProductProduct ProductProduct_from_JSON(mixed json) { | ||
| 375 | 394 | retval.fulldescription = json["fulldescription"]; |
| 376 | 395 | if (json["hasmetasearch"] != Standards.JSON.true && json["hasmetasearch"] != Standards.JSON.false) error("Expected bool"); |
| 377 | 396 | retval.hasmetasearch = json["hasmetasearch"]; |
| 397 | + if (!intp(json["id"])) error("Expected integer"); | |
| 378 | 398 | retval.id = json["id"]; |
| 379 | 399 | retval.links = json["links"]; |
| 400 | + if (!intp(json["numoffers"])) error("Expected integer"); | |
| 380 | 401 | retval.numoffers = json["numoffers"]; |
| 381 | 402 | retval.pricemax = json["pricemax"]; |
| 382 | 403 | retval.pricemin = json["pricemin"]; |
| 383 | 404 | retval.productname = json["productname"]; |
| 405 | + if (!intp(json["quantity"])) error("Expected integer"); | |
| 384 | 406 | retval.quantity = json["quantity"]; |
| 385 | 407 | retval.rating = json["rating"]; |
| 386 | 408 | retval.specification = json["specification"]; |
| 387 | 409 | retval.thumbnail = json["thumbnail"]; |
| 410 | + if (!intp(json["totalsellers"])) error("Expected integer"); | |
| 388 | 411 | retval.totalsellers = json["totalsellers"]; |
| 389 | 412 | |
| 390 | 413 | return retval; |
| @@ -450,6 +473,7 @@ Useraveragerating Useraveragerating_from_JSON(mixed json) { | ||
| 450 | 473 | Useraveragerating retval = Useraveragerating(); |
| 451 | 474 | |
| 452 | 475 | retval.links = json["links"]; |
| 476 | + if (!intp(json["numcomments"])) error("Expected integer"); | |
| 453 | 477 | retval.numcomments = json["numcomments"]; |
| 454 | 478 | retval.rating = json["rating"]; |
| 455 | 479 | |
| @@ -518,8 +542,10 @@ FormatsClass FormatsClass_from_JSON(mixed json) { | ||
| 518 | 542 | FormatsClass retval = FormatsClass(); |
| 519 | 543 | |
| 520 | 544 | retval.formats = json["formats"]; |
| 545 | + if (!intp(json["height"])) error("Expected integer"); | |
| 521 | 546 | retval.height = json["height"]; |
| 522 | 547 | retval.url = json["url"]; |
| 548 | + if (!intp(json["width"])) error("Expected integer"); | |
| 523 | 549 | retval.width = json["width"]; |
| 524 | 550 | |
| 525 | 551 | 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
| @@ -88,6 +88,7 @@ Actor Actor_from_JSON(mixed json) { | ||
| 88 | 88 | retval.avatar_url = json["avatar_url"]; |
| 89 | 89 | retval.display_login = json["display_login"]; |
| 90 | 90 | retval.gravatar_id = json["gravatar_id"]; |
| 91 | + if (!intp(json["id"])) error("Expected integer"); | |
| 91 | 92 | retval.id = json["id"]; |
| 92 | 93 | retval.login = json["login"]; |
| 93 | 94 | retval.url = json["url"]; |
| @@ -192,6 +193,7 @@ Comment Comment_from_JSON(mixed json) { | ||
| 192 | 193 | retval.body = json["body"]; |
| 193 | 194 | retval.created_at = json["created_at"]; |
| 194 | 195 | retval.html_url = json["html_url"]; |
| 196 | + if (!intp(json["id"])) error("Expected integer"); | |
| 195 | 197 | retval.id = json["id"]; |
| 196 | 198 | retval.issue_url = json["issue_url"]; |
| 197 | 199 | retval.updated_at = json["updated_at"]; |
| @@ -255,6 +257,7 @@ User User_from_JSON(mixed json) { | ||
| 255 | 257 | retval.gists_url = json["gists_url"]; |
| 256 | 258 | retval.gravatar_id = json["gravatar_id"]; |
| 257 | 259 | retval.html_url = json["html_url"]; |
| 260 | + if (!intp(json["id"])) error("Expected integer"); | |
| 258 | 261 | retval.id = json["id"]; |
| 259 | 262 | retval.login = json["login"]; |
| 260 | 263 | retval.organizations_url = json["organizations_url"]; |
| @@ -397,11 +400,13 @@ Issue Issue_from_JSON(mixed json) { | ||
| 397 | 400 | retval.body = json["body"]; |
| 398 | 401 | if (!has_index(json, "closed_at")) error("Missing required property"); |
| 399 | 402 | retval.closed_at = json["closed_at"]; |
| 403 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 400 | 404 | retval.comments = json["comments"]; |
| 401 | 405 | retval.comments_url = json["comments_url"]; |
| 402 | 406 | retval.created_at = json["created_at"]; |
| 403 | 407 | retval.events_url = json["events_url"]; |
| 404 | 408 | retval.html_url = json["html_url"]; |
| 409 | + if (!intp(json["id"])) error("Expected integer"); | |
| 405 | 410 | retval.id = json["id"]; |
| 406 | 411 | retval.labels = json["labels"]; |
| 407 | 412 | retval.labels_url = json["labels_url"]; |
| @@ -409,6 +414,7 @@ Issue Issue_from_JSON(mixed json) { | ||
| 409 | 414 | retval.locked = json["locked"]; |
| 410 | 415 | if (!has_index(json, "milestone")) error("Missing required property"); |
| 411 | 416 | retval.milestone = json["milestone"]; |
| 417 | + if (!intp(json["number"])) error("Expected integer"); | |
| 412 | 418 | retval.number = json["number"]; |
| 413 | 419 | retval.pull_request = json["pull_request"]; |
| 414 | 420 | retval.repository_url = json["repository_url"]; |
| @@ -445,6 +451,7 @@ Label Label_from_JSON(mixed json) { | ||
| 445 | 451 | Label retval = Label(); |
| 446 | 452 | |
| 447 | 453 | retval.color = json["color"]; |
| 454 | + if (!intp(json["id"])) error("Expected integer"); | |
| 448 | 455 | retval.id = json["id"]; |
| 449 | 456 | if (json["default"] != Standards.JSON.true && json["default"] != Standards.JSON.false) error("Expected bool"); |
| 450 | 457 | retval.label_default = json["default"]; |
| @@ -498,6 +505,7 @@ Milestone Milestone_from_JSON(mixed json) { | ||
| 498 | 505 | Milestone retval = Milestone(); |
| 499 | 506 | |
| 500 | 507 | retval.closed_at = json["closed_at"]; |
| 508 | + if (!intp(json["closed_issues"])) error("Expected integer"); | |
| 501 | 509 | retval.closed_issues = json["closed_issues"]; |
| 502 | 510 | retval.created_at = json["created_at"]; |
| 503 | 511 | retval.creator = json["creator"]; |
| @@ -505,9 +513,12 @@ Milestone Milestone_from_JSON(mixed json) { | ||
| 505 | 513 | if (!has_index(json, "due_on")) error("Missing required property"); |
| 506 | 514 | retval.due_on = json["due_on"]; |
| 507 | 515 | retval.html_url = json["html_url"]; |
| 516 | + if (!intp(json["id"])) error("Expected integer"); | |
| 508 | 517 | retval.id = json["id"]; |
| 509 | 518 | retval.labels_url = json["labels_url"]; |
| 519 | + if (!intp(json["number"])) error("Expected integer"); | |
| 510 | 520 | retval.number = json["number"]; |
| 521 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 511 | 522 | retval.open_issues = json["open_issues"]; |
| 512 | 523 | retval.state = json["state"]; |
| 513 | 524 | retval.title = json["title"]; |
| @@ -641,22 +652,28 @@ class PayloadPullRequest { | ||
| 641 | 652 | PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) { |
| 642 | 653 | PayloadPullRequest retval = PayloadPullRequest(); |
| 643 | 654 | |
| 655 | + if (!intp(json["additions"])) error("Expected integer"); | |
| 644 | 656 | retval.additions = json["additions"]; |
| 645 | 657 | retval.assignee = json["assignee"]; |
| 646 | 658 | retval.assignees = json["assignees"]; |
| 647 | 659 | retval.base = json["base"]; |
| 648 | 660 | retval.body = json["body"]; |
| 661 | + if (!intp(json["changed_files"])) error("Expected integer"); | |
| 649 | 662 | retval.changed_files = json["changed_files"]; |
| 650 | 663 | retval.closed_at = json["closed_at"]; |
| 664 | + if (!intp(json["comments"])) error("Expected integer"); | |
| 651 | 665 | retval.comments = json["comments"]; |
| 652 | 666 | retval.comments_url = json["comments_url"]; |
| 667 | + if (!intp(json["commits"])) error("Expected integer"); | |
| 653 | 668 | retval.commits = json["commits"]; |
| 654 | 669 | retval.commits_url = json["commits_url"]; |
| 655 | 670 | retval.created_at = json["created_at"]; |
| 671 | + if (!intp(json["deletions"])) error("Expected integer"); | |
| 656 | 672 | retval.deletions = json["deletions"]; |
| 657 | 673 | retval.diff_url = json["diff_url"]; |
| 658 | 674 | retval.head = json["head"]; |
| 659 | 675 | retval.html_url = json["html_url"]; |
| 676 | + if (!intp(json["id"])) error("Expected integer"); | |
| 660 | 677 | retval.id = json["id"]; |
| 661 | 678 | retval.issue_url = json["issue_url"]; |
| 662 | 679 | retval.links = json["_links"]; |
| @@ -672,11 +689,13 @@ PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) { | ||
| 672 | 689 | retval.merged_at = json["merged_at"]; |
| 673 | 690 | retval.merged_by = json["merged_by"]; |
| 674 | 691 | retval.milestone = json["milestone"]; |
| 692 | + if (!intp(json["number"])) error("Expected integer"); | |
| 675 | 693 | retval.number = json["number"]; |
| 676 | 694 | retval.patch_url = json["patch_url"]; |
| 677 | 695 | retval.rebaseable = json["rebaseable"]; |
| 678 | 696 | retval.requested_reviewers = json["requested_reviewers"]; |
| 679 | 697 | retval.review_comment_url = json["review_comment_url"]; |
| 698 | + if (!intp(json["review_comments"])) error("Expected integer"); | |
| 680 | 699 | retval.review_comments = json["review_comments"]; |
| 681 | 700 | retval.review_comments_url = json["review_comments_url"]; |
| 682 | 701 | retval.state = json["state"]; |
| @@ -891,7 +910,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 891 | 910 | retval.events_url = json["events_url"]; |
| 892 | 911 | if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool"); |
| 893 | 912 | retval.fork = json["fork"]; |
| 913 | + if (!intp(json["forks"])) error("Expected integer"); | |
| 894 | 914 | retval.forks = json["forks"]; |
| 915 | + if (!intp(json["forks_count"])) error("Expected integer"); | |
| 895 | 916 | retval.forks_count = json["forks_count"]; |
| 896 | 917 | retval.forks_url = json["forks_url"]; |
| 897 | 918 | retval.full_name = json["full_name"]; |
| @@ -912,6 +933,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 912 | 933 | retval.homepage = json["homepage"]; |
| 913 | 934 | retval.hooks_url = json["hooks_url"]; |
| 914 | 935 | retval.html_url = json["html_url"]; |
| 936 | + if (!intp(json["id"])) error("Expected integer"); | |
| 915 | 937 | retval.id = json["id"]; |
| 916 | 938 | retval.issue_comment_url = json["issue_comment_url"]; |
| 917 | 939 | retval.issue_events_url = json["issue_events_url"]; |
| @@ -925,7 +947,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 925 | 947 | retval.mirror_url = json["mirror_url"]; |
| 926 | 948 | retval.name = json["name"]; |
| 927 | 949 | retval.notifications_url = json["notifications_url"]; |
| 950 | + if (!intp(json["open_issues"])) error("Expected integer"); | |
| 928 | 951 | retval.open_issues = json["open_issues"]; |
| 952 | + if (!intp(json["open_issues_count"])) error("Expected integer"); | |
| 929 | 953 | retval.open_issues_count = json["open_issues_count"]; |
| 930 | 954 | retval.owner = json["owner"]; |
| 931 | 955 | retval.pulls_url = json["pulls_url"]; |
| @@ -933,8 +957,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 933 | 957 | retval.releases_url = json["releases_url"]; |
| 934 | 958 | if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool"); |
| 935 | 959 | retval.repo_private = json["private"]; |
| 960 | + if (!intp(json["size"])) error("Expected integer"); | |
| 936 | 961 | retval.size = json["size"]; |
| 937 | 962 | retval.ssh_url = json["ssh_url"]; |
| 963 | + if (!intp(json["stargazers_count"])) error("Expected integer"); | |
| 938 | 964 | retval.stargazers_count = json["stargazers_count"]; |
| 939 | 965 | retval.stargazers_url = json["stargazers_url"]; |
| 940 | 966 | retval.statuses_url = json["statuses_url"]; |
| @@ -946,7 +972,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) { | ||
| 946 | 972 | retval.trees_url = json["trees_url"]; |
| 947 | 973 | retval.updated_at = json["updated_at"]; |
| 948 | 974 | retval.url = json["url"]; |
| 975 | + if (!intp(json["watchers"])) error("Expected integer"); | |
| 949 | 976 | retval.watchers = json["watchers"]; |
| 977 | + if (!intp(json["watchers_count"])) error("Expected integer"); | |
| 950 | 978 | retval.watchers_count = json["watchers_count"]; |
| 951 | 979 | |
| 952 | 980 | return retval; |
| @@ -1032,6 +1060,7 @@ class TopLevelRepo { | ||
| 1032 | 1060 | TopLevelRepo TopLevelRepo_from_JSON(mixed json) { |
| 1033 | 1061 | TopLevelRepo retval = TopLevelRepo(); |
| 1034 | 1062 | |
| 1063 | + if (!intp(json["id"])) error("Expected integer"); | |
| 1035 | 1064 | retval.id = json["id"]; |
| 1036 | 1065 | retval.name = json["name"]; |
| 1037 | 1066 | 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"]; |
| @@ -150,6 +151,7 @@ class PurplePerson { | ||
| 150 | 151 | PurplePerson PurplePerson_from_JSON(mixed json) { |
| 151 | 152 | PurplePerson retval = PurplePerson(); |
| 152 | 153 | |
| 154 | + if (!intp(json["intOrString"])) error("Expected integer"); | |
| 153 | 155 | retval.int_or_string = json["intOrString"]; |
| 154 | 156 | retval.name = json["name"]; |
Test case
1 generated file · +1 −0test/inputs/json/samples/null-safe.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -56,6 +56,7 @@ Item Item_from_JSON(mixed json) { | ||
| 56 | 56 | retval.address = json["address"]; |
| 57 | 57 | retval.created_at = json["created_at"]; |
| 58 | 58 | retval.name = json["name"]; |
| 59 | + if (!intp(json["sex"])) error("Expected integer"); | |
| 59 | 60 | if (!has_index(json, "sex")) error("Missing required property"); |
| 60 | 61 | 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
| @@ -253,14 +253,18 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 253 | 253 | retval.clicked = json["clicked"]; |
| 254 | 254 | if (json["contest_mode"] != Standards.JSON.true && json["contest_mode"] != Standards.JSON.false) error("Expected bool"); |
| 255 | 255 | retval.contest_mode = json["contest_mode"]; |
| 256 | + if (!intp(json["created"])) error("Expected integer"); | |
| 256 | 257 | retval.created = json["created"]; |
| 258 | + if (!intp(json["created_utc"])) error("Expected integer"); | |
| 257 | 259 | retval.created_utc = json["created_utc"]; |
| 258 | 260 | if (!has_index(json, "distinguished")) error("Missing required property"); |
| 259 | 261 | retval.distinguished = json["distinguished"]; |
| 260 | 262 | retval.domain = Domain_from_JSON(json["domain"]); |
| 263 | + if (!intp(json["downs"])) error("Expected integer"); | |
| 261 | 264 | retval.downs = json["downs"]; |
| 262 | 265 | if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool"); |
| 263 | 266 | retval.edited = json["edited"]; |
| 267 | + if (!intp(json["gilded"])) error("Expected integer"); | |
| 264 | 268 | retval.gilded = json["gilded"]; |
| 265 | 269 | if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool"); |
| 266 | 270 | retval.hidden = json["hidden"]; |
| @@ -282,6 +286,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 282 | 286 | retval.media_embed = json["media_embed"]; |
| 283 | 287 | retval.mod_reports = json["mod_reports"]; |
| 284 | 288 | retval.name = json["name"]; |
| 289 | + if (!intp(json["num_comments"])) error("Expected integer"); | |
| 285 | 290 | retval.num_comments = json["num_comments"]; |
| 286 | 291 | retval.num_reports = json["num_reports"]; |
| 287 | 292 | if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool"); |
| @@ -296,6 +301,7 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 296 | 301 | retval.report_reasons = json["report_reasons"]; |
| 297 | 302 | if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool"); |
| 298 | 303 | retval.saved = json["saved"]; |
| 304 | + if (!intp(json["score"])) error("Expected integer"); | |
| 299 | 305 | retval.score = json["score"]; |
| 300 | 306 | retval.secure_media = json["secure_media"]; |
| 301 | 307 | retval.secure_media_embed = json["secure_media_embed"]; |
| @@ -311,9 +317,12 @@ ChildData ChildData_from_JSON(mixed json) { | ||
| 311 | 317 | retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]); |
| 312 | 318 | retval.suggested_sort = json["suggested_sort"]; |
| 313 | 319 | retval.thumbnail = json["thumbnail"]; |
| 320 | + if (!intp(json["thumbnail_height"])) error("Expected integer"); | |
| 314 | 321 | retval.thumbnail_height = json["thumbnail_height"]; |
| 322 | + if (!intp(json["thumbnail_width"])) error("Expected integer"); | |
| 315 | 323 | retval.thumbnail_width = json["thumbnail_width"]; |
| 316 | 324 | retval.title = json["title"]; |
| 325 | + if (!intp(json["ups"])) error("Expected integer"); | |
| 317 | 326 | retval.ups = json["ups"]; |
| 318 | 327 | retval.url = json["url"]; |
| 319 | 328 | retval.user_reports = json["user_reports"]; |
| @@ -441,8 +450,10 @@ class Source { | ||
| 441 | 450 | Source Source_from_JSON(mixed json) { |
| 442 | 451 | Source retval = Source(); |
| 443 | 452 | |
| 453 | + if (!intp(json["height"])) error("Expected integer"); | |
| 444 | 454 | retval.height = json["height"]; |
| 445 | 455 | retval.url = json["url"]; |
| 456 | + if (!intp(json["width"])) error("Expected integer"); | |
| 446 | 457 | retval.width = json["width"]; |
| 447 | 458 | |
| 448 | 459 | 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
| @@ -70,6 +70,7 @@ TopLevel TopLevel_from_JSON(mixed json) { | ||
| 70 | 70 | retval.id = json["id"]; |
| 71 | 71 | retval.images = json["images"]; |
| 72 | 72 | retval.name = json["name"]; |
| 73 | + if (!intp(json["popularity"])) error("Expected integer"); | |
| 73 | 74 | retval.popularity = json["popularity"]; |
| 74 | 75 | retval.release_date = json["release_date"]; |
| 75 | 76 | retval.release_date_precision = json["release_date_precision"]; |
| @@ -197,8 +198,10 @@ class Image { | ||
| 197 | 198 | Image Image_from_JSON(mixed json) { |
| 198 | 199 | Image retval = Image(); |
| 199 | 200 | |
| 201 | + if (!intp(json["height"])) error("Expected integer"); | |
| 200 | 202 | retval.height = json["height"]; |
| 201 | 203 | retval.url = json["url"]; |
| 204 | + if (!intp(json["width"])) error("Expected integer"); | |
| 202 | 205 | retval.width = json["width"]; |
| 203 | 206 | |
| 204 | 207 | return retval; |
| @@ -233,10 +236,13 @@ Tracks Tracks_from_JSON(mixed json) { | ||
| 233 | 236 | |
| 234 | 237 | retval.href = json["href"]; |
| 235 | 238 | retval.items = json["items"]; |
| 239 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 236 | 240 | retval.limit = json["limit"]; |
| 237 | 241 | retval.next = json["next"]; |
| 242 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 238 | 243 | retval.offset = json["offset"]; |
| 239 | 244 | retval.previous = json["previous"]; |
| 245 | + if (!intp(json["total"])) error("Expected integer"); | |
| 240 | 246 | retval.total = json["total"]; |
| 241 | 247 | |
| 242 | 248 | return retval; |
| @@ -283,7 +289,9 @@ Item Item_from_JSON(mixed json) { | ||
| 283 | 289 | |
| 284 | 290 | retval.artists = json["artists"]; |
| 285 | 291 | retval.available_markets = json["available_markets"]; |
| 292 | + if (!intp(json["disc_number"])) error("Expected integer"); | |
| 286 | 293 | retval.disc_number = json["disc_number"]; |
| 294 | + if (!intp(json["duration_ms"])) error("Expected integer"); | |
| 287 | 295 | retval.duration_ms = json["duration_ms"]; |
| 288 | 296 | if (json["explicit"] != Standards.JSON.true && json["explicit"] != Standards.JSON.false) error("Expected bool"); |
| 289 | 297 | retval.explicit = json["explicit"]; |
| @@ -292,6 +300,7 @@ Item Item_from_JSON(mixed json) { | ||
| 292 | 300 | retval.id = json["id"]; |
| 293 | 301 | retval.name = json["name"]; |
| 294 | 302 | retval.preview_url = json["preview_url"]; |
| 303 | + if (!intp(json["track_number"])) error("Expected integer"); | |
| 295 | 304 | retval.track_number = json["track_number"]; |
| 296 | 305 | retval.type = json["type"]; |
| 297 | 306 | retval.uri = json["uri"]; |
Test case
1 generated file · +1 −0test/inputs/json/samples/us-avg-temperatures.json
Mpikedefault / TopLevel.pmod+1 −0
| @@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) { | ||
| 80 | 80 | Description retval = Description(); |
| 81 | 81 | |
| 82 | 82 | retval.base_period = json["base_period"]; |
| 83 | + if (!intp(json["missing"])) error("Expected integer"); | |
| 83 | 84 | retval.missing = json["missing"]; |
| 84 | 85 | retval.title = json["title"]; |
| 85 | 86 | retval.units = json["units"]; |
Test case
1 generated file · +4 −0test/inputs/json/samples/us-senators.json
Mpikedefault / TopLevel.pmod+4 −0
| @@ -54,8 +54,11 @@ class Meta { | ||
| 54 | 54 | Meta Meta_from_JSON(mixed json) { |
| 55 | 55 | Meta retval = Meta(); |
| 56 | 56 | |
| 57 | + if (!intp(json["limit"])) error("Expected integer"); | |
| 57 | 58 | retval.limit = json["limit"]; |
| 59 | + if (!intp(json["offset"])) error("Expected integer"); | |
| 58 | 60 | retval.offset = json["offset"]; |
| 61 | + if (!intp(json["total_count"])) error("Expected integer"); | |
| 59 | 62 | retval.total_count = json["total_count"]; |
| 60 | 63 | |
| 61 | 64 | return retval; |
| @@ -238,6 +241,7 @@ Person Person_from_JSON(mixed json) { | ||
| 238 | 241 | |
| 239 | 242 | retval.bioguideid = json["bioguideid"]; |
| 240 | 243 | retval.birthday = json["birthday"]; |
| 244 | + if (!intp(json["cspanid"])) error("Expected integer"); | |
| 241 | 245 | retval.cspanid = json["cspanid"]; |
| 242 | 246 | retval.firstname = json["firstname"]; |
| 243 | 247 | 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.