Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
148test cases
148files differ
148modified
0new
0deleted
1,170changed lines
+1,170 −0insertions / deletions
Base 704dd44b685e65fb04e2bb3ba36ed221a0c01680 · PR merge 6ebf5467ca3f34e8cae50968cdeb70333315610c · Head 544f791ea202c6c8837c95b3d931b4196c6704e0 · raw patch
Test case

test/inputs/graphql/github2.graphql

1 generated file · +1 −0
Mgraphql-pikedefault / TopLevel.pmod+1 −0
@@ -96,6 +96,7 @@ class RepositoryConnection {
9696 RepositoryConnection RepositoryConnection_from_JSON(mixed json) {
9797 RepositoryConnection retval = RepositoryConnection();
9898
99+ if (!intp(json["totalCount"])) error("Expected integer");
99100 retval.total_count = json["totalCount"];
100101 if (!has_index(json, "nodes")) error("Missing required property");
101102 retval.nodes = json["nodes"];
Test case

test/inputs/graphql/github7.graphql

1 generated file · +1 −0
Mgraphql-pikedefault / TopLevel.pmod+1 −0
@@ -171,6 +171,7 @@ class Connection {
171171 Connection Connection_from_JSON(mixed json) {
172172 Connection retval = Connection();
173173
174+ if (!intp(json["totalCount"])) error("Expected integer");
174175 retval.total_count = json["totalCount"];
175176
176177 return retval;
Test case

test/inputs/json/misc/00c36.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -118,9 +118,12 @@ class FluffyTopLevel {
118118 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
119119 FluffyTopLevel retval = FluffyTopLevel();
120120
121+ if (!intp(json["page"])) error("Expected integer");
121122 retval.page = json["page"];
123+ if (!intp(json["pages"])) error("Expected integer");
122124 retval.pages = json["pages"];
123125 retval.per_page = json["per_page"];
126+ if (!intp(json["total"])) error("Expected integer");
124127 retval.total = json["total"];
125128
126129 return retval;
Test case

test/inputs/json/misc/010b1.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/016af.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/09f54.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) {
8080 Description retval = Description();
8181
8282 retval.base_period = json["base_period"];
83+ if (!intp(json["missing"])) error("Expected integer");
8384 retval.missing = json["missing"];
8485 retval.title = json["title"];
8586 retval.units = json["units"];
Test case

test/inputs/json/misc/0a358.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
@@ -94,6 +97,7 @@ Result Result_from_JSON(mixed json) {
9497
9598 retval.code = json["code"];
9699 retval.created_at = json["created_at"];
100+ if (!intp(json["id"])) error("Expected integer");
97101 retval.id = json["id"];
98102 retval.name = json["name"];
99103 retval.updated_at = json["updated_at"];
Test case

test/inputs/json/misc/0a91a.json

1 generated file · +20 −0
Mpikedefault / TopLevel.pmod+20 −0
@@ -88,6 +88,7 @@ Actor Actor_from_JSON(mixed json) {
8888 retval.avatar_url = json["avatar_url"];
8989 retval.display_login = json["display_login"];
9090 retval.gravatar_id = json["gravatar_id"];
91+ if (!intp(json["id"])) error("Expected integer");
9192 retval.id = json["id"];
9293 retval.login = json["login"];
9394 retval.url = json["url"];
@@ -305,22 +306,28 @@ class PullRequest {
305306 PullRequest PullRequest_from_JSON(mixed json) {
306307 PullRequest retval = PullRequest();
307308
309+ if (!intp(json["additions"])) error("Expected integer");
308310 retval.additions = json["additions"];
309311 retval.assignee = json["assignee"];
310312 retval.assignees = json["assignees"];
311313 retval.base = Base_from_JSON(json["base"]);
312314 retval.body = json["body"];
315+ if (!intp(json["changed_files"])) error("Expected integer");
313316 retval.changed_files = json["changed_files"];
314317 retval.closed_at = json["closed_at"];
318+ if (!intp(json["comments"])) error("Expected integer");
315319 retval.comments = json["comments"];
316320 retval.comments_url = json["comments_url"];
321+ if (!intp(json["commits"])) error("Expected integer");
317322 retval.commits = json["commits"];
318323 retval.commits_url = json["commits_url"];
319324 retval.created_at = json["created_at"];
325+ if (!intp(json["deletions"])) error("Expected integer");
320326 retval.deletions = json["deletions"];
321327 retval.diff_url = json["diff_url"];
322328 retval.head = Base_from_JSON(json["head"]);
323329 retval.html_url = json["html_url"];
330+ if (!intp(json["id"])) error("Expected integer");
324331 retval.id = json["id"];
325332 retval.issue_url = json["issue_url"];
326333 retval.links = Links_from_JSON(json["_links"]);
@@ -336,11 +343,13 @@ PullRequest PullRequest_from_JSON(mixed json) {
336343 retval.merged_at = json["merged_at"];
337344 retval.merged_by = MergedBy_from_JSON(json["merged_by"]);
338345 retval.milestone = json["milestone"];
346+ if (!intp(json["number"])) error("Expected integer");
339347 retval.number = json["number"];
340348 retval.patch_url = json["patch_url"];
341349 retval.rebaseable = json["rebaseable"];
342350 retval.requested_reviewers = json["requested_reviewers"];
343351 retval.review_comment_url = json["review_comment_url"];
352+ if (!intp(json["review_comments"])) error("Expected integer");
344353 retval.review_comments = json["review_comments"];
345354 retval.review_comments_url = json["review_comments_url"];
346355 retval.state = json["state"];
@@ -555,7 +564,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
555564 retval.events_url = json["events_url"];
556565 if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool");
557566 retval.fork = json["fork"];
567+ if (!intp(json["forks"])) error("Expected integer");
558568 retval.forks = json["forks"];
569+ if (!intp(json["forks_count"])) error("Expected integer");
559570 retval.forks_count = json["forks_count"];
560571 retval.forks_url = json["forks_url"];
561572 retval.full_name = json["full_name"];
@@ -576,6 +587,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
576587 retval.homepage = json["homepage"];
577588 retval.hooks_url = json["hooks_url"];
578589 retval.html_url = json["html_url"];
590+ if (!intp(json["id"])) error("Expected integer");
579591 retval.id = json["id"];
580592 retval.issue_comment_url = json["issue_comment_url"];
581593 retval.issue_events_url = json["issue_events_url"];
@@ -589,7 +601,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
589601 retval.mirror_url = json["mirror_url"];
590602 retval.name = json["name"];
591603 retval.notifications_url = json["notifications_url"];
604+ if (!intp(json["open_issues"])) error("Expected integer");
592605 retval.open_issues = json["open_issues"];
606+ if (!intp(json["open_issues_count"])) error("Expected integer");
593607 retval.open_issues_count = json["open_issues_count"];
594608 retval.owner = MergedBy_from_JSON(json["owner"]);
595609 retval.pulls_url = json["pulls_url"];
@@ -597,8 +611,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
597611 retval.releases_url = json["releases_url"];
598612 if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool");
599613 retval.repo_private = json["private"];
614+ if (!intp(json["size"])) error("Expected integer");
600615 retval.size = json["size"];
601616 retval.ssh_url = json["ssh_url"];
617+ if (!intp(json["stargazers_count"])) error("Expected integer");
602618 retval.stargazers_count = json["stargazers_count"];
603619 retval.stargazers_url = json["stargazers_url"];
604620 retval.statuses_url = json["statuses_url"];
@@ -610,7 +626,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
610626 retval.trees_url = json["trees_url"];
611627 retval.updated_at = json["updated_at"];
612628 retval.url = json["url"];
629+ if (!intp(json["watchers"])) error("Expected integer");
613630 retval.watchers = json["watchers"];
631+ if (!intp(json["watchers_count"])) error("Expected integer");
614632 retval.watchers_count = json["watchers_count"];
615633
616634 return retval;
@@ -670,6 +688,7 @@ MergedBy MergedBy_from_JSON(mixed json) {
670688 retval.gists_url = json["gists_url"];
671689 retval.gravatar_id = json["gravatar_id"];
672690 retval.html_url = json["html_url"];
691+ if (!intp(json["id"])) error("Expected integer");
673692 retval.id = json["id"];
674693 retval.login = json["login"];
675694 retval.organizations_url = json["organizations_url"];
@@ -765,6 +784,7 @@ class TopLevelRepo {
765784 TopLevelRepo TopLevelRepo_from_JSON(mixed json) {
766785 TopLevelRepo retval = TopLevelRepo();
767786
787+ if (!intp(json["id"])) error("Expected integer");
768788 retval.id = json["id"];
769789 retval.name = json["name"];
770790 retval.url = json["url"];
Test case

test/inputs/json/misc/0b91a.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
7979 ResponseInfo retval = ResponseInfo();
8080
8181 retval.developer_message = json["developerMessage"];
82+ if (!intp(json["status"])) error("Expected integer");
8283 retval.status = json["status"];
8384
8485 return retval;
@@ -103,8 +104,11 @@ class Resultset {
103104 Resultset Resultset_from_JSON(mixed json) {
104105 Resultset retval = Resultset();
105106
107+ if (!intp(json["count"])) error("Expected integer");
106108 retval.count = json["count"];
109+ if (!intp(json["page"])) error("Expected integer");
107110 retval.page = json["page"];
111+ if (!intp(json["pagesize"])) error("Expected integer");
108112 retval.pagesize = json["pagesize"];
109113
110114 return retval;
Test case

test/inputs/json/misc/0cffa.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -407,6 +408,7 @@ Meta Meta_from_JSON(mixed json) {
407408
408409 retval.msg = json["msg"];
409410 retval.response_id = json["response_id"];
411+ if (!intp(json["status"])) error("Expected integer");
410412 retval.status = json["status"];
411413
412414 return retval;
@@ -431,8 +433,11 @@ class Pagination {
431433 Pagination Pagination_from_JSON(mixed json) {
432434 Pagination retval = Pagination();
433435
436+ if (!intp(json["count"])) error("Expected integer");
434437 retval.count = json["count"];
438+ if (!intp(json["offset"])) error("Expected integer");
435439 retval.offset = json["offset"];
440+ if (!intp(json["total_count"])) error("Expected integer");
436441 retval.total_count = json["total_count"];
437442
438443 return retval;
Test case

test/inputs/json/misc/0e0c2.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -33,6 +33,7 @@ class TopLevel {
3333 TopLevel TopLevel_from_JSON(mixed json) {
3434 TopLevel retval = TopLevel();
3535
36+ if (!intp(json["count"])) error("Expected integer");
3637 retval.count = json["count"];
3738 retval.next = json["next"];
3839 retval.previous = json["previous"];
@@ -84,21 +85,26 @@ class Result {
8485 Result Result_from_JSON(mixed json) {
8586 Result retval = Result();
8687
88+ if (!intp(json["active_screens"])) error("Expected integer");
8789 retval.active_screens = json["active_screens"];
8890 retval.collections = json["collections"];
8991 retval.details = json["details"];
92+ if (!intp(json["duration"])) error("Expected integer");
9093 retval.duration = json["duration"];
9194 retval.fav_movie = FavMovie_from_JSON(json["fav_movie"]);
95+ if (!intp(json["id"])) error("Expected integer");
9296 retval.id = json["id"];
9397 retval.images = json["images"];
9498 retval.language = ResultLanguage_from_JSON(json["language"]);
9599 retval.release_date = json["release_date"];
100+ if (!intp(json["stars"])) error("Expected integer");
96101 retval.stars = json["stars"];
97102 if (!has_index(json, "tags")) error("Missing required property");
98103 retval.tags = json["tags"];
99104 retval.title = json["title"];
100105 retval.videos = json["videos"];
101106 retval.vote_score = VoteScore_from_JSON(json["vote_score"]);
107+ if (!intp(json["watches"])) error("Expected integer");
102108 retval.watches = json["watches"];
103109
104110 return retval;
@@ -125,6 +131,7 @@ class Collection {
125131 Collection Collection_from_JSON(mixed json) {
126132 Collection retval = Collection();
127133
134+ if (!intp(json["id"])) error("Expected integer");
128135 retval.id = json["id"];
129136 retval.movies = json["movies"];
130137 retval.name = json["name"];
@@ -162,6 +169,7 @@ Detail Detail_from_JSON(mixed json) {
162169
163170 retval.cast = json["cast"];
164171 retval.director = json["director"];
172+ if (!intp(json["id"])) error("Expected integer");
165173 retval.id = json["id"];
166174 retval.language = DetailLanguage_from_JSON(json["language"]);
167175 retval.storyline = json["storyline"];
@@ -232,7 +240,9 @@ class Image {
232240 Image Image_from_JSON(mixed json) {
233241 Image retval = Image();
234242
243+ if (!intp(json["favs"])) error("Expected integer");
235244 retval.favs = json["favs"];
245+ if (!intp(json["id"])) error("Expected integer");
236246 retval.id = json["id"];
237247 retval.thumbnail = json["thumbnail"];
238248 retval.type = Type_from_JSON(json["type"]);
@@ -307,8 +317,11 @@ class VoteScore {
307317 VoteScore VoteScore_from_JSON(mixed json) {
308318 VoteScore retval = VoteScore();
309319
320+ if (!intp(json["avg"])) error("Expected integer");
310321 retval.avg = json["avg"];
322+ if (!intp(json["score"])) error("Expected integer");
311323 retval.score = json["score"];
324+ if (!intp(json["total"])) error("Expected integer");
312325 retval.total = json["total"];
313326
314327 return retval;
Test case

test/inputs/json/misc/127a1.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -406,6 +407,7 @@ Meta Meta_from_JSON(mixed json) {
406407
407408 retval.msg = json["msg"];
408409 retval.response_id = json["response_id"];
410+ if (!intp(json["status"])) error("Expected integer");
409411 retval.status = json["status"];
410412
411413 return retval;
@@ -430,8 +432,11 @@ class Pagination {
430432 Pagination Pagination_from_JSON(mixed json) {
431433 Pagination retval = Pagination();
432434
435+ if (!intp(json["count"])) error("Expected integer");
433436 retval.count = json["count"];
437+ if (!intp(json["offset"])) error("Expected integer");
434438 retval.offset = json["offset"];
439+ if (!intp(json["total_count"])) error("Expected integer");
435440 retval.total_count = json["total_count"];
436441
437442 return retval;
Test case

test/inputs/json/misc/13d8d.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -51,6 +51,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
5151
5252 retval.category = json["category"];
5353 retval.context = json["context"];
54+ if (!intp(json["id"])) error("Expected integer");
5455 retval.id = json["id"];
5556 retval.location = Location_from_JSON(json["location"]);
5657 retval.location_subtype = json["location_subtype"];
@@ -105,6 +106,7 @@ class Street {
105106 Street Street_from_JSON(mixed json) {
106107 Street retval = Street();
107108
109+ if (!intp(json["id"])) error("Expected integer");
108110 retval.id = json["id"];
109111 retval.name = json["name"];
Test case

test/inputs/json/misc/16bc5.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/176f1.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3434 TopLevel retval = TopLevel();
3535
3636 retval.message = json["message"];
37+ if (!intp(json["responseTime"])) error("Expected integer");
3738 retval.response_time = json["responseTime"];
3839 retval.results = Results_from_JSON(json["Results"]);
3940 retval.status = json["status"];
Test case

test/inputs/json/misc/1a7f5.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/1b28c.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/1b409.json

1 generated file · +7 −0
Mpikedefault / TopLevel.pmod+7 −0
@@ -54,8 +54,11 @@ class Meta {
5454 Meta Meta_from_JSON(mixed json) {
5555 Meta retval = Meta();
5656
57+ if (!intp(json["limit"])) error("Expected integer");
5758 retval.limit = json["limit"];
59+ if (!intp(json["offset"])) error("Expected integer");
5860 retval.offset = json["offset"];
61+ if (!intp(json["total_count"])) error("Expected integer");
5962 retval.total_count = json["total_count"];
6063
6164 return retval;
@@ -121,9 +124,11 @@ Object Object_from_JSON(mixed json) {
121124 if (json["current"] != Standards.JSON.true && json["current"] != Standards.JSON.false) error("Expected bool");
122125 retval.current = json["current"];
123126 retval.description = json["description"];
127+ if (!intp(json["district"])) error("Expected integer");
124128 retval.district = json["district"];
125129 retval.enddate = json["enddate"];
126130 retval.extra = Extra_from_JSON(json["extra"]);
131+ if (!intp(json["id"])) error("Expected integer");
127132 retval.id = json["id"];
128133 if (!has_index(json, "leadership_title")) error("Missing required property");
129134 retval.leadership_title = json["leadership_title"];
@@ -235,10 +240,12 @@ Person Person_from_JSON(mixed json) {
235240
236241 retval.bioguideid = json["bioguideid"];
237242 retval.birthday = json["birthday"];
243+ if (!intp(json["cspanid"])) error("Expected integer");
238244 retval.cspanid = json["cspanid"];
239245 retval.firstname = json["firstname"];
240246 retval.gender = Gender_from_JSON(json["gender"]);
241247 retval.gender_label = GenderLabel_from_JSON(json["gender_label"]);
248+ if (!intp(json["id"])) error("Expected integer");
242249 retval.id = json["id"];
243250 retval.lastname = json["lastname"];
244251 retval.link = json["link"];
Test case

test/inputs/json/misc/262f0.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/26b49.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -401,6 +402,7 @@ Meta Meta_from_JSON(mixed json) {
401402
402403 retval.msg = json["msg"];
403404 retval.response_id = json["response_id"];
405+ if (!intp(json["status"])) error("Expected integer");
404406 retval.status = json["status"];
405407
406408 return retval;
@@ -425,8 +427,11 @@ class Pagination {
425427 Pagination Pagination_from_JSON(mixed json) {
426428 Pagination retval = Pagination();
427429
430+ if (!intp(json["count"])) error("Expected integer");
428431 retval.count = json["count"];
432+ if (!intp(json["offset"])) error("Expected integer");
429433 retval.offset = json["offset"];
434+ if (!intp(json["total_count"])) error("Expected integer");
430435 retval.total_count = json["total_count"];
431436
432437 return retval;
Test case

test/inputs/json/misc/26c9c.json

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -152,12 +152,15 @@ View View_from_JSON(mixed json) {
152152
153153 retval.attribution = json["attribution"];
154154 retval.attribution_link = json["attributionLink"];
155+ if (!intp(json["averageRating"])) error("Expected integer");
155156 retval.average_rating = json["averageRating"];
156157 retval.category = json["category"];
157158 retval.columns = json["columns"];
159+ if (!intp(json["createdAt"])) error("Expected integer");
158160 retval.created_at = json["createdAt"];
159161 retval.description = json["description"];
160162 retval.display_type = json["displayType"];
163+ if (!intp(json["downloadCount"])) error("Expected integer");
161164 retval.download_count = json["downloadCount"];
162165 retval.flags = json["flags"];
163166 retval.grants = json["grants"];
@@ -166,30 +169,40 @@ View View_from_JSON(mixed json) {
166169 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
167170 retval.hide_from_data_json = json["hideFromDataJson"];
168171 retval.id = json["id"];
172+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
169173 retval.index_updated_at = json["indexUpdatedAt"];
170174 retval.locale = json["locale"];
171175 retval.metadata = Metadata_from_JSON(json["metadata"]);
172176 retval.name = json["name"];
173177 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
174178 retval.new_backend = json["newBackend"];
179+ if (!intp(json["numberOfComments"])) error("Expected integer");
175180 retval.number_of_comments = json["numberOfComments"];
181+ if (!intp(json["oid"])) error("Expected integer");
176182 retval.oid = json["oid"];
177183 retval.owner = Owner_from_JSON(json["owner"]);
178184 retval.provenance = json["provenance"];
179185 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
180186 retval.publication_append_enabled = json["publicationAppendEnabled"];
187+ if (!intp(json["publicationDate"])) error("Expected integer");
181188 retval.publication_date = json["publicationDate"];
189+ if (!intp(json["publicationGroup"])) error("Expected integer");
182190 retval.publication_group = json["publicationGroup"];
183191 retval.publication_stage = json["publicationStage"];
184192 retval.query = Query_from_JSON(json["query"]);
185193 retval.rights = json["rights"];
194+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
186195 retval.rows_updated_at = json["rowsUpdatedAt"];
187196 retval.rows_updated_by = json["rowsUpdatedBy"];
188197 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
198+ if (!intp(json["tableId"])) error("Expected integer");
189199 retval.table_id = json["tableId"];
190200 retval.tags = json["tags"];
201+ if (!intp(json["totalTimesRated"])) error("Expected integer");
191202 retval.total_times_rated = json["totalTimesRated"];
203+ if (!intp(json["viewCount"])) error("Expected integer");
192204 retval.view_count = json["viewCount"];
205+ if (!intp(json["viewLastModified"])) error("Expected integer");
193206 retval.view_last_modified = json["viewLastModified"];
194207 retval.view_type = json["viewType"];
195208
@@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) {
236249 retval.field_name = json["fieldName"];
237250 retval.flags = json["flags"];
238251 retval.format = Format_from_JSON(json["format"]);
252+ if (!intp(json["id"])) error("Expected integer");
239253 retval.id = json["id"];
240254 retval.name = json["name"];
255+ if (!intp(json["position"])) error("Expected integer");
241256 retval.position = json["position"];
242257 retval.render_type_name = json["renderTypeName"];
243258 retval.table_column_id = json["tableColumnId"];
@@ -275,7 +290,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
275290
276291 retval.average = json["average"];
277292 retval.largest = json["largest"];
293+ if (!intp(json["non_null"])) error("Expected integer");
278294 retval.non_null = json["non_null"];
295+ if (!intp(json["null"])) error("Expected integer");
279296 retval.null = json["null"];
280297 retval.smallest = json["smallest"];
281298 retval.sum = json["sum"];
@@ -301,6 +318,7 @@ class Top {
301318 Top Top_from_JSON(mixed json) {
302319 Top retval = Top();
303320
321+ if (!intp(json["count"])) error("Expected integer");
304322 retval.count = json["count"];
305323 retval.item = json["item"];
306324
@@ -779,6 +797,7 @@ class Expression {
779797 Expression Expression_from_JSON(mixed json) {
780798 Expression retval = Expression();
781799
800+ if (!intp(json["columnId"])) error("Expected integer");
782801 retval.column_id = json["columnId"];
783802 retval.type = json["type"];
Test case

test/inputs/json/misc/27332.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -254,9 +254,11 @@ ChildData ChildData_from_JSON(mixed json) {
254254 if (!has_index(json, "distinguished")) error("Missing required property");
255255 retval.distinguished = json["distinguished"];
256256 retval.domain = Domain_from_JSON(json["domain"]);
257+ if (!intp(json["downs"])) error("Expected integer");
257258 retval.downs = json["downs"];
258259 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
259260 retval.edited = json["edited"];
261+ if (!intp(json["gilded"])) error("Expected integer");
260262 retval.gilded = json["gilded"];
261263 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
262264 retval.hidden = json["hidden"];
@@ -279,6 +281,7 @@ ChildData ChildData_from_JSON(mixed json) {
279281 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
280282 retval.mod_reports = json["mod_reports"];
281283 retval.name = json["name"];
284+ if (!intp(json["num_comments"])) error("Expected integer");
282285 retval.num_comments = json["num_comments"];
283286 retval.num_reports = json["num_reports"];
284287 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) {
292295 retval.report_reasons = json["report_reasons"];
293296 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
294297 retval.saved = json["saved"];
298+ if (!intp(json["score"])) error("Expected integer");
295299 retval.score = json["score"];
296300 if (!has_index(json, "secure_media")) error("Missing required property");
297301 retval.secure_media = json["secure_media"] == Val.null ? Val.null : Media_from_JSON(json["secure_media"]);
@@ -309,11 +313,14 @@ ChildData ChildData_from_JSON(mixed json) {
309313 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
310314 retval.suggested_sort = json["suggested_sort"];
311315 retval.thumbnail = json["thumbnail"];
316+ if (!intp(json["thumbnail_height"])) error("Expected integer");
312317 if (!has_index(json, "thumbnail_height")) error("Missing required property");
313318 retval.thumbnail_height = json["thumbnail_height"];
319+ if (!intp(json["thumbnail_width"])) error("Expected integer");
314320 if (!has_index(json, "thumbnail_width")) error("Missing required property");
315321 retval.thumbnail_width = json["thumbnail_width"];
316322 retval.title = json["title"];
323+ if (!intp(json["ups"])) error("Expected integer");
317324 retval.ups = json["ups"];
318325 retval.url = json["url"];
319326 retval.user_reports = json["user_reports"];
@@ -396,16 +403,20 @@ Oembed Oembed_from_JSON(mixed json) {
396403 Oembed retval = Oembed();
397404
398405 retval.description = json["description"];
406+ if (!intp(json["height"])) error("Expected integer");
399407 retval.height = json["height"];
400408 retval.html = json["html"];
401409 retval.provider_name = json["provider_name"];
402410 retval.provider_url = json["provider_url"];
411+ if (!intp(json["thumbnail_height"])) error("Expected integer");
403412 retval.thumbnail_height = json["thumbnail_height"];
404413 retval.thumbnail_url = json["thumbnail_url"];
414+ if (!intp(json["thumbnail_width"])) error("Expected integer");
405415 retval.thumbnail_width = json["thumbnail_width"];
406416 retval.title = json["title"];
407417 retval.type = json["type"];
408418 retval.version = json["version"];
419+ if (!intp(json["width"])) error("Expected integer");
409420 retval.width = json["width"];
410421
411422 return retval;
@@ -521,8 +532,10 @@ class Source {
521532 Source Source_from_JSON(mixed json) {
522533 Source retval = Source();
523534
535+ if (!intp(json["height"])) error("Expected integer");
524536 retval.height = json["height"];
525537 retval.url = json["url"];
538+ if (!intp(json["width"])) error("Expected integer");
526539 retval.width = json["width"];
527540
528541 return retval;
Test case

test/inputs/json/misc/29f47.json

1 generated file · +9 −0
Mpikedefault / TopLevel.pmod+9 −0
@@ -251,9 +251,11 @@ ChildData ChildData_from_JSON(mixed json) {
251251 retval.created_utc = (float)json["created_utc"];
252252 retval.distinguished = Distinguished_from_JSON(json["distinguished"]);
253253 retval.domain = Domain_from_JSON(json["domain"]);
254+ if (!intp(json["downs"])) error("Expected integer");
254255 retval.downs = json["downs"];
255256 if (arrayp(json["edited"])) error("Unexpected array");
256257 retval.edited = json["edited"];
258+ if (!intp(json["gilded"])) error("Expected integer");
257259 retval.gilded = json["gilded"];
258260 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
259261 retval.hidden = json["hidden"];
@@ -273,6 +275,7 @@ ChildData ChildData_from_JSON(mixed json) {
273275 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
274276 retval.mod_reports = json["mod_reports"];
275277 retval.name = json["name"];
278+ if (!intp(json["num_comments"])) error("Expected integer");
276279 retval.num_comments = json["num_comments"];
277280 retval.num_reports = json["num_reports"];
278281 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) {
286289 retval.report_reasons = json["report_reasons"];
287290 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
288291 retval.saved = json["saved"];
292+ if (!intp(json["score"])) error("Expected integer");
289293 retval.score = json["score"];
290294 retval.secure_media = json["secure_media"];
291295 retval.secure_media_embed = MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -303,11 +307,14 @@ ChildData ChildData_from_JSON(mixed json) {
303307 if (!has_index(json, "suggested_sort")) error("Missing required property");
304308 retval.suggested_sort = json["suggested_sort"];
305309 retval.thumbnail = json["thumbnail"];
310+ if (!intp(json["thumbnail_height"])) error("Expected integer");
306311 if (!has_index(json, "thumbnail_height")) error("Missing required property");
307312 retval.thumbnail_height = json["thumbnail_height"];
313+ if (!intp(json["thumbnail_width"])) error("Expected integer");
308314 if (!has_index(json, "thumbnail_width")) error("Missing required property");
309315 retval.thumbnail_width = json["thumbnail_width"];
310316 retval.title = json["title"];
317+ if (!intp(json["ups"])) error("Expected integer");
311318 retval.ups = json["ups"];
312319 retval.url = json["url"];
313320 retval.user_reports = json["user_reports"];
@@ -438,8 +445,10 @@ class Source {
438445 Source Source_from_JSON(mixed json) {
439446 Source retval = Source();
440447
448+ if (!intp(json["height"])) error("Expected integer");
441449 retval.height = json["height"];
442450 retval.url = json["url"];
451+ if (!intp(json["width"])) error("Expected integer");
443452 retval.width = json["width"];
444453
445454 return retval;
Test case

test/inputs/json/misc/2d4e2.json

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -54,8 +54,11 @@ class Meta {
5454 Meta Meta_from_JSON(mixed json) {
5555 Meta retval = Meta();
5656
57+ if (!intp(json["limit"])) error("Expected integer");
5758 retval.limit = json["limit"];
59+ if (!intp(json["offset"])) error("Expected integer");
5860 retval.offset = json["offset"];
61+ if (!intp(json["total_count"])) error("Expected integer");
5962 retval.total_count = json["total_count"];
6063
6164 return retval;
@@ -129,6 +132,7 @@ Object Object_from_JSON(mixed json) {
129132 retval.district = json["district"];
130133 retval.enddate = json["enddate"];
131134 retval.extra = Extra_from_JSON(json["extra"]);
135+ if (!intp(json["id"])) error("Expected integer");
132136 retval.id = json["id"];
133137 if (!has_index(json, "leadership_title")) error("Missing required property");
134138 retval.leadership_title = json["leadership_title"];
@@ -243,10 +247,12 @@ Person Person_from_JSON(mixed json) {
243247
244248 retval.bioguideid = json["bioguideid"];
245249 retval.birthday = json["birthday"];
250+ if (!intp(json["cspanid"])) error("Expected integer");
246251 retval.cspanid = json["cspanid"];
247252 retval.firstname = json["firstname"];
248253 retval.gender = Gender_from_JSON(json["gender"]);
249254 retval.gender_label = GenderLabel_from_JSON(json["gender_label"]);
255+ if (!intp(json["id"])) error("Expected integer");
250256 retval.id = json["id"];
251257 retval.lastname = json["lastname"];
252258 retval.link = json["link"];
Test case

test/inputs/json/misc/2df80.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -173,9 +173,12 @@ class FluffyTopLevel {
173173 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
174174 FluffyTopLevel retval = FluffyTopLevel();
175175
176+ if (!intp(json["page"])) error("Expected integer");
176177 retval.page = json["page"];
178+ if (!intp(json["pages"])) error("Expected integer");
177179 retval.pages = json["pages"];
178180 retval.per_page = json["per_page"];
181+ if (!intp(json["total"])) error("Expected integer");
179182 retval.total = json["total"];
180183
181184 return retval;
Test case

test/inputs/json/misc/32431.json

1 generated file · +10 −0
Mpikedefault / TopLevel.pmod+10 −0
@@ -173,6 +173,7 @@ Properties Properties_from_JSON(mixed json) {
173173 if (!has_index(json, "dmin")) error("Missing required property");
174174 retval.dmin = json["dmin"];
175175 retval.felt = json["felt"];
176+ if (!intp(json["gap"])) error("Expected integer");
176177 if (!has_index(json, "gap")) error("Missing required property");
177178 retval.gap = json["gap"];
178179 retval.ids = json["ids"];
@@ -180,19 +181,25 @@ Properties Properties_from_JSON(mixed json) {
180181 retval.mag_type = MagType_from_JSON(json["magType"]);
181182 retval.mmi = json["mmi"];
182183 retval.net = json["net"];
184+ if (!intp(json["nst"])) error("Expected integer");
183185 if (!has_index(json, "nst")) error("Missing required property");
184186 retval.nst = json["nst"];
185187 retval.place = json["place"];
186188 retval.rms = (float)json["rms"];
189+ if (!intp(json["sig"])) error("Expected integer");
187190 retval.sig = json["sig"];
188191 retval.sources = json["sources"];
189192 retval.status = Status_from_JSON(json["status"]);
193+ if (!intp(json["time"])) error("Expected integer");
190194 retval.time = json["time"];
191195 retval.title = json["title"];
196+ if (!intp(json["tsunami"])) error("Expected integer");
192197 retval.tsunami = json["tsunami"];
193198 retval.type = PropertiesType_from_JSON(json["type"]);
194199 retval.types = json["types"];
200+ if (!intp(json["tz"])) error("Expected integer");
195201 retval.tz = json["tz"];
202+ if (!intp(json["updated"])) error("Expected integer");
196203 retval.updated = json["updated"];
197204 retval.url = json["url"];
198205
@@ -260,8 +267,11 @@ Metadata Metadata_from_JSON(mixed json) {
260267 Metadata retval = Metadata();
261268
262269 retval.api = json["api"];
270+ if (!intp(json["count"])) error("Expected integer");
263271 retval.count = json["count"];
272+ if (!intp(json["generated"])) error("Expected integer");
264273 retval.generated = json["generated"];
274+ if (!intp(json["status"])) error("Expected integer");
265275 retval.status = json["status"];
266276 retval.title = json["title"];
267277 retval.url = json["url"];
Test case

test/inputs/json/misc/32d5c.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -51,9 +51,11 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
5151 retval.birth_date = json["BirthDate"];
5252 if (json["BirthDateIsProtected"] != Standards.JSON.true && json["BirthDateIsProtected"] != Standards.JSON.false) error("Expected bool");
5353 retval.birth_date_is_protected = json["BirthDateIsProtected"];
54+ if (!intp(json["GenderTypeID"])) error("Expected integer");
5455 retval.gender_type_id = json["GenderTypeID"];
5556 retval.notes = json["Notes"];
5657 retval.parliamentary_name = json["ParliamentaryName"];
58+ if (!intp(json["PersonID"])) error("Expected integer");
5759 retval.person_id = json["PersonID"];
5860 retval.photo_url = json["PhotoURL"];
5961 retval.preferred_name = json["PreferredName"];
Test case

test/inputs/json/misc/337ed.json

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
@@ -144,10 +147,13 @@ class Result {
144147 Result Result_from_JSON(mixed json) {
145148 Result retval = Result();
146149
150+ if (!intp(json["cost_absolute"])) error("Expected integer");
147151 if (!has_index(json, "cost_absolute")) error("Missing required property");
148152 retval.cost_absolute = json["cost_absolute"];
153+ if (!intp(json["cost_max"])) error("Expected integer");
149154 if (!has_index(json, "cost_max")) error("Missing required property");
150155 retval.cost_max = json["cost_max"];
156+ if (!intp(json["cost_min"])) error("Expected integer");
151157 if (!has_index(json, "cost_min")) error("Missing required property");
152158 retval.cost_min = json["cost_min"];
153159 retval.created_at = json["created_at"];
@@ -155,9 +161,11 @@ Result Result_from_JSON(mixed json) {
155161 retval.direct_rep_costs_max = json["direct_rep_costs_max"];
156162 retval.direct_rep_costs_min = json["direct_rep_costs_min"];
157163 retval.end_date = json["end_date"];
164+ if (!intp(json["eur_sources_grants"])) error("Expected integer");
158165 retval.eur_sources_grants = json["eur_sources_grants"];
159166 if (!has_index(json, "eur_sources_grants_src")) error("Missing required property");
160167 retval.eur_sources_grants_src = json["eur_sources_grants_src"];
168+ if (!intp(json["eur_sources_procurement"])) error("Expected integer");
161169 retval.eur_sources_procurement = json["eur_sources_procurement"];
162170 if (!has_index(json, "eur_sources_procurement_src")) error("Missing required property");
163171 retval.eur_sources_procurement_src = json["eur_sources_procurement_src"];
@@ -167,27 +175,37 @@ Result Result_from_JSON(mixed json) {
167175 retval.no_clients = json["no_clients"];
168176 if (!has_index(json, "other_financial_information")) error("Missing required property");
169177 retval.other_financial_information = json["other_financial_information"];
178+ if (!intp(json["other_sources_contributions"])) error("Expected integer");
170179 if (!has_index(json, "other_sources_contributions")) error("Missing required property");
171180 retval.other_sources_contributions = json["other_sources_contributions"];
181+ if (!intp(json["other_sources_donation"])) error("Expected integer");
172182 if (!has_index(json, "other_sources_donation")) error("Missing required property");
173183 retval.other_sources_donation = json["other_sources_donation"];
184+ if (!intp(json["other_sources_total"])) error("Expected integer");
174185 if (!has_index(json, "other_sources_total")) error("Missing required property");
175186 retval.other_sources_total = json["other_sources_total"];
187+ if (!intp(json["public_financing_infranational"])) error("Expected integer");
176188 if (!has_index(json, "public_financing_infranational")) error("Missing required property");
177189 retval.public_financing_infranational = json["public_financing_infranational"];
190+ if (!intp(json["public_financing_national"])) error("Expected integer");
178191 if (!has_index(json, "public_financing_national")) error("Missing required property");
179192 retval.public_financing_national = json["public_financing_national"];
193+ if (!intp(json["public_financing_total"])) error("Expected integer");
180194 if (!has_index(json, "public_financing_total")) error("Missing required property");
181195 retval.public_financing_total = json["public_financing_total"];
182196 retval.representative = json["representative"];
183197 retval.start_date = json["start_date"];
184198 retval.status = Status_from_JSON(json["status"]);
199+ if (!intp(json["total_budget"])) error("Expected integer");
185200 if (!has_index(json, "total_budget")) error("Missing required property");
186201 retval.total_budget = json["total_budget"];
202+ if (!intp(json["turnover_absolute"])) error("Expected integer");
187203 if (!has_index(json, "turnover_absolute")) error("Missing required property");
188204 retval.turnover_absolute = json["turnover_absolute"];
205+ if (!intp(json["turnover_max"])) error("Expected integer");
189206 if (!has_index(json, "turnover_max")) error("Missing required property");
190207 retval.turnover_max = json["turnover_max"];
208+ if (!intp(json["turnover_min"])) error("Expected integer");
191209 if (!has_index(json, "turnover_min")) error("Missing required property");
192210 retval.turnover_min = json["turnover_min"];
193211 retval.type = ResultType_from_JSON(json["type"]);
@@ -226,6 +244,7 @@ class CustomIncome {
226244 CustomIncome CustomIncome_from_JSON(mixed json) {
227245 CustomIncome retval = CustomIncome();
228246
247+ if (!intp(json["amount"])) error("Expected integer");
229248 retval.amount = json["amount"];
230249 retval.created_at = json["created_at"];
231250 retval.id = json["id"];
Test case

test/inputs/json/misc/34702.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3535
3636 retval.crs = Crs_from_JSON(json["crs"]);
3737 retval.features = json["features"];
38+ if (!intp(json["totalFeatures"])) error("Expected integer");
3839 retval.total_features = json["totalFeatures"];
3940 retval.type = json["type"];
4041
@@ -208,6 +209,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
208209 if (!has_index(json, "no")) error("Missing required property");
209210 retval.no = json["no"];
210211 retval.phone = (float)json["phone"];
212+ if (!intp(json["postcode"])) error("Expected integer");
211213 retval.postcode = json["postcode"];
212214 retval.psa = json["psa"];
213215 retval.region = Region_from_JSON(json["region"]);
Test case

test/inputs/json/misc/3659d.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/3e9a3.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3434 TopLevel retval = TopLevel();
3535
3636 retval.message = json["message"];
37+ if (!intp(json["responseTime"])) error("Expected integer");
3738 retval.response_time = json["responseTime"];
3839 retval.results = Results_from_JSON(json["Results"]);
3940 retval.status = json["status"];
Test case

test/inputs/json/misc/3f1ce.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/421d4.json

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -155,12 +155,15 @@ View View_from_JSON(mixed json) {
155155 View retval = View();
156156
157157 retval.attribution = json["attribution"];
158+ if (!intp(json["averageRating"])) error("Expected integer");
158159 retval.average_rating = json["averageRating"];
159160 retval.category = json["category"];
160161 retval.columns = json["columns"];
162+ if (!intp(json["createdAt"])) error("Expected integer");
161163 retval.created_at = json["createdAt"];
162164 retval.description = json["description"];
163165 retval.display_type = json["displayType"];
166+ if (!intp(json["downloadCount"])) error("Expected integer");
164167 retval.download_count = json["downloadCount"];
165168 retval.flags = json["flags"];
166169 retval.grants = json["grants"];
@@ -169,6 +172,7 @@ View View_from_JSON(mixed json) {
169172 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
170173 retval.hide_from_data_json = json["hideFromDataJson"];
171174 retval.id = json["id"];
175+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
172176 retval.index_updated_at = json["indexUpdatedAt"];
173177 retval.license = License_from_JSON(json["license"]);
174178 retval.license_id = json["licenseId"];
@@ -177,25 +181,34 @@ View View_from_JSON(mixed json) {
177181 retval.name = json["name"];
178182 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
179183 retval.new_backend = json["newBackend"];
184+ if (!intp(json["numberOfComments"])) error("Expected integer");
180185 retval.number_of_comments = json["numberOfComments"];
186+ if (!intp(json["oid"])) error("Expected integer");
181187 retval.oid = json["oid"];
182188 retval.owner = Owner_from_JSON(json["owner"]);
183189 retval.provenance = json["provenance"];
184190 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
185191 retval.publication_append_enabled = json["publicationAppendEnabled"];
192+ if (!intp(json["publicationDate"])) error("Expected integer");
186193 retval.publication_date = json["publicationDate"];
194+ if (!intp(json["publicationGroup"])) error("Expected integer");
187195 retval.publication_group = json["publicationGroup"];
188196 retval.publication_stage = json["publicationStage"];
189197 retval.query = Query_from_JSON(json["query"]);
190198 retval.rights = json["rights"];
191199 retval.row_class = json["rowClass"];
200+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
192201 retval.rows_updated_at = json["rowsUpdatedAt"];
193202 retval.rows_updated_by = json["rowsUpdatedBy"];
194203 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
204+ if (!intp(json["tableId"])) error("Expected integer");
195205 retval.table_id = json["tableId"];
196206 retval.tags = json["tags"];
207+ if (!intp(json["totalTimesRated"])) error("Expected integer");
197208 retval.total_times_rated = json["totalTimesRated"];
209+ if (!intp(json["viewCount"])) error("Expected integer");
198210 retval.view_count = json["viewCount"];
211+ if (!intp(json["viewLastModified"])) error("Expected integer");
199212 retval.view_last_modified = json["viewLastModified"];
200213 retval.view_type = json["viewType"];
201214
@@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) {
242255 retval.field_name = json["fieldName"];
243256 retval.flags = json["flags"];
244257 retval.format = Query_from_JSON(json["format"]);
258+ if (!intp(json["id"])) error("Expected integer");
245259 retval.id = json["id"];
246260 retval.name = json["name"];
261+ if (!intp(json["position"])) error("Expected integer");
247262 retval.position = json["position"];
248263 retval.render_type_name = json["renderTypeName"];
249264 retval.table_column_id = json["tableColumnId"];
@@ -281,7 +296,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
281296
282297 retval.average = json["average"];
283298 retval.largest = json["largest"];
299+ if (!intp(json["non_null"])) error("Expected integer");
284300 retval.non_null = json["non_null"];
301+ if (!intp(json["null"])) error("Expected integer");
285302 retval.null = json["null"];
286303 retval.smallest = json["smallest"];
287304 retval.sum = json["sum"];
@@ -307,6 +324,7 @@ class Top {
307324 Top Top_from_JSON(mixed json) {
308325 Top retval = Top();
309326
327+ if (!intp(json["count"])) error("Expected integer");
310328 retval.count = json["count"];
311329 retval.item = json["item"];
Test case

test/inputs/json/misc/437e7.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -392,6 +393,7 @@ Meta Meta_from_JSON(mixed json) {
392393
393394 retval.msg = json["msg"];
394395 retval.response_id = json["response_id"];
396+ if (!intp(json["status"])) error("Expected integer");
395397 retval.status = json["status"];
396398
397399 return retval;
@@ -416,8 +418,11 @@ class Pagination {
416418 Pagination Pagination_from_JSON(mixed json) {
417419 Pagination retval = Pagination();
418420
421+ if (!intp(json["count"])) error("Expected integer");
419422 retval.count = json["count"];
423+ if (!intp(json["offset"])) error("Expected integer");
420424 retval.offset = json["offset"];
425+ if (!intp(json["total_count"])) error("Expected integer");
421426 retval.total_count = json["total_count"];
422427
423428 return retval;
Test case

test/inputs/json/misc/43970.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -37,6 +37,7 @@ class TopLevelElement {
3737 TopLevelElement TopLevelElement_from_JSON(mixed json) {
3838 TopLevelElement retval = TopLevelElement();
3939
40+ if (!intp(json["ID"])) error("Expected integer");
4041 retval.id = json["ID"];
4142 retval.name = json["Name"];
4243 retval.notes = json["Notes"];
Test case

test/inputs/json/misc/458db.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
7979 ResponseInfo retval = ResponseInfo();
8080
8181 retval.developer_message = json["developerMessage"];
82+ if (!intp(json["status"])) error("Expected integer");
8283 retval.status = json["status"];
8384
8485 return retval;
@@ -103,8 +104,11 @@ class Resultset {
103104 Resultset Resultset_from_JSON(mixed json) {
104105 Resultset retval = Resultset();
105106
107+ if (!intp(json["count"])) error("Expected integer");
106108 retval.count = json["count"];
109+ if (!intp(json["page"])) error("Expected integer");
107110 retval.page = json["page"];
111+ if (!intp(json["pagesize"])) error("Expected integer");
108112 retval.pagesize = json["pagesize"];
109113
110114 return retval;
Test case

test/inputs/json/misc/4961a.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/4a0d7.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/4a455.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3535
3636 retval.crs = Crs_from_JSON(json["crs"]);
3737 retval.features = json["features"];
38+ if (!intp(json["totalFeatures"])) error("Expected integer");
3839 retval.total_features = json["totalFeatures"];
3940 retval.type = json["type"];
Test case

test/inputs/json/misc/4c547.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/4d6fb.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -251,9 +251,11 @@ ChildData ChildData_from_JSON(mixed json) {
251251 retval.created_utc = (float)json["created_utc"];
252252 retval.distinguished = json["distinguished"];
253253 retval.domain = json["domain"];
254+ if (!intp(json["downs"])) error("Expected integer");
254255 retval.downs = json["downs"];
255256 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
256257 retval.edited = json["edited"];
258+ if (!intp(json["gilded"])) error("Expected integer");
257259 retval.gilded = json["gilded"];
258260 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
259261 retval.hidden = json["hidden"];
@@ -274,6 +276,7 @@ ChildData ChildData_from_JSON(mixed json) {
274276 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
275277 retval.mod_reports = json["mod_reports"];
276278 retval.name = json["name"];
279+ if (!intp(json["num_comments"])) error("Expected integer");
277280 retval.num_comments = json["num_comments"];
278281 retval.num_reports = json["num_reports"];
279282 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) {
287290 retval.report_reasons = json["report_reasons"];
288291 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
289292 retval.saved = json["saved"];
293+ if (!intp(json["score"])) error("Expected integer");
290294 retval.score = json["score"];
291295 if (!has_index(json, "secure_media")) error("Missing required property");
292296 retval.secure_media = json["secure_media"] == Val.null ? Val.null : Media_from_JSON(json["secure_media"]);
@@ -303,11 +307,14 @@ ChildData ChildData_from_JSON(mixed json) {
303307 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
304308 retval.suggested_sort = json["suggested_sort"];
305309 retval.thumbnail = json["thumbnail"];
310+ if (!intp(json["thumbnail_height"])) error("Expected integer");
306311 if (!has_index(json, "thumbnail_height")) error("Missing required property");
307312 retval.thumbnail_height = json["thumbnail_height"];
313+ if (!intp(json["thumbnail_width"])) error("Expected integer");
308314 if (!has_index(json, "thumbnail_width")) error("Missing required property");
309315 retval.thumbnail_width = json["thumbnail_width"];
310316 retval.title = json["title"];
317+ if (!intp(json["ups"])) error("Expected integer");
311318 retval.ups = json["ups"];
312319 retval.url = json["url"];
313320 retval.user_reports = json["user_reports"];
@@ -382,16 +389,20 @@ Oembed Oembed_from_JSON(mixed json) {
382389
383390 retval.author_name = json["author_name"];
384391 retval.author_url = json["author_url"];
392+ if (!intp(json["height"])) error("Expected integer");
385393 retval.height = json["height"];
386394 retval.html = json["html"];
387395 retval.provider_name = json["provider_name"];
388396 retval.provider_url = json["provider_url"];
397+ if (!intp(json["thumbnail_height"])) error("Expected integer");
389398 retval.thumbnail_height = json["thumbnail_height"];
390399 retval.thumbnail_url = json["thumbnail_url"];
400+ if (!intp(json["thumbnail_width"])) error("Expected integer");
391401 retval.thumbnail_width = json["thumbnail_width"];
392402 retval.title = json["title"];
393403 retval.type = json["type"];
394404 retval.version = json["version"];
405+ if (!intp(json["width"])) error("Expected integer");
395406 retval.width = json["width"];
396407
397408 return retval;
@@ -507,8 +518,10 @@ class Source {
507518 Source Source_from_JSON(mixed json) {
508519 Source retval = Source();
509520
521+ if (!intp(json["height"])) error("Expected integer");
510522 retval.height = json["height"];
511523 retval.url = json["url"];
524+ if (!intp(json["width"])) error("Expected integer");
512525 retval.width = json["width"];
513526
514527 return retval;
Test case

test/inputs/json/misc/4e336.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/54d32.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
Test case

test/inputs/json/misc/5eae5.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -40,6 +40,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
4040 TopLevelElement retval = TopLevelElement();
4141
4242 retval.date = json["Date"];
43+ if (!intp(json["ID"])) error("Expected integer");
4344 retval.id = json["ID"];
4445 retval.sponsor = json["Sponsor"];
4546 retval.title = json["Title"];
Test case

test/inputs/json/misc/5f7fe.json

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -152,12 +152,15 @@ View View_from_JSON(mixed json) {
152152
153153 retval.attribution = json["attribution"];
154154 retval.attribution_link = json["attributionLink"];
155+ if (!intp(json["averageRating"])) error("Expected integer");
155156 retval.average_rating = json["averageRating"];
156157 retval.category = json["category"];
157158 retval.columns = json["columns"];
159+ if (!intp(json["createdAt"])) error("Expected integer");
158160 retval.created_at = json["createdAt"];
159161 retval.description = json["description"];
160162 retval.display_type = json["displayType"];
163+ if (!intp(json["downloadCount"])) error("Expected integer");
161164 retval.download_count = json["downloadCount"];
162165 retval.flags = json["flags"];
163166 retval.grants = json["grants"];
@@ -166,30 +169,40 @@ View View_from_JSON(mixed json) {
166169 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
167170 retval.hide_from_data_json = json["hideFromDataJson"];
168171 retval.id = json["id"];
172+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
169173 retval.index_updated_at = json["indexUpdatedAt"];
170174 retval.locale = json["locale"];
171175 retval.metadata = Metadata_from_JSON(json["metadata"]);
172176 retval.name = json["name"];
173177 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
174178 retval.new_backend = json["newBackend"];
179+ if (!intp(json["numberOfComments"])) error("Expected integer");
175180 retval.number_of_comments = json["numberOfComments"];
181+ if (!intp(json["oid"])) error("Expected integer");
176182 retval.oid = json["oid"];
177183 retval.owner = Owner_from_JSON(json["owner"]);
178184 retval.provenance = json["provenance"];
179185 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
180186 retval.publication_append_enabled = json["publicationAppendEnabled"];
187+ if (!intp(json["publicationDate"])) error("Expected integer");
181188 retval.publication_date = json["publicationDate"];
189+ if (!intp(json["publicationGroup"])) error("Expected integer");
182190 retval.publication_group = json["publicationGroup"];
183191 retval.publication_stage = json["publicationStage"];
184192 retval.query = Query_from_JSON(json["query"]);
185193 retval.rights = json["rights"];
194+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
186195 retval.rows_updated_at = json["rowsUpdatedAt"];
187196 retval.rows_updated_by = json["rowsUpdatedBy"];
188197 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
198+ if (!intp(json["tableId"])) error("Expected integer");
189199 retval.table_id = json["tableId"];
190200 retval.tags = json["tags"];
201+ if (!intp(json["totalTimesRated"])) error("Expected integer");
191202 retval.total_times_rated = json["totalTimesRated"];
203+ if (!intp(json["viewCount"])) error("Expected integer");
192204 retval.view_count = json["viewCount"];
205+ if (!intp(json["viewLastModified"])) error("Expected integer");
193206 retval.view_last_modified = json["viewLastModified"];
194207 retval.view_type = json["viewType"];
195208
@@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) {
236249 retval.field_name = json["fieldName"];
237250 retval.flags = json["flags"];
238251 retval.format = Format_from_JSON(json["format"]);
252+ if (!intp(json["id"])) error("Expected integer");
239253 retval.id = json["id"];
240254 retval.name = json["name"];
255+ if (!intp(json["position"])) error("Expected integer");
241256 retval.position = json["position"];
242257 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
243258 retval.table_column_id = json["tableColumnId"];
@@ -270,7 +285,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
270285 CachedContents retval = CachedContents();
271286
272287 retval.largest = json["largest"];
288+ if (!intp(json["non_null"])) error("Expected integer");
273289 retval.non_null = json["non_null"];
290+ if (!intp(json["null"])) error("Expected integer");
274291 retval.null = json["null"];
275292 retval.smallest = json["smallest"];
276293 retval.top = json["top"];
@@ -295,6 +312,7 @@ class Top {
295312 Top Top_from_JSON(mixed json) {
296313 Top retval = Top();
297314
315+ if (!intp(json["count"])) error("Expected integer");
298316 retval.count = json["count"];
299317 retval.item = json["item"];
300318
@@ -777,6 +795,7 @@ class Expression {
777795 Expression Expression_from_JSON(mixed json) {
778796 Expression retval = Expression();
779797
798+ if (!intp(json["columnId"])) error("Expected integer");
780799 retval.column_id = json["columnId"];
781800 retval.type = json["type"];
Test case

test/inputs/json/misc/617e8.json

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -152,12 +152,15 @@ View View_from_JSON(mixed json) {
152152
153153 retval.attribution = json["attribution"];
154154 retval.attribution_link = json["attributionLink"];
155+ if (!intp(json["averageRating"])) error("Expected integer");
155156 retval.average_rating = json["averageRating"];
156157 retval.category = json["category"];
157158 retval.columns = json["columns"];
159+ if (!intp(json["createdAt"])) error("Expected integer");
158160 retval.created_at = json["createdAt"];
159161 retval.description = json["description"];
160162 retval.display_type = json["displayType"];
163+ if (!intp(json["downloadCount"])) error("Expected integer");
161164 retval.download_count = json["downloadCount"];
162165 retval.flags = json["flags"];
163166 retval.grants = json["grants"];
@@ -166,30 +169,40 @@ View View_from_JSON(mixed json) {
166169 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
167170 retval.hide_from_data_json = json["hideFromDataJson"];
168171 retval.id = json["id"];
172+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
169173 retval.index_updated_at = json["indexUpdatedAt"];
170174 retval.locale = json["locale"];
171175 retval.metadata = Metadata_from_JSON(json["metadata"]);
172176 retval.name = json["name"];
173177 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
174178 retval.new_backend = json["newBackend"];
179+ if (!intp(json["numberOfComments"])) error("Expected integer");
175180 retval.number_of_comments = json["numberOfComments"];
181+ if (!intp(json["oid"])) error("Expected integer");
176182 retval.oid = json["oid"];
177183 retval.owner = Owner_from_JSON(json["owner"]);
178184 retval.provenance = json["provenance"];
179185 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
180186 retval.publication_append_enabled = json["publicationAppendEnabled"];
187+ if (!intp(json["publicationDate"])) error("Expected integer");
181188 retval.publication_date = json["publicationDate"];
189+ if (!intp(json["publicationGroup"])) error("Expected integer");
182190 retval.publication_group = json["publicationGroup"];
183191 retval.publication_stage = json["publicationStage"];
184192 retval.query = Query_from_JSON(json["query"]);
185193 retval.rights = json["rights"];
194+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
186195 retval.rows_updated_at = json["rowsUpdatedAt"];
187196 retval.rows_updated_by = json["rowsUpdatedBy"];
188197 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
198+ if (!intp(json["tableId"])) error("Expected integer");
189199 retval.table_id = json["tableId"];
190200 retval.tags = json["tags"];
201+ if (!intp(json["totalTimesRated"])) error("Expected integer");
191202 retval.total_times_rated = json["totalTimesRated"];
203+ if (!intp(json["viewCount"])) error("Expected integer");
192204 retval.view_count = json["viewCount"];
205+ if (!intp(json["viewLastModified"])) error("Expected integer");
193206 retval.view_last_modified = json["viewLastModified"];
194207 retval.view_type = json["viewType"];
195208
@@ -239,8 +252,10 @@ Column Column_from_JSON(mixed json) {
239252 retval.field_name = json["fieldName"];
240253 retval.flags = json["flags"];
241254 retval.format = Format_from_JSON(json["format"]);
255+ if (!intp(json["id"])) error("Expected integer");
242256 retval.id = json["id"];
243257 retval.name = json["name"];
258+ if (!intp(json["position"])) error("Expected integer");
244259 retval.position = json["position"];
245260 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
246261 retval.table_column_id = json["tableColumnId"];
@@ -273,7 +288,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
273288 CachedContents retval = CachedContents();
274289
275290 retval.largest = json["largest"];
291+ if (!intp(json["non_null"])) error("Expected integer");
276292 retval.non_null = json["non_null"];
293+ if (!intp(json["null"])) error("Expected integer");
277294 retval.null = json["null"];
278295 retval.smallest = json["smallest"];
279296 retval.top = json["top"];
@@ -298,6 +315,7 @@ class Top {
298315 Top Top_from_JSON(mixed json) {
299316 Top retval = Top();
300317
318+ if (!intp(json["count"])) error("Expected integer");
301319 retval.count = json["count"];
302320 retval.item = json["item"];
303321
@@ -774,6 +792,7 @@ class Expression {
774792 Expression Expression_from_JSON(mixed json) {
775793 Expression retval = Expression();
776794
795+ if (!intp(json["columnId"])) error("Expected integer");
777796 retval.column_id = json["columnId"];
778797 retval.type = json["type"];
Test case

test/inputs/json/misc/65dec.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
5353 retval.code = json["code"];
5454 retval.gatherer_code = json["gathererCode"];
5555 retval.magic_cards_info_code = json["magicCardsInfoCode"];
56+ if (!intp(json["mkm_id"])) error("Expected integer");
5657 retval.mkm_id = json["mkm_id"];
5758 retval.mkm_name = json["mkm_name"];
5859 retval.name = json["name"];
@@ -132,6 +133,7 @@ Card Card_from_JSON(mixed json) {
132133 Card retval = Card();
133134
134135 retval.artist = json["artist"];
136+ if (!intp(json["cmc"])) error("Expected integer");
135137 retval.cmc = json["cmc"];
136138 retval.color_identity = json["colorIdentity"];
137139 retval.colors = json["colors"];
@@ -142,6 +144,7 @@ Card Card_from_JSON(mixed json) {
142144 retval.legalities = json["legalities"];
143145 retval.mana_cost = json["manaCost"];
144146 retval.mci_number = json["mciNumber"];
147+ if (!intp(json["multiverseid"])) error("Expected integer");
145148 retval.multiverseid = json["multiverseid"];
146149 retval.name = json["name"];
147150 retval.original_text = json["originalText"];
Test case

test/inputs/json/misc/6617c.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -33,6 +33,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3333
3434 retval.iss_position = IssPosition_from_JSON(json["iss_position"]);
3535 retval.message = json["message"];
36+ if (!intp(json["timestamp"])) error("Expected integer");
3637 retval.timestamp = json["timestamp"];
3738
3839 return retval;
Test case

test/inputs/json/misc/67c03.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -32,6 +32,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3232 TopLevel retval = TopLevel();
3333
3434 retval.message = json["message"];
35+ if (!intp(json["number"])) error("Expected integer");
3536 retval.number = json["number"];
3637 retval.people = json["people"];
Test case

test/inputs/json/misc/68c30.json

1 generated file · +12 −0
Mpikedefault / TopLevel.pmod+12 −0
@@ -73,14 +73,21 @@ Tx Tx_from_JSON(mixed json) {
7373 retval.double_spend = json["double_spend"];
7474 retval.hash = json["hash"];
7575 retval.inputs = json["inputs"];
76+ if (!intp(json["lock_time"])) error("Expected integer");
7677 retval.lock_time = json["lock_time"];
7778 retval.out = json["out"];
7879 retval.relayed_by = json["relayed_by"];
80+ if (!intp(json["size"])) error("Expected integer");
7981 retval.size = json["size"];
82+ if (!intp(json["time"])) error("Expected integer");
8083 retval.time = json["time"];
84+ if (!intp(json["tx_index"])) error("Expected integer");
8185 retval.tx_index = json["tx_index"];
86+ if (!intp(json["ver"])) error("Expected integer");
8287 retval.ver = json["ver"];
88+ if (!intp(json["vin_sz"])) error("Expected integer");
8389 retval.vin_sz = json["vin_sz"];
90+ if (!intp(json["vout_sz"])) error("Expected integer");
8491 retval.vout_sz = json["vout_sz"];
8592
8693 return retval;
@@ -107,6 +114,7 @@ Input Input_from_JSON(mixed json) {
107114
108115 retval.prev_out = Out_from_JSON(json["prev_out"]);
109116 retval.script = json["script"];
117+ if (!intp(json["sequence"])) error("Expected integer");
110118 retval.sequence = json["sequence"];
111119
112120 return retval;
@@ -140,12 +148,16 @@ Out Out_from_JSON(mixed json) {
140148 Out retval = Out();
141149
142150 retval.addr = json["addr"];
151+ if (!intp(json["n"])) error("Expected integer");
143152 retval.n = json["n"];
144153 retval.script = json["script"];
145154 if (json["spent"] != Standards.JSON.true && json["spent"] != Standards.JSON.false) error("Expected bool");
146155 retval.spent = json["spent"];
156+ if (!intp(json["tx_index"])) error("Expected integer");
147157 retval.tx_index = json["tx_index"];
158+ if (!intp(json["type"])) error("Expected integer");
148159 retval.type = json["type"];
160+ if (!intp(json["value"])) error("Expected integer");
149161 retval.value = json["value"];
150162
151163 return retval;
Test case

test/inputs/json/misc/6c155.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
7979 ResponseInfo retval = ResponseInfo();
8080
8181 retval.developer_message = json["developerMessage"];
82+ if (!intp(json["status"])) error("Expected integer");
8283 retval.status = json["status"];
8384
8485 return retval;
@@ -103,8 +104,11 @@ class Resultset {
103104 Resultset Resultset_from_JSON(mixed json) {
104105 Resultset retval = Resultset();
105106
107+ if (!intp(json["count"])) error("Expected integer");
106108 retval.count = json["count"];
109+ if (!intp(json["page"])) error("Expected integer");
107110 retval.page = json["page"];
111+ if (!intp(json["pagesize"])) error("Expected integer");
108112 retval.pagesize = json["pagesize"];
109113
110114 return retval;
Test case

test/inputs/json/misc/6de06.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) {
253253 retval.created_utc = (float)json["created_utc"];
254254 retval.distinguished = json["distinguished"];
255255 retval.domain = json["domain"];
256+ if (!intp(json["downs"])) error("Expected integer");
256257 retval.downs = json["downs"];
257258 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
258259 retval.edited = json["edited"];
260+ if (!intp(json["gilded"])) error("Expected integer");
259261 retval.gilded = json["gilded"];
260262 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
261263 retval.hidden = json["hidden"];
@@ -278,6 +280,7 @@ ChildData ChildData_from_JSON(mixed json) {
278280 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
279281 retval.mod_reports = json["mod_reports"];
280282 retval.name = json["name"];
283+ if (!intp(json["num_comments"])) error("Expected integer");
281284 retval.num_comments = json["num_comments"];
282285 retval.num_reports = json["num_reports"];
283286 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) {
291294 retval.report_reasons = json["report_reasons"];
292295 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
293296 retval.saved = json["saved"];
297+ if (!intp(json["score"])) error("Expected integer");
294298 retval.score = json["score"];
295299 if (!has_index(json, "secure_media")) error("Missing required property");
296300 retval.secure_media = json["secure_media"] == Val.null ? Val.null : Media_from_JSON(json["secure_media"]);
@@ -309,11 +313,14 @@ ChildData ChildData_from_JSON(mixed json) {
309313 if (!has_index(json, "suggested_sort")) error("Missing required property");
310314 retval.suggested_sort = json["suggested_sort"];
311315 retval.thumbnail = json["thumbnail"];
316+ if (!intp(json["thumbnail_height"])) error("Expected integer");
312317 if (!has_index(json, "thumbnail_height")) error("Missing required property");
313318 retval.thumbnail_height = json["thumbnail_height"];
319+ if (!intp(json["thumbnail_width"])) error("Expected integer");
314320 if (!has_index(json, "thumbnail_width")) error("Missing required property");
315321 retval.thumbnail_width = json["thumbnail_width"];
316322 retval.title = json["title"];
323+ if (!intp(json["ups"])) error("Expected integer");
317324 retval.ups = json["ups"];
318325 retval.url = json["url"];
319326 retval.user_reports = json["user_reports"];
@@ -385,16 +392,20 @@ Oembed Oembed_from_JSON(mixed json) {
385392 Oembed retval = Oembed();
386393
387394 retval.description = json["description"];
395+ if (!intp(json["height"])) error("Expected integer");
388396 retval.height = json["height"];
389397 retval.html = json["html"];
390398 retval.provider_name = json["provider_name"];
391399 retval.provider_url = json["provider_url"];
400+ if (!intp(json["thumbnail_height"])) error("Expected integer");
392401 retval.thumbnail_height = json["thumbnail_height"];
393402 retval.thumbnail_url = json["thumbnail_url"];
403+ if (!intp(json["thumbnail_width"])) error("Expected integer");
394404 retval.thumbnail_width = json["thumbnail_width"];
395405 retval.title = json["title"];
396406 retval.type = json["type"];
397407 retval.version = json["version"];
408+ if (!intp(json["width"])) error("Expected integer");
398409 retval.width = json["width"];
399410
400411 return retval;
@@ -511,8 +522,10 @@ class Source {
511522 Source Source_from_JSON(mixed json) {
512523 Source retval = Source();
513524
525+ if (!intp(json["height"])) error("Expected integer");
514526 retval.height = json["height"];
515527 retval.url = json["url"];
528+ if (!intp(json["width"])) error("Expected integer");
516529 retval.width = json["width"];
517530
518531 return retval;
Test case

test/inputs/json/misc/6dec6.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/6eb00.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -37,7 +37,9 @@ class TopLevelElement {
3737 TopLevelElement TopLevelElement_from_JSON(mixed json) {
3838 TopLevelElement retval = TopLevelElement();
3939
40+ if (!intp(json["DirectorateID"])) error("Expected integer");
4041 retval.directorate_id = json["DirectorateID"];
42+ if (!intp(json["Id"])) error("Expected integer");
4143 retval.id = json["Id"];
4244 retval.name = json["Name"];
Test case

test/inputs/json/misc/734ad.json

1 generated file · +12 −0
Mpikedefault / TopLevel.pmod+12 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
@@ -216,6 +219,7 @@ Result Result_from_JSON(mixed json) {
216219 retval.be_office_street = json["be_office_street"];
217220 retval.be_office_town = json["be_office_town"];
218221 retval.code_of_conduct = json["code_of_conduct"];
222+ if (!intp(json["contact_country"])) error("Expected integer");
219223 retval.contact_country = json["contact_country"];
220224 retval.created_at = json["created_at"];
221225 retval.entity = json["entity"];
@@ -239,15 +243,21 @@ Result Result_from_JSON(mixed json) {
239243 retval.last_update_date = json["last_update_date"];
240244 retval.legal = json["legal"];
241245 retval.legal_status = json["legal_status"];
246+ if (!intp(json["main_category"])) error("Expected integer");
242247 retval.main_category = json["main_category"];
243248 retval.main_category_title = json["main_category_title"];
249+ if (!intp(json["members"])) error("Expected integer");
244250 retval.members = json["members"];
251+ if (!intp(json["members_100"])) error("Expected integer");
245252 if (!has_index(json, "members_100")) error("Missing required property");
246253 retval.members_100 = json["members_100"];
254+ if (!intp(json["members_25"])) error("Expected integer");
247255 if (!has_index(json, "members_25")) error("Missing required property");
248256 retval.members_25 = json["members_25"];
257+ if (!intp(json["members_50"])) error("Expected integer");
249258 if (!has_index(json, "members_50")) error("Missing required property");
250259 retval.members_50 = json["members_50"];
260+ if (!intp(json["members_75"])) error("Expected integer");
251261 if (!has_index(json, "members_75")) error("Missing required property");
252262 retval.members_75 = json["members_75"];
253263 retval.members_fte = (float)json["members_fte"];
@@ -255,6 +265,7 @@ Result Result_from_JSON(mixed json) {
255265 retval.native_name = json["native_name"];
256266 if (!has_index(json, "networking")) error("Missing required property");
257267 retval.networking = json["networking"];
268+ if (!intp(json["number_of_natural_persons"])) error("Expected integer");
258269 if (!has_index(json, "number_of_natural_persons")) error("Missing required property");
259270 retval.number_of_natural_persons = json["number_of_natural_persons"];
260271 if (!has_index(json, "other_code_of_conduct")) error("Missing required property");
@@ -262,6 +273,7 @@ Result Result_from_JSON(mixed json) {
262273 retval.registration_date = json["registration_date"];
263274 retval.status = Status_from_JSON(json["status"]);
264275 retval.structure_members = json["structure_members"];
276+ if (!intp(json["sub_category"])) error("Expected integer");
265277 retval.sub_category = json["sub_category"];
266278 retval.sub_category_title = json["sub_category_title"];
267279 retval.updated_at = json["updated_at"];
Test case

test/inputs/json/misc/7681c.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -408,6 +409,7 @@ Meta Meta_from_JSON(mixed json) {
408409
409410 retval.msg = json["msg"];
410411 retval.response_id = json["response_id"];
412+ if (!intp(json["status"])) error("Expected integer");
411413 retval.status = json["status"];
412414
413415 return retval;
@@ -432,8 +434,11 @@ class Pagination {
432434 Pagination Pagination_from_JSON(mixed json) {
433435 Pagination retval = Pagination();
434436
437+ if (!intp(json["count"])) error("Expected integer");
435438 retval.count = json["count"];
439+ if (!intp(json["offset"])) error("Expected integer");
436440 retval.offset = json["offset"];
441+ if (!intp(json["total_count"])) error("Expected integer");
437442 retval.total_count = json["total_count"];
438443
439444 return retval;
Test case

test/inputs/json/misc/7df41.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -63,8 +63,10 @@ class Pc {
6363 Pc Pc_from_JSON(mixed json) {
6464 Pc retval = Pc();
6565
66+ if (!intp(json["count"])) error("Expected integer");
6667 retval.count = json["count"];
6768 retval.label = json["label"];
69+ if (!intp(json["peak24"])) error("Expected integer");
6870 retval.peak24 = json["peak24"];
6971
7072 return retval;
Test case

test/inputs/json/misc/7dfa6.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/7eb30.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -33,6 +33,7 @@ class TopLevel {
3333 TopLevel TopLevel_from_JSON(mixed json) {
3434 TopLevel retval = TopLevel();
3535
36+ if (!intp(json["count"])) error("Expected integer");
3637 retval.count = json["count"];
3738 retval.next = json["next"];
3839 retval.previous = json["previous"];
@@ -88,12 +89,16 @@ Result Result_from_JSON(mixed json) {
8889 retval.fav = json["fav"];
8990 retval.group = Group_from_JSON(json["group"]);
9091 retval.location = Location_from_JSON(json["location"]);
92+ if (!intp(json["min_screens"])) error("Expected integer");
9193 retval.min_screens = json["min_screens"];
94+ if (!intp(json["num_views"])) error("Expected integer");
9295 retval.num_views = json["num_views"];
9396 retval.showtimes = json["showtimes"];
97+ if (!intp(json["stars"])) error("Expected integer");
9498 retval.stars = json["stars"];
9599 retval.tel = Tel_from_JSON(json["tel"]);
96100 retval.thai = json["thai"];
101+ if (!intp(json["today_screens"])) error("Expected integer");
97102 retval.today_screens = json["today_screens"];
98103 retval.url = json["url"];
99104 retval.website = json["website"];
Test case

test/inputs/json/misc/7f568.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -63,6 +63,7 @@ class TopLevelElement {
6363 TopLevelElement TopLevelElement_from_JSON(mixed json) {
6464 TopLevelElement retval = TopLevelElement();
6565
66+ if (!intp(json["comments"])) error("Expected integer");
6667 retval.comments = json["comments"];
6768 retval.comments_url = json["comments_url"];
6869 retval.commits_url = json["commits_url"];
@@ -113,6 +114,7 @@ File File_from_JSON(mixed json) {
113114 if (!has_index(json, "language")) error("Missing required property");
114115 retval.language = Language_from_JSON(json["language"]);
115116 retval.raw_url = json["raw_url"];
117+ if (!intp(json["size"])) error("Expected integer");
116118 retval.size = json["size"];
117119 retval.type = Type_from_JSON(json["type"]);
Test case

test/inputs/json/misc/7fbfb.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -118,9 +118,12 @@ class FluffyTopLevel {
118118 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
119119 FluffyTopLevel retval = FluffyTopLevel();
120120
121+ if (!intp(json["page"])) error("Expected integer");
121122 retval.page = json["page"];
123+ if (!intp(json["pages"])) error("Expected integer");
122124 retval.pages = json["pages"];
123125 retval.per_page = json["per_page"];
126+ if (!intp(json["total"])) error("Expected integer");
124127 retval.total = json["total"];
125128
126129 return retval;
Test case

test/inputs/json/misc/80aff.json

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -39,11 +39,14 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 if (json["next"] != Standards.JSON.true && json["next"] != Standards.JSON.false) error("Expected bool");
4648 retval.next = json["next"];
49+ if (!intp(json["offset"])) error("Expected integer");
4750 retval.offset = json["offset"];
4851 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4952 retval.previous = json["previous"];
@@ -96,9 +99,12 @@ Result Result_from_JSON(mixed json) {
9699 Result retval = Result();
97100
98101 retval.created_at = json["created_at"];
102+ if (!intp(json["id"])) error("Expected integer");
99103 retval.id = json["id"];
104+ if (!intp(json["items"])) error("Expected integer");
100105 retval.items = json["items"];
101106 retval.name = json["name"];
107+ if (!intp(json["parent"])) error("Expected integer");
102108 if (!has_index(json, "parent")) error("Missing required property");
103109 retval.parent = json["parent"];
104110 retval.updated_at = json["updated_at"];
Test case

test/inputs/json/misc/8592b.json

1 generated file · +9 −0
Mpikedefault / TopLevel.pmod+9 −0
@@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) {
253253 retval.created_utc = (float)json["created_utc"];
254254 retval.distinguished = json["distinguished"];
255255 retval.domain = json["domain"];
256+ if (!intp(json["downs"])) error("Expected integer");
256257 retval.downs = json["downs"];
257258 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
258259 retval.edited = json["edited"];
260+ if (!intp(json["gilded"])) error("Expected integer");
259261 retval.gilded = json["gilded"];
260262 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
261263 retval.hidden = json["hidden"];
@@ -275,6 +277,7 @@ ChildData ChildData_from_JSON(mixed json) {
275277 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
276278 retval.mod_reports = json["mod_reports"];
277279 retval.name = json["name"];
280+ if (!intp(json["num_comments"])) error("Expected integer");
278281 retval.num_comments = json["num_comments"];
279282 retval.num_reports = json["num_reports"];
280283 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) {
288291 retval.report_reasons = json["report_reasons"];
289292 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
290293 retval.saved = json["saved"];
294+ if (!intp(json["score"])) error("Expected integer");
291295 retval.score = json["score"];
292296 retval.secure_media = json["secure_media"];
293297 retval.secure_media_embed = MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -304,11 +308,14 @@ ChildData ChildData_from_JSON(mixed json) {
304308 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
305309 retval.suggested_sort = SuggestedSort_from_JSON(json["suggested_sort"]);
306310 retval.thumbnail = json["thumbnail"];
311+ if (!intp(json["thumbnail_height"])) error("Expected integer");
307312 if (!has_index(json, "thumbnail_height")) error("Missing required property");
308313 retval.thumbnail_height = json["thumbnail_height"];
314+ if (!intp(json["thumbnail_width"])) error("Expected integer");
309315 if (!has_index(json, "thumbnail_width")) error("Missing required property");
310316 retval.thumbnail_width = json["thumbnail_width"];
311317 retval.title = json["title"];
318+ if (!intp(json["ups"])) error("Expected integer");
312319 retval.ups = json["ups"];
313320 retval.url = json["url"];
314321 retval.user_reports = json["user_reports"];
@@ -415,8 +422,10 @@ class Source {
415422 Source Source_from_JSON(mixed json) {
416423 Source retval = Source();
417424
425+ if (!intp(json["height"])) error("Expected integer");
418426 retval.height = json["height"];
419427 retval.url = json["url"];
428+ if (!intp(json["width"])) error("Expected integer");
420429 retval.width = json["width"];
421430
422431 return retval;
Test case

test/inputs/json/misc/88130.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/8a62c.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/9929c.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/9ac3b.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
Test case

test/inputs/json/misc/a0496.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -67,6 +67,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
6767 retval.errors = Errors_from_JSON(json["errors"]);
6868 retval.frequency = json["frequency"];
6969 retval.from_date = json["from_date"];
70+ if (!intp(json["id"])) error("Expected integer");
7071 retval.id = json["id"];
7172 retval.name = json["name"];
7273 if (json["premium"] != Standards.JSON.true && json["premium"] != Standards.JSON.false) error("Expected bool");
Test case

test/inputs/json/misc/a1eca.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -148,11 +148,14 @@ class View {
148148 View View_from_JSON(mixed json) {
149149 View retval = View();
150150
151+ if (!intp(json["averageRating"])) error("Expected integer");
151152 retval.average_rating = json["averageRating"];
152153 retval.category = json["category"];
153154 retval.columns = json["columns"];
155+ if (!intp(json["createdAt"])) error("Expected integer");
154156 retval.created_at = json["createdAt"];
155157 retval.display_type = json["displayType"];
158+ if (!intp(json["downloadCount"])) error("Expected integer");
156159 retval.download_count = json["downloadCount"];
157160 retval.flags = json["flags"];
158161 retval.grants = json["grants"];
@@ -161,6 +164,7 @@ View View_from_JSON(mixed json) {
161164 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
162165 retval.hide_from_data_json = json["hideFromDataJson"];
163166 retval.id = json["id"];
167+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
164168 retval.index_updated_at = json["indexUpdatedAt"];
165169 retval.license = License_from_JSON(json["license"]);
166170 retval.license_id = json["licenseId"];
@@ -169,24 +173,33 @@ View View_from_JSON(mixed json) {
169173 retval.name = json["name"];
170174 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
171175 retval.new_backend = json["newBackend"];
176+ if (!intp(json["numberOfComments"])) error("Expected integer");
172177 retval.number_of_comments = json["numberOfComments"];
178+ if (!intp(json["oid"])) error("Expected integer");
173179 retval.oid = json["oid"];
174180 retval.owner = Owner_from_JSON(json["owner"]);
175181 retval.provenance = json["provenance"];
176182 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
177183 retval.publication_append_enabled = json["publicationAppendEnabled"];
184+ if (!intp(json["publicationDate"])) error("Expected integer");
178185 retval.publication_date = json["publicationDate"];
186+ if (!intp(json["publicationGroup"])) error("Expected integer");
179187 retval.publication_group = json["publicationGroup"];
180188 retval.publication_stage = json["publicationStage"];
181189 retval.query = Query_from_JSON(json["query"]);
182190 retval.rights = json["rights"];
183191 retval.row_class = json["rowClass"];
192+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
184193 retval.rows_updated_at = json["rowsUpdatedAt"];
185194 retval.rows_updated_by = json["rowsUpdatedBy"];
186195 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
196+ if (!intp(json["tableId"])) error("Expected integer");
187197 retval.table_id = json["tableId"];
198+ if (!intp(json["totalTimesRated"])) error("Expected integer");
188199 retval.total_times_rated = json["totalTimesRated"];
200+ if (!intp(json["viewCount"])) error("Expected integer");
189201 retval.view_count = json["viewCount"];
202+ if (!intp(json["viewLastModified"])) error("Expected integer");
190203 retval.view_last_modified = json["viewLastModified"];
191204 retval.view_type = json["viewType"];
192205
@@ -233,8 +246,10 @@ Column Column_from_JSON(mixed json) {
233246 retval.field_name = json["fieldName"];
234247 retval.flags = json["flags"];
235248 retval.format = Query_from_JSON(json["format"]);
249+ if (!intp(json["id"])) error("Expected integer");
236250 retval.id = json["id"];
237251 retval.name = json["name"];
252+ if (!intp(json["position"])) error("Expected integer");
238253 retval.position = json["position"];
239254 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
240255 retval.table_column_id = json["tableColumnId"];
@@ -272,7 +287,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
272287
273288 retval.average = json["average"];
274289 retval.largest = json["largest"];
290+ if (!intp(json["non_null"])) error("Expected integer");
275291 retval.non_null = json["non_null"];
292+ if (!intp(json["null"])) error("Expected integer");
276293 retval.null = json["null"];
277294 retval.smallest = json["smallest"];
278295 retval.sum = json["sum"];
@@ -298,6 +315,7 @@ class Top {
298315 Top Top_from_JSON(mixed json) {
299316 Top retval = Top();
300317
318+ if (!intp(json["count"])) error("Expected integer");
301319 retval.count = json["count"];
302320 retval.item = json["item"];
Test case

test/inputs/json/misc/a45b0.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/ab0d1.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/abb4b.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/ae7f0.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -243,9 +243,11 @@ ChildData ChildData_from_JSON(mixed json) {
243243 retval.created_utc = (float)json["created_utc"];
244244 retval.distinguished = json["distinguished"];
245245 retval.domain = Domain_from_JSON(json["domain"]);
246+ if (!intp(json["downs"])) error("Expected integer");
246247 retval.downs = json["downs"];
247248 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
248249 retval.edited = json["edited"];
250+ if (!intp(json["gilded"])) error("Expected integer");
249251 retval.gilded = json["gilded"];
250252 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
251253 retval.hidden = json["hidden"];
@@ -267,6 +269,7 @@ ChildData ChildData_from_JSON(mixed json) {
267269 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
268270 retval.mod_reports = json["mod_reports"];
269271 retval.name = json["name"];
272+ if (!intp(json["num_comments"])) error("Expected integer");
270273 retval.num_comments = json["num_comments"];
271274 retval.num_reports = json["num_reports"];
272275 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) {
278281 retval.report_reasons = json["report_reasons"];
279282 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
280283 retval.saved = json["saved"];
284+ if (!intp(json["score"])) error("Expected integer");
281285 retval.score = json["score"];
282286 retval.secure_media = json["secure_media"];
283287 retval.secure_media_embed = MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -294,6 +298,7 @@ ChildData ChildData_from_JSON(mixed json) {
294298 retval.suggested_sort = json["suggested_sort"];
295299 retval.thumbnail = json["thumbnail"];
296300 retval.title = json["title"];
301+ if (!intp(json["ups"])) error("Expected integer");
297302 retval.ups = json["ups"];
298303 retval.url = json["url"];
299304 retval.user_reports = json["user_reports"];
Test case

test/inputs/json/misc/af2d1.json

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -35,6 +35,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3535
3636 retval.crs = Crs_from_JSON(json["crs"]);
3737 retval.features = json["features"];
38+ if (!intp(json["totalFeatures"])) error("Expected integer");
3839 retval.total_features = json["totalFeatures"];
3940 retval.type = json["type"];
4041
@@ -250,6 +251,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
250251 retval.asset_numb = json["asset_numb"];
251252 if (!has_index(json, "comments")) error("Missing required property");
252253 retval.comments = json["comments"];
254+ if (!intp(json["condition"])) error("Expected integer");
253255 retval.condition = json["condition"];
254256 if (!has_index(json, "constructi")) error("Missing required property");
255257 retval.constructi = json["constructi"];
@@ -265,6 +267,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
265267 retval.folder_num = json["folder_num"];
266268 if (!has_index(json, "funding_ba")) error("Missing required property");
267269 retval.funding_ba = FundingBa_from_JSON(json["funding_ba"]);
270+ if (!intp(json["historic_c"])) error("Expected integer");
268271 retval.historic_c = json["historic_c"];
269272 retval.inspection = json["inspection"];
270273 retval.inspectors = json["inspectors"];
@@ -272,8 +275,10 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
272275 if (!has_index(json, "level_accu")) error("Missing required property");
273276 retval.level_accu = LevelAccu_from_JSON(json["level_accu"]);
274277 retval.material = Material_from_JSON(json["material"]);
278+ if (!intp(json["mi_prinx"])) error("Expected integer");
275279 retval.mi_prinx = json["mi_prinx"];
276280 retval.mi_symbolo = MiSymbolo_from_JSON(json["mi_symbolo"]);
281+ if (!intp(json["number_lan"])) error("Expected integer");
277282 retval.number_lan = json["number_lan"];
278283 if (!has_index(json, "owner")) error("Missing required property");
279284 retval.owner = json["owner"];
@@ -281,6 +286,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
281286 retval.positional = LevelAccu_from_JSON(json["positional"]);
282287 if (!has_index(json, "project_nu")) error("Missing required property");
283288 retval.project_nu = json["project_nu"];
289+ if (!intp(json["rec_id"])) error("Expected integer");
284290 retval.rec_id = json["rec_id"];
285291 if (!has_index(json, "record_cre")) error("Missing required property");
286292 retval.record_cre = json["record_cre"];
Test case

test/inputs/json/misc/b6f2c.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/bb1ec.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/be234.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -253,9 +253,11 @@ ChildData ChildData_from_JSON(mixed json) {
253253 if (!has_index(json, "distinguished")) error("Missing required property");
254254 retval.distinguished = json["distinguished"];
255255 retval.domain = Domain_from_JSON(json["domain"]);
256+ if (!intp(json["downs"])) error("Expected integer");
256257 retval.downs = json["downs"];
257258 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
258259 retval.edited = json["edited"];
260+ if (!intp(json["gilded"])) error("Expected integer");
259261 retval.gilded = json["gilded"];
260262 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
261263 retval.hidden = json["hidden"];
@@ -276,6 +278,7 @@ ChildData ChildData_from_JSON(mixed json) {
276278 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
277279 retval.mod_reports = json["mod_reports"];
278280 retval.name = json["name"];
281+ if (!intp(json["num_comments"])) error("Expected integer");
279282 retval.num_comments = json["num_comments"];
280283 retval.num_reports = json["num_reports"];
281284 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) {
289292 retval.report_reasons = json["report_reasons"];
290293 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
291294 retval.saved = json["saved"];
295+ if (!intp(json["score"])) error("Expected integer");
292296 retval.score = json["score"];
293297 if (!has_index(json, "secure_media")) error("Missing required property");
294298 retval.secure_media = json["secure_media"] == Val.null ? Val.null : Media_from_JSON(json["secure_media"]);
@@ -305,9 +309,12 @@ ChildData ChildData_from_JSON(mixed json) {
305309 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
306310 retval.suggested_sort = json["suggested_sort"];
307311 retval.thumbnail = json["thumbnail"];
312+ if (!intp(json["thumbnail_height"])) error("Expected integer");
308313 retval.thumbnail_height = json["thumbnail_height"];
314+ if (!intp(json["thumbnail_width"])) error("Expected integer");
309315 retval.thumbnail_width = json["thumbnail_width"];
310316 retval.title = json["title"];
317+ if (!intp(json["ups"])) error("Expected integer");
311318 retval.ups = json["ups"];
312319 retval.url = json["url"];
313320 retval.user_reports = json["user_reports"];
@@ -391,16 +398,20 @@ Oembed Oembed_from_JSON(mixed json) {
391398 Oembed retval = Oembed();
392399
393400 retval.description = json["description"];
401+ if (!intp(json["height"])) error("Expected integer");
394402 retval.height = json["height"];
395403 retval.html = json["html"];
396404 retval.provider_name = json["provider_name"];
397405 retval.provider_url = json["provider_url"];
406+ if (!intp(json["thumbnail_height"])) error("Expected integer");
398407 retval.thumbnail_height = json["thumbnail_height"];
399408 retval.thumbnail_url = json["thumbnail_url"];
409+ if (!intp(json["thumbnail_width"])) error("Expected integer");
400410 retval.thumbnail_width = json["thumbnail_width"];
401411 retval.title = json["title"];
402412 retval.type = json["type"];
403413 retval.version = json["version"];
414+ if (!intp(json["width"])) error("Expected integer");
404415 retval.width = json["width"];
405416
406417 return retval;
@@ -517,8 +528,10 @@ class Source {
517528 Source Source_from_JSON(mixed json) {
518529 Source retval = Source();
519530
531+ if (!intp(json["height"])) error("Expected integer");
520532 retval.height = json["height"];
521533 retval.url = json["url"];
534+ if (!intp(json["width"])) error("Expected integer");
522535 retval.width = json["width"];
523536
524537 return retval;
Test case

test/inputs/json/misc/c0356.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -78,6 +78,7 @@ Description Description_from_JSON(mixed json) {
7878 Description retval = Description();
7979
8080 retval.base_period = json["base_period"];
81+ if (!intp(json["missing"])) error("Expected integer");
8182 retval.missing = json["missing"];
8283 retval.title = json["title"];
Test case

test/inputs/json/misc/c3303.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -403,6 +404,7 @@ Meta Meta_from_JSON(mixed json) {
403404
404405 retval.msg = json["msg"];
405406 retval.response_id = json["response_id"];
407+ if (!intp(json["status"])) error("Expected integer");
406408 retval.status = json["status"];
407409
408410 return retval;
@@ -427,8 +429,11 @@ class Pagination {
427429 Pagination Pagination_from_JSON(mixed json) {
428430 Pagination retval = Pagination();
429431
432+ if (!intp(json["count"])) error("Expected integer");
430433 retval.count = json["count"];
434+ if (!intp(json["offset"])) error("Expected integer");
431435 retval.offset = json["offset"];
436+ if (!intp(json["total_count"])) error("Expected integer");
432437 retval.total_count = json["total_count"];
433438
434439 return retval;
Test case

test/inputs/json/misc/c8c7e.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -118,9 +118,12 @@ class FluffyTopLevel {
118118 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
119119 FluffyTopLevel retval = FluffyTopLevel();
120120
121+ if (!intp(json["page"])) error("Expected integer");
121122 retval.page = json["page"];
123+ if (!intp(json["pages"])) error("Expected integer");
122124 retval.pages = json["pages"];
123125 retval.per_page = json["per_page"];
126+ if (!intp(json["total"])) error("Expected integer");
124127 retval.total = json["total"];
125128
126129 return retval;
Test case

test/inputs/json/misc/cda6c.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -118,9 +118,12 @@ class FluffyTopLevel {
118118 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
119119 FluffyTopLevel retval = FluffyTopLevel();
120120
121+ if (!intp(json["page"])) error("Expected integer");
121122 retval.page = json["page"];
123+ if (!intp(json["pages"])) error("Expected integer");
122124 retval.pages = json["pages"];
123125 retval.per_page = json["per_page"];
126+ if (!intp(json["total"])) error("Expected integer");
124127 retval.total = json["total"];
125128
126129 return retval;
Test case

test/inputs/json/misc/cf0d8.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/d0908.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -50,6 +50,7 @@ TotalPopulation TotalPopulation_from_JSON(mixed json) {
5050 TotalPopulation retval = TotalPopulation();
5151
5252 retval.date = json["date"];
53+ if (!intp(json["population"])) error("Expected integer");
5354 retval.population = json["population"];
5455
5556 return retval;
Test case

test/inputs/json/misc/d23d5.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -39,10 +39,13 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["count"])) error("Expected integer");
4243 retval.count = json["count"];
4344 retval.facets = Facets_from_JSON(json["facets"]);
45+ if (!intp(json["limit"])) error("Expected integer");
4446 retval.limit = json["limit"];
4547 retval.next = json["next"];
48+ if (!intp(json["offset"])) error("Expected integer");
4649 retval.offset = json["offset"];
4750 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
4851 retval.previous = json["previous"];
Test case

test/inputs/json/misc/dbfb3.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/dc44f.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
5353 retval.code = json["code"];
5454 retval.gatherer_code = json["gathererCode"];
5555 retval.magic_cards_info_code = json["magicCardsInfoCode"];
56+ if (!intp(json["mkm_id"])) error("Expected integer");
5657 retval.mkm_id = json["mkm_id"];
5758 retval.mkm_name = json["mkm_name"];
5859 retval.name = json["name"];
@@ -140,6 +141,7 @@ Card Card_from_JSON(mixed json) {
140141 Card retval = Card();
141142
142143 retval.artist = json["artist"];
144+ if (!intp(json["cmc"])) error("Expected integer");
143145 retval.cmc = json["cmc"];
144146 retval.color_identity = json["colorIdentity"];
145147 retval.colors = json["colors"];
@@ -150,6 +152,7 @@ Card Card_from_JSON(mixed json) {
150152 retval.legalities = json["legalities"];
151153 retval.mana_cost = json["manaCost"];
152154 retval.mci_number = json["mciNumber"];
155+ if (!intp(json["multiverseid"])) error("Expected integer");
153156 retval.multiverseid = json["multiverseid"];
154157 retval.name = json["name"];
155158 retval.original_text = json["originalText"];
Test case

test/inputs/json/misc/dd1ce.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -53,6 +53,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
5353 retval.code = json["code"];
5454 retval.gatherer_code = json["gathererCode"];
5555 retval.magic_cards_info_code = json["magicCardsInfoCode"];
56+ if (!intp(json["mkm_id"])) error("Expected integer");
5657 retval.mkm_id = json["mkm_id"];
5758 retval.mkm_name = json["mkm_name"];
5859 retval.name = json["name"];
@@ -140,6 +141,7 @@ Card Card_from_JSON(mixed json) {
140141 Card retval = Card();
141142
142143 retval.artist = json["artist"];
144+ if (!intp(json["cmc"])) error("Expected integer");
143145 retval.cmc = json["cmc"];
144146 retval.color_identity = json["colorIdentity"];
145147 retval.colors = json["colors"];
@@ -150,6 +152,7 @@ Card Card_from_JSON(mixed json) {
150152 retval.legalities = json["legalities"];
151153 retval.mana_cost = json["manaCost"];
152154 retval.mci_number = json["mciNumber"];
155+ if (!intp(json["multiverseid"])) error("Expected integer");
153156 retval.multiverseid = json["multiverseid"];
154157 retval.name = json["name"];
155158 retval.original_text = json["originalText"];
Test case

test/inputs/json/misc/dec3a.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -79,6 +79,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
7979 ResponseInfo retval = ResponseInfo();
8080
8181 retval.developer_message = json["developerMessage"];
82+ if (!intp(json["status"])) error("Expected integer");
8283 retval.status = json["status"];
8384
8485 return retval;
@@ -103,8 +104,11 @@ class Resultset {
103104 Resultset Resultset_from_JSON(mixed json) {
104105 Resultset retval = Resultset();
105106
107+ if (!intp(json["count"])) error("Expected integer");
106108 retval.count = json["count"];
109+ if (!intp(json["page"])) error("Expected integer");
107110 retval.page = json["page"];
111+ if (!intp(json["pagesize"])) error("Expected integer");
108112 retval.pagesize = json["pagesize"];
109113
110114 return retval;
Test case

test/inputs/json/misc/df957.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/e0ac7.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -397,6 +398,7 @@ Meta Meta_from_JSON(mixed json) {
397398
398399 retval.msg = json["msg"];
399400 retval.response_id = json["response_id"];
401+ if (!intp(json["status"])) error("Expected integer");
400402 retval.status = json["status"];
401403
402404 return retval;
@@ -421,8 +423,11 @@ class Pagination {
421423 Pagination Pagination_from_JSON(mixed json) {
422424 Pagination retval = Pagination();
423425
426+ if (!intp(json["count"])) error("Expected integer");
424427 retval.count = json["count"];
428+ if (!intp(json["offset"])) error("Expected integer");
425429 retval.offset = json["offset"];
430+ if (!intp(json["total_count"])) error("Expected integer");
426431 retval.total_count = json["total_count"];
427432
428433 return retval;
Test case

test/inputs/json/misc/e2915.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -53,6 +53,7 @@ class Query {
5353 Query Query_from_JSON(mixed json) {
5454 Query retval = Query();
5555
56+ if (!intp(json["count"])) error("Expected integer");
5657 retval.count = json["count"];
5758 retval.created = json["created"];
5859 retval.lang = json["lang"];
Test case

test/inputs/json/misc/e53b5.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -118,9 +118,12 @@ class FluffyTopLevel {
118118 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
119119 FluffyTopLevel retval = FluffyTopLevel();
120120
121+ if (!intp(json["page"])) error("Expected integer");
121122 retval.page = json["page"];
123+ if (!intp(json["pages"])) error("Expected integer");
122124 retval.pages = json["pages"];
123125 retval.per_page = json["per_page"];
126+ if (!intp(json["total"])) error("Expected integer");
124127 retval.total = json["total"];
125128
126129 return retval;
Test case

test/inputs/json/misc/e8a0b.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/e8b04.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -111,11 +111,14 @@ class TopLevelElement {
111111 TopLevelElement TopLevelElement_from_JSON(mixed json) {
112112 TopLevelElement retval = TopLevelElement();
113113
114+ if (!intp(json["averageRating"])) error("Expected integer");
114115 retval.average_rating = json["averageRating"];
115116 retval.category = json["category"];
117+ if (!intp(json["createdAt"])) error("Expected integer");
116118 retval.created_at = json["createdAt"];
117119 retval.description = json["description"];
118120 retval.display_type = DisplayType_from_JSON(json["displayType"]);
121+ if (!intp(json["downloadCount"])) error("Expected integer");
119122 retval.download_count = json["downloadCount"];
120123 retval.flags = json["flags"];
121124 retval.grants = json["grants"];
@@ -132,13 +135,16 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
132135 retval.name = json["name"];
133136 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
134137 retval.new_backend = json["newBackend"];
138+ if (!intp(json["numberOfComments"])) error("Expected integer");
135139 retval.number_of_comments = json["numberOfComments"];
140+ if (!intp(json["oid"])) error("Expected integer");
136141 retval.oid = json["oid"];
137142 retval.owner = Owner_from_JSON(json["owner"]);
138143 retval.provenance = Provenance_from_JSON(json["provenance"]);
139144 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
140145 retval.publication_append_enabled = json["publicationAppendEnabled"];
141146 retval.publication_date = json["publicationDate"];
147+ if (!intp(json["publicationGroup"])) error("Expected integer");
142148 retval.publication_group = json["publicationGroup"];
143149 retval.publication_stage = PublicationStage_from_JSON(json["publicationStage"]);
144150 retval.ratings = json["ratings"] == Val.null ? Val.null : Ratings_from_JSON(json["ratings"]);
@@ -149,10 +155,14 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
149155 retval.rows_updated_at = json["rowsUpdatedAt"];
150156 retval.rows_updated_by = RowsUpdatedBy_from_JSON(json["rowsUpdatedBy"]);
151157 retval.table_author = TableAuthor_from_JSON(json["tableAuthor"]);
158+ if (!intp(json["tableId"])) error("Expected integer");
152159 retval.table_id = json["tableId"];
153160 retval.tags = json["tags"];
161+ if (!intp(json["totalTimesRated"])) error("Expected integer");
154162 retval.total_times_rated = json["totalTimesRated"];
163+ if (!intp(json["viewCount"])) error("Expected integer");
155164 retval.view_count = json["viewCount"];
165+ if (!intp(json["viewLastModified"])) error("Expected integer");
156166 retval.view_last_modified = json["viewLastModified"];
157167 retval.view_type = ViewType_from_JSON(json["viewType"]);
158168
@@ -547,6 +557,7 @@ class TableColumnId {
547557 TableColumnId TableColumnId_from_JSON(mixed json) {
548558 TableColumnId retval = TableColumnId();
549559
560+ if (!intp(json["2819740"])) error("Expected integer");
550561 retval.the_2819740 = json["2819740"];
551562
552563 return retval;
@@ -713,6 +724,7 @@ class Field {
713724 Field Field_from_JSON(mixed json) {
714725 Field retval = Field();
715726
727+ if (!intp(json["tableColumnId"])) error("Expected integer");
716728 retval.table_column_id = json["tableColumnId"];
717729 retval.type = FieldType_from_JSON(json["type"]);
718730
@@ -941,6 +953,7 @@ class Ratings {
941953 Ratings Ratings_from_JSON(mixed json) {
942954 Ratings retval = Ratings();
943955
956+ if (!intp(json["rating"])) error("Expected integer");
944957 retval.rating = json["rating"];
945958
946959 return retval;
Test case

test/inputs/json/misc/f22f5.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -243,9 +243,11 @@ ChildData ChildData_from_JSON(mixed json) {
243243 retval.created_utc = (float)json["created_utc"];
244244 retval.distinguished = json["distinguished"];
245245 retval.domain = json["domain"];
246+ if (!intp(json["downs"])) error("Expected integer");
246247 retval.downs = json["downs"];
247248 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
248249 retval.edited = json["edited"];
250+ if (!intp(json["gilded"])) error("Expected integer");
249251 retval.gilded = json["gilded"];
250252 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
251253 retval.hidden = json["hidden"];
@@ -267,6 +269,7 @@ ChildData ChildData_from_JSON(mixed json) {
267269 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
268270 retval.mod_reports = json["mod_reports"];
269271 retval.name = json["name"];
272+ if (!intp(json["num_comments"])) error("Expected integer");
270273 retval.num_comments = json["num_comments"];
271274 retval.num_reports = json["num_reports"];
272275 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) {
278281 retval.report_reasons = json["report_reasons"];
279282 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
280283 retval.saved = json["saved"];
284+ if (!intp(json["score"])) error("Expected integer");
281285 retval.score = json["score"];
282286 retval.secure_media = json["secure_media"];
283287 retval.secure_media_embed = MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -294,6 +298,7 @@ ChildData ChildData_from_JSON(mixed json) {
294298 retval.suggested_sort = json["suggested_sort"];
295299 retval.thumbnail = json["thumbnail"];
296300 retval.title = json["title"];
301+ if (!intp(json["ups"])) error("Expected integer");
297302 retval.ups = json["ups"];
298303 retval.url = json["url"];
299304 retval.user_reports = json["user_reports"];
Test case

test/inputs/json/misc/f3edf.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/f466a.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -43,11 +43,16 @@ class TopLevelElement {
4343 TopLevelElement TopLevelElement_from_JSON(mixed json) {
4444 TopLevelElement retval = TopLevelElement();
4545
46+ if (!intp(json["age"])) error("Expected integer");
4647 retval.age = json["age"];
4748 retval.country = Country_from_JSON(json["country"]);
49+ if (!intp(json["females"])) error("Expected integer");
4850 retval.females = json["females"];
51+ if (!intp(json["males"])) error("Expected integer");
4952 retval.males = json["males"];
53+ if (!intp(json["total"])) error("Expected integer");
5054 retval.total = json["total"];
55+ if (!intp(json["year"])) error("Expected integer");
5156 retval.year = json["year"];
5257
5358 return retval;
Test case

test/inputs/json/misc/f6a65.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -94,6 +94,7 @@ Datum Datum_from_JSON(mixed json) {
9494 retval.id = json["id"];
9595 retval.images = Images_from_JSON(json["images"]);
9696 retval.import_datetime = json["import_datetime"];
97+ if (!intp(json["is_indexable"])) error("Expected integer");
9798 retval.is_indexable = json["is_indexable"];
9899 retval.rating = Rating_from_JSON(json["rating"]);
99100 retval.slug = json["slug"];
@@ -409,6 +410,7 @@ Meta Meta_from_JSON(mixed json) {
409410
410411 retval.msg = json["msg"];
411412 retval.response_id = json["response_id"];
413+ if (!intp(json["status"])) error("Expected integer");
412414 retval.status = json["status"];
413415
414416 return retval;
@@ -433,8 +435,11 @@ class Pagination {
433435 Pagination Pagination_from_JSON(mixed json) {
434436 Pagination retval = Pagination();
435437
438+ if (!intp(json["count"])) error("Expected integer");
436439 retval.count = json["count"];
440+ if (!intp(json["offset"])) error("Expected integer");
437441 retval.offset = json["offset"];
442+ if (!intp(json["total_count"])) error("Expected integer");
438443 retval.total_count = json["total_count"];
439444
440445 return retval;
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -148,11 +148,14 @@ class View {
148148 View View_from_JSON(mixed json) {
149149 View retval = View();
150150
151+ if (!intp(json["averageRating"])) error("Expected integer");
151152 retval.average_rating = json["averageRating"];
152153 retval.category = json["category"];
153154 retval.columns = json["columns"];
155+ if (!intp(json["createdAt"])) error("Expected integer");
154156 retval.created_at = json["createdAt"];
155157 retval.display_type = json["displayType"];
158+ if (!intp(json["downloadCount"])) error("Expected integer");
156159 retval.download_count = json["downloadCount"];
157160 retval.flags = json["flags"];
158161 retval.grants = json["grants"];
@@ -161,6 +164,7 @@ View View_from_JSON(mixed json) {
161164 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
162165 retval.hide_from_data_json = json["hideFromDataJson"];
163166 retval.id = json["id"];
167+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
164168 retval.index_updated_at = json["indexUpdatedAt"];
165169 retval.license = License_from_JSON(json["license"]);
166170 retval.license_id = json["licenseId"];
@@ -169,24 +173,33 @@ View View_from_JSON(mixed json) {
169173 retval.name = json["name"];
170174 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
171175 retval.new_backend = json["newBackend"];
176+ if (!intp(json["numberOfComments"])) error("Expected integer");
172177 retval.number_of_comments = json["numberOfComments"];
178+ if (!intp(json["oid"])) error("Expected integer");
173179 retval.oid = json["oid"];
174180 retval.owner = Owner_from_JSON(json["owner"]);
175181 retval.provenance = json["provenance"];
176182 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
177183 retval.publication_append_enabled = json["publicationAppendEnabled"];
184+ if (!intp(json["publicationDate"])) error("Expected integer");
178185 retval.publication_date = json["publicationDate"];
186+ if (!intp(json["publicationGroup"])) error("Expected integer");
179187 retval.publication_group = json["publicationGroup"];
180188 retval.publication_stage = json["publicationStage"];
181189 retval.query = Query_from_JSON(json["query"]);
182190 retval.rights = json["rights"];
183191 retval.row_class = json["rowClass"];
192+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
184193 retval.rows_updated_at = json["rowsUpdatedAt"];
185194 retval.rows_updated_by = json["rowsUpdatedBy"];
186195 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
196+ if (!intp(json["tableId"])) error("Expected integer");
187197 retval.table_id = json["tableId"];
198+ if (!intp(json["totalTimesRated"])) error("Expected integer");
188199 retval.total_times_rated = json["totalTimesRated"];
200+ if (!intp(json["viewCount"])) error("Expected integer");
189201 retval.view_count = json["viewCount"];
202+ if (!intp(json["viewLastModified"])) error("Expected integer");
190203 retval.view_last_modified = json["viewLastModified"];
191204 retval.view_type = json["viewType"];
192205
@@ -233,8 +246,10 @@ Column Column_from_JSON(mixed json) {
233246 retval.field_name = json["fieldName"];
234247 retval.flags = json["flags"];
235248 retval.format = Query_from_JSON(json["format"]);
249+ if (!intp(json["id"])) error("Expected integer");
236250 retval.id = json["id"];
237251 retval.name = json["name"];
252+ if (!intp(json["position"])) error("Expected integer");
238253 retval.position = json["position"];
239254 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
240255 retval.table_column_id = json["tableColumnId"];
@@ -272,7 +287,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
272287
273288 retval.average = json["average"];
274289 retval.largest = json["largest"];
290+ if (!intp(json["non_null"])) error("Expected integer");
275291 retval.non_null = json["non_null"];
292+ if (!intp(json["null"])) error("Expected integer");
276293 retval.null = json["null"];
277294 retval.smallest = json["smallest"];
278295 retval.sum = json["sum"];
@@ -298,6 +315,7 @@ class Top {
298315 Top Top_from_JSON(mixed json) {
299316 Top retval = Top();
300317
318+ if (!intp(json["count"])) error("Expected integer");
301319 retval.count = json["count"];
302320 retval.item = json["item"];
Test case

test/inputs/json/misc/f974d.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -35,9 +35,12 @@ class TopLevel {
3535 TopLevel TopLevel_from_JSON(mixed json) {
3636 TopLevel retval = TopLevel();
3737
38+ if (!intp(json["block_index"])) error("Expected integer");
3839 retval.block_index = json["block_index"];
3940 retval.hash = json["hash"];
41+ if (!intp(json["height"])) error("Expected integer");
4042 retval.height = json["height"];
43+ if (!intp(json["time"])) error("Expected integer");
4144 retval.time = json["time"];
4245 retval.tx_indexes = json["txIndexes"];
Test case

test/inputs/json/misc/faff5.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -49,7 +49,9 @@ class Response {
4949 Response Response_from_JSON(mixed json) {
5050 Response retval = Response();
5151
52+ if (!intp(json["player_count"])) error("Expected integer");
5253 retval.player_count = json["player_count"];
54+ if (!intp(json["result"])) error("Expected integer");
5355 retval.result = json["result"];
5456
5557 return retval;
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +21 −0
Mpikedefault / TopLevel.pmod+21 −0
@@ -149,12 +149,15 @@ View View_from_JSON(mixed json) {
149149 View retval = View();
150150
151151 retval.attribution = json["attribution"];
152+ if (!intp(json["averageRating"])) error("Expected integer");
152153 retval.average_rating = json["averageRating"];
153154 retval.category = json["category"];
154155 retval.columns = json["columns"];
156+ if (!intp(json["createdAt"])) error("Expected integer");
155157 retval.created_at = json["createdAt"];
156158 retval.description = json["description"];
157159 retval.display_type = json["displayType"];
160+ if (!intp(json["downloadCount"])) error("Expected integer");
158161 retval.download_count = json["downloadCount"];
159162 retval.flags = json["flags"];
160163 retval.grants = json["grants"];
@@ -163,30 +166,40 @@ View View_from_JSON(mixed json) {
163166 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
164167 retval.hide_from_data_json = json["hideFromDataJson"];
165168 retval.id = json["id"];
169+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
166170 retval.index_updated_at = json["indexUpdatedAt"];
167171 retval.locale = json["locale"];
168172 retval.metadata = ViewMetadata_from_JSON(json["metadata"]);
169173 retval.name = json["name"];
170174 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
171175 retval.new_backend = json["newBackend"];
176+ if (!intp(json["numberOfComments"])) error("Expected integer");
172177 retval.number_of_comments = json["numberOfComments"];
178+ if (!intp(json["oid"])) error("Expected integer");
173179 retval.oid = json["oid"];
174180 retval.owner = Owner_from_JSON(json["owner"]);
175181 retval.provenance = json["provenance"];
176182 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
177183 retval.publication_append_enabled = json["publicationAppendEnabled"];
184+ if (!intp(json["publicationDate"])) error("Expected integer");
178185 retval.publication_date = json["publicationDate"];
186+ if (!intp(json["publicationGroup"])) error("Expected integer");
179187 retval.publication_group = json["publicationGroup"];
180188 retval.publication_stage = json["publicationStage"];
181189 retval.query = Query_from_JSON(json["query"]);
182190 retval.rights = json["rights"];
191+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
183192 retval.rows_updated_at = json["rowsUpdatedAt"];
184193 retval.rows_updated_by = json["rowsUpdatedBy"];
185194 retval.table_author = Owner_from_JSON(json["tableAuthor"]);
195+ if (!intp(json["tableId"])) error("Expected integer");
186196 retval.table_id = json["tableId"];
187197 retval.tags = json["tags"];
198+ if (!intp(json["totalTimesRated"])) error("Expected integer");
188199 retval.total_times_rated = json["totalTimesRated"];
200+ if (!intp(json["viewCount"])) error("Expected integer");
189201 retval.view_count = json["viewCount"];
202+ if (!intp(json["viewLastModified"])) error("Expected integer");
190203 retval.view_last_modified = json["viewLastModified"];
191204 retval.view_type = json["viewType"];
192205
@@ -236,8 +249,10 @@ Column Column_from_JSON(mixed json) {
236249 retval.field_name = json["fieldName"];
237250 retval.flags = json["flags"];
238251 retval.format = Format_from_JSON(json["format"]);
252+ if (!intp(json["id"])) error("Expected integer");
239253 retval.id = json["id"];
240254 retval.name = json["name"];
255+ if (!intp(json["position"])) error("Expected integer");
241256 retval.position = json["position"];
242257 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
243258 retval.table_column_id = json["tableColumnId"];
@@ -275,7 +290,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
275290
276291 retval.average = json["average"];
277292 retval.largest = json["largest"];
293+ if (!intp(json["non_null"])) error("Expected integer");
278294 retval.non_null = json["non_null"];
295+ if (!intp(json["null"])) error("Expected integer");
279296 retval.null = json["null"];
280297 retval.smallest = json["smallest"];
281298 retval.sum = json["sum"];
@@ -301,6 +318,7 @@ class Top {
301318 Top Top_from_JSON(mixed json) {
302319 Top retval = Top();
303320
321+ if (!intp(json["count"])) error("Expected integer");
304322 retval.count = json["count"];
305323 retval.item = json["item"];
306324
@@ -669,6 +687,7 @@ class TableColumnId {
669687 TableColumnId TableColumnId_from_JSON(mixed json) {
670688 TableColumnId retval = TableColumnId();
671689
690+ if (!intp(json["703610"])) error("Expected integer");
672691 retval.the_703610 = json["703610"];
673692
674693 return retval;
@@ -693,6 +712,7 @@ FilterConditionMetadata FilterConditionMetadata_from_JSON(mixed json) {
693712
694713 if (json["advanced"] != Standards.JSON.true && json["advanced"] != Standards.JSON.false) error("Expected bool");
695714 retval.advanced = json["advanced"];
715+ if (!intp(json["unifiedVersion"])) error("Expected integer");
696716 retval.unified_version = json["unifiedVersion"];
697717
698718 return retval;
@@ -885,6 +905,7 @@ class Expression {
885905 Expression Expression_from_JSON(mixed json) {
886906 Expression retval = Expression();
887907
908+ if (!intp(json["columnId"])) error("Expected integer");
888909 retval.column_id = json["columnId"];
889910 retval.type = json["type"];
Test case

test/inputs/json/misc/fd329.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) {
8080 Description retval = Description();
8181
8282 retval.base_period = json["base_period"];
83+ if (!intp(json["missing"])) error("Expected integer");
8384 retval.missing = json["missing"];
8485 retval.title = json["title"];
8586 retval.units = json["units"];
Test case

test/inputs/json/priority/bug427.json

1 generated file · +55 −0
Mpikedefault / TopLevel.pmod+55 −0
@@ -40,7 +40,9 @@ TopLevel TopLevel_from_JSON(mixed json) {
4040 retval.children = json["children"];
4141 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
4242 retval.groups = json["groups"];
43+ if (!intp(json["id"])) error("Expected integer");
4344 retval.id = json["id"];
45+ if (!intp(json["kind"])) error("Expected integer");
4446 retval.kind = json["kind"];
4547 retval.name = json["name"];
4648
@@ -84,7 +86,9 @@ TopLevelChild TopLevelChild_from_JSON(mixed json) {
8486 retval.comment = json["comment"] == Val.null ? Val.null : IndecentComment_from_JSON(json["comment"]);
8587 retval.flags = PurpleFlags_from_JSON(json["flags"]);
8688 retval.groups = json["groups"];
89+ if (!intp(json["id"])) error("Expected integer");
8790 retval.id = json["id"];
91+ if (!intp(json["kind"])) error("Expected integer");
8892 retval.kind = json["kind"];
8993 retval.kind_string = TentacledKindString_from_JSON(json["kindString"]);
9094 retval.name = json["name"];
@@ -148,9 +152,11 @@ PurpleChild PurpleChild_from_JSON(mixed json) {
148152 retval.extended_types = json["extendedTypes"];
149153 retval.flags = IndecentFlags_from_JSON(json["flags"]);
150154 retval.groups = json["groups"];
155+ if (!intp(json["id"])) error("Expected integer");
151156 retval.id = json["id"];
152157 retval.implemented_by = json["implementedBy"];
153158 retval.implemented_types = json["implementedTypes"];
159+ if (!intp(json["kind"])) error("Expected integer");
154160 retval.kind = json["kind"];
155161 retval.kind_string = FluffyKindString_from_JSON(json["kindString"]);
156162 retval.name = json["name"];
@@ -215,9 +221,11 @@ FluffyChild FluffyChild_from_JSON(mixed json) {
215221 retval.flags = StickyFlags_from_JSON(json["flags"]);
216222 retval.get_signature = json["getSignature"] == Val.null ? Val.null : GetSignature_from_JSON(json["getSignature"]);
217223 retval.groups = json["groups"];
224+ if (!intp(json["id"])) error("Expected integer");
218225 retval.id = json["id"];
219226 retval.implementation_of = json["implementationOf"] == Val.null ? Val.null : ExtendedBy_from_JSON(json["implementationOf"]);
220227 retval.inherited_from = json["inheritedFrom"] == Val.null ? Val.null : ExtendedBy_from_JSON(json["inheritedFrom"]);
228+ if (!intp(json["kind"])) error("Expected integer");
221229 retval.kind = json["kind"];
222230 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
223231 retval.name = json["name"];
@@ -266,7 +274,9 @@ TentacledChild TentacledChild_from_JSON(mixed json) {
266274 retval.comment = json["comment"] == Val.null ? Val.null : PurpleComment_from_JSON(json["comment"]);
267275 retval.default_value = json["defaultValue"];
268276 retval.flags = PurpleFlags_from_JSON(json["flags"]);
277+ if (!intp(json["id"])) error("Expected integer");
269278 retval.id = json["id"];
279+ if (!intp(json["kind"])) error("Expected integer");
270280 retval.kind = json["kind"];
271281 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
272282 retval.name = json["name"];
@@ -364,7 +374,9 @@ PurpleSignature PurpleSignature_from_JSON(mixed json) {
364374
365375 retval.comment = json["comment"] == Val.null ? Val.null : PurpleComment_from_JSON(json["comment"]);
366376 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
377+ if (!intp(json["id"])) error("Expected integer");
367378 retval.id = json["id"];
379+ if (!intp(json["kind"])) error("Expected integer");
368380 retval.kind = json["kind"];
369381 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
370382 retval.name = json["name"];
@@ -456,7 +468,9 @@ IndexSignatureElement IndexSignatureElement_from_JSON(mixed json) {
456468 IndexSignatureElement retval = IndexSignatureElement();
457469
458470 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
471+ if (!intp(json["id"])) error("Expected integer");
459472 retval.id = json["id"];
473+ if (!intp(json["kind"])) error("Expected integer");
460474 retval.kind = json["kind"];
461475 retval.kind_string = json["kindString"];
462476 retval.name = json["name"];
@@ -523,7 +537,9 @@ GetSignatureChild GetSignatureChild_from_JSON(mixed json) {
523537
524538 retval.comment = json["comment"] == Val.null ? Val.null : FluffyComment_from_JSON(json["comment"]);
525539 retval.flags = FluffyFlags_from_JSON(json["flags"]);
540+ if (!intp(json["id"])) error("Expected integer");
526541 retval.id = json["id"];
542+ if (!intp(json["kind"])) error("Expected integer");
527543 retval.kind = json["kind"];
528544 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
529545 retval.name = json["name"];
@@ -579,7 +595,9 @@ GetSignature GetSignature_from_JSON(mixed json) {
579595 retval.default_value = json["defaultValue"];
580596 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
581597 retval.groups = json["groups"];
598+ if (!intp(json["id"])) error("Expected integer");
582599 retval.id = json["id"];
600+ if (!intp(json["kind"])) error("Expected integer");
583601 retval.kind = json["kind"];
584602 retval.kind_string = json["kindString"];
585603 retval.name = json["name"];
@@ -705,8 +723,10 @@ class Source {
705723 Source Source_from_JSON(mixed json) {
706724 Source retval = Source();
707725
726+ if (!intp(json["character"])) error("Expected integer");
708727 retval.character = json["character"];
709728 retval.file_name = FileName_from_JSON(json["fileName"]);
729+ if (!intp(json["line"])) error("Expected integer");
710730 retval.line = json["line"];
711731
712732 return retval;
@@ -778,6 +798,7 @@ Group Group_from_JSON(mixed json) {
778798 Group retval = Group();
779799
780800 retval.children = json["children"];
801+ if (!intp(json["kind"])) error("Expected integer");
781802 retval.kind = json["kind"];
782803 retval.title = json["title"];
783804
@@ -813,7 +834,9 @@ GetSignatureParameter GetSignatureParameter_from_JSON(mixed json) {
813834
814835 retval.comment = json["comment"] == Val.null ? Val.null : TentacledComment_from_JSON(json["comment"]);
815836 retval.flags = TentacledFlags_from_JSON(json["flags"]);
837+ if (!intp(json["id"])) error("Expected integer");
816838 retval.id = json["id"];
839+ if (!intp(json["kind"])) error("Expected integer");
817840 retval.kind = json["kind"];
818841 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
819842 retval.name = json["name"];
@@ -961,7 +984,9 @@ PurpleDeclaration PurpleDeclaration_from_JSON(mixed json) {
961984 retval.children = json["children"];
962985 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
963986 retval.groups = json["groups"];
987+ if (!intp(json["id"])) error("Expected integer");
964988 retval.id = json["id"];
989+ if (!intp(json["kind"])) error("Expected integer");
965990 retval.kind = json["kind"];
966991 retval.kind_string = json["kindString"];
967992 retval.name = json["name"];
@@ -1162,9 +1187,11 @@ FluffySignature FluffySignature_from_JSON(mixed json) {
11621187
11631188 retval.comment = json["comment"] == Val.null ? Val.null : StickyComment_from_JSON(json["comment"]);
11641189 retval.flags = IndigoFlags_from_JSON(json["flags"]);
1190+ if (!intp(json["id"])) error("Expected integer");
11651191 retval.id = json["id"];
11661192 retval.implementation_of = json["implementationOf"] == Val.null ? Val.null : ExtendedBy_from_JSON(json["implementationOf"]);
11671193 retval.inherited_from = json["inheritedFrom"] == Val.null ? Val.null : ExtendedBy_from_JSON(json["inheritedFrom"]);
1194+ if (!intp(json["kind"])) error("Expected integer");
11681195 retval.kind = json["kind"];
11691196 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
11701197 retval.name = json["name"];
@@ -1228,7 +1255,9 @@ PurpleParameter PurpleParameter_from_JSON(mixed json) {
12281255
12291256 retval.comment = json["comment"] == Val.null ? Val.null : TentacledComment_from_JSON(json["comment"]);
12301257 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
1258+ if (!intp(json["id"])) error("Expected integer");
12311259 retval.id = json["id"];
1260+ if (!intp(json["kind"])) error("Expected integer");
12321261 retval.kind = json["kind"];
12331262 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
12341263 retval.name = json["name"];
@@ -1358,8 +1387,10 @@ FluffyDeclaration FluffyDeclaration_from_JSON(mixed json) {
13581387 retval.children = json["children"];
13591388 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
13601389 retval.groups = json["groups"];
1390+ if (!intp(json["id"])) error("Expected integer");
13611391 retval.id = json["id"];
13621392 retval.index_signature = json["indexSignature"] == Val.null ? Val.null : IndexSignature_from_JSON(json["indexSignature"]);
1393+ if (!intp(json["kind"])) error("Expected integer");
13631394 retval.kind = json["kind"];
13641395 retval.kind_string = json["kindString"];
13651396 retval.name = json["name"];
@@ -1400,7 +1431,9 @@ StickyChild StickyChild_from_JSON(mixed json) {
14001431
14011432 retval.comment = json["comment"] == Val.null ? Val.null : FluffyComment_from_JSON(json["comment"]);
14021433 retval.flags = FluffyFlags_from_JSON(json["flags"]);
1434+ if (!intp(json["id"])) error("Expected integer");
14031435 retval.id = json["id"];
1436+ if (!intp(json["kind"])) error("Expected integer");
14041437 retval.kind = json["kind"];
14051438 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
14061439 retval.name = json["name"];
@@ -1467,7 +1500,9 @@ IndexSignature IndexSignature_from_JSON(mixed json) {
14671500 IndexSignature retval = IndexSignature();
14681501
14691502 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
1503+ if (!intp(json["id"])) error("Expected integer");
14701504 retval.id = json["id"];
1505+ if (!intp(json["kind"])) error("Expected integer");
14711506 retval.kind = json["kind"];
14721507 retval.kind_string = json["kindString"];
14731508 retval.name = json["name"];
@@ -1531,7 +1566,9 @@ TentacledSignature TentacledSignature_from_JSON(mixed json) {
15311566
15321567 retval.comment = json["comment"] == Val.null ? Val.null : IndigoComment_from_JSON(json["comment"]);
15331568 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
1569+ if (!intp(json["id"])) error("Expected integer");
15341570 retval.id = json["id"];
1571+ if (!intp(json["kind"])) error("Expected integer");
15351572 retval.kind = json["kind"];
15361573 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
15371574 retval.name = json["name"];
@@ -1595,7 +1632,9 @@ FluffyParameter FluffyParameter_from_JSON(mixed json) {
15951632
15961633 retval.comment = json["comment"] == Val.null ? Val.null : FluffyComment_from_JSON(json["comment"]);
15971634 retval.flags = FluffyFlags_from_JSON(json["flags"]);
1635+ if (!intp(json["id"])) error("Expected integer");
15981636 retval.id = json["id"];
1637+ if (!intp(json["kind"])) error("Expected integer");
15991638 retval.kind = json["kind"];
16001639 retval.kind_string = json["kindString"];
16011640 retval.name = json["name"];
@@ -1717,7 +1756,9 @@ StickySignature StickySignature_from_JSON(mixed json) {
17171756
17181757 retval.comment = StickyComment_from_JSON(json["comment"]);
17191758 retval.flags = IndigoFlags_from_JSON(json["flags"]);
1759+ if (!intp(json["id"])) error("Expected integer");
17201760 retval.id = json["id"];
1761+ if (!intp(json["kind"])) error("Expected integer");
17211762 retval.kind = json["kind"];
17221763 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
17231764 retval.name = json["name"];
@@ -1762,7 +1803,9 @@ TentacledParameter TentacledParameter_from_JSON(mixed json) {
17621803 retval.comment = json["comment"] == Val.null ? Val.null : TentacledComment_from_JSON(json["comment"]);
17631804 retval.default_value = json["defaultValue"];
17641805 retval.flags = TentacledFlags_from_JSON(json["flags"]);
1806+ if (!intp(json["id"])) error("Expected integer");
17651807 retval.id = json["id"];
1808+ if (!intp(json["kind"])) error("Expected integer");
17661809 retval.kind = json["kind"];
17671810 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
17681811 retval.name = json["name"];
@@ -1843,8 +1886,10 @@ TentacledDeclaration TentacledDeclaration_from_JSON(mixed json) {
18431886 retval.children = json["children"];
18441887 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
18451888 retval.groups = json["groups"];
1889+ if (!intp(json["id"])) error("Expected integer");
18461890 retval.id = json["id"];
18471891 retval.index_signature = json["indexSignature"] == Val.null ? Val.null : IndexSignatureElement_from_JSON(json["indexSignature"]);
1892+ if (!intp(json["kind"])) error("Expected integer");
18481893 retval.kind = json["kind"];
18491894 retval.kind_string = json["kindString"];
18501895 retval.name = json["name"];
@@ -1888,7 +1933,9 @@ IndigoChild IndigoChild_from_JSON(mixed json) {
18881933 retval.comment = FluffyComment_from_JSON(json["comment"]);
18891934 retval.default_value = json["defaultValue"];
18901935 retval.flags = FluffyFlags_from_JSON(json["flags"]);
1936+ if (!intp(json["id"])) error("Expected integer");
18911937 retval.id = json["id"];
1938+ if (!intp(json["kind"])) error("Expected integer");
18921939 retval.kind = json["kind"];
18931940 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
18941941 retval.name = json["name"];
@@ -2008,7 +2055,9 @@ StickyDeclaration StickyDeclaration_from_JSON(mixed json) {
20082055 retval.children = json["children"];
20092056 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
20102057 retval.groups = json["groups"];
2058+ if (!intp(json["id"])) error("Expected integer");
20112059 retval.id = json["id"];
2060+ if (!intp(json["kind"])) error("Expected integer");
20122061 retval.kind = json["kind"];
20132062 retval.kind_string = json["kindString"];
20142063 retval.name = json["name"];
@@ -2046,7 +2095,9 @@ IndecentChild IndecentChild_from_JSON(mixed json) {
20462095 IndecentChild retval = IndecentChild();
20472096
20482097 retval.flags = FluffyFlags_from_JSON(json["flags"]);
2098+ if (!intp(json["id"])) error("Expected integer");
20492099 retval.id = json["id"];
2100+ if (!intp(json["kind"])) error("Expected integer");
20502101 retval.kind = json["kind"];
20512102 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
20522103 retval.name = json["name"];
@@ -2116,7 +2167,9 @@ IndigoDeclaration IndigoDeclaration_from_JSON(mixed json) {
21162167 retval.children = json["children"];
21172168 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
21182169 retval.groups = json["groups"];
2170+ if (!intp(json["id"])) error("Expected integer");
21192171 retval.id = json["id"];
2172+ if (!intp(json["kind"])) error("Expected integer");
21202173 retval.kind = json["kind"];
21212174 retval.kind_string = json["kindString"];
21222175 retval.name = json["name"];
@@ -2178,7 +2231,9 @@ TypeParameter TypeParameter_from_JSON(mixed json) {
21782231
21792232 retval.comment = json["comment"] == Val.null ? Val.null : PurpleComment_from_JSON(json["comment"]);
21802233 retval.flags = GetSignatureFlags_from_JSON(json["flags"]);
2234+ if (!intp(json["id"])) error("Expected integer");
21812235 retval.id = json["id"];
2236+ if (!intp(json["kind"])) error("Expected integer");
21822237 retval.kind = json["kind"];
21832238 retval.kind_string = json["kindString"];
21842239 retval.name = json["name"];
Test case

test/inputs/json/priority/bug790.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -42,13 +42,18 @@ TopLevel TopLevel_from_JSON(mixed json) {
4242 TopLevel retval = TopLevel();
4343
4444 retval.children_data = json["children_data"];
45+ if (!intp(json["id"])) error("Expected integer");
4546 retval.id = json["id"];
4647 if (json["is_active"] != Standards.JSON.true && json["is_active"] != Standards.JSON.false) error("Expected bool");
4748 retval.is_active = json["is_active"];
49+ if (!intp(json["level"])) error("Expected integer");
4850 retval.level = json["level"];
4951 retval.name = json["name"];
52+ if (!intp(json["parent_id"])) error("Expected integer");
5053 retval.parent_id = json["parent_id"];
54+ if (!intp(json["position"])) error("Expected integer");
5155 retval.position = json["position"];
56+ if (!intp(json["product_count"])) error("Expected integer");
5257 retval.product_count = json["product_count"];
5358
5459 return retval;
Test case

test/inputs/json/priority/bug855-short.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -48,7 +48,9 @@ TopLevelValue TopLevelValue_from_JSON(mixed json) {
4848 retval.channel_id = json["channel_id"];
4949 retval.channel_name = json["channel_name"];
5050 retval.code = json["code"];
51+ if (!intp(json["emoticon_set"])) error("Expected integer");
5152 retval.emoticon_set = json["emoticon_set"];
53+ if (!intp(json["id"])) error("Expected integer");
5254 retval.id = json["id"];
5355
5456 return retval;
Test case

test/inputs/json/priority/bug863.json

1 generated file · +35 −0
Mpikedefault / TopLevel.pmod+35 −0
@@ -71,20 +71,27 @@ class PurpleTopLevel {
7171 PurpleTopLevel PurpleTopLevel_from_JSON(mixed json) {
7272 PurpleTopLevel retval = PurpleTopLevel();
7373
74+ if (!intp(json["ALIENLEVEL"])) error("Expected integer");
7475 retval.alienlevel = json["ALIENLEVEL"];
7576 retval.breed = Breed_from_JSON(json["BREED"]);
77+ if (!intp(json["CHAR_DIMENSION"])) error("Expected integer");
7678 retval.char_dimension = json["CHAR_DIMENSION"];
79+ if (!intp(json["CHAR_INSTANCE"])) error("Expected integer");
7780 retval.char_instance = json["CHAR_INSTANCE"];
7881 retval.defender_rank_title = json["DEFENDER_RANK_TITLE"];
7982 retval.firstname = Firstname_from_JSON(json["FIRSTNAME"]);
83+ if (!intp(json["HEADID"])) error("Expected integer");
8084 retval.headid = json["HEADID"];
8185 retval.lastname = Lastname_from_JSON(json["LASTNAME"]);
86+ if (!intp(json["LEVELX"])) error("Expected integer");
8287 retval.levelx = json["LEVELX"];
8388 retval.name = json["NAME"];
8489 retval.prof = json["PROF"];
8590 retval.prof_title = json["PROF_TITLE"];
91+ if (!intp(json["PVPRATING"])) error("Expected integer");
8692 retval.pvprating = json["PVPRATING"];
8793 retval.pvptitle = Pvptitle_from_JSON(json["PVPTITLE"]);
94+ if (!intp(json["RANK"])) error("Expected integer");
8895 retval.rank = json["RANK"];
8996 retval.rank_title = RankTitle_from_JSON(json["RANK_TITLE"]);
9097 retval.sex = Sex_from_JSON(json["SEX"]);
@@ -233,40 +240,68 @@ class FluffyTopLevel {
233240 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
234241 FluffyTopLevel retval = FluffyTopLevel();
235242
243+ if (!intp(json["ADVENTURERCOUNT"])) error("Expected integer");
236244 retval.adventurercount = json["ADVENTURERCOUNT"];
245+ if (!intp(json["AGENTCOUNT"])) error("Expected integer");
237246 retval.agentcount = json["AGENTCOUNT"];
247+ if (!intp(json["ATROXCOUNT"])) error("Expected integer");
238248 retval.atroxcount = json["ATROXCOUNT"];
239249 retval.avglvl = (float)json["AVGLVL"];
250+ if (!intp(json["BTCOUNT"])) error("Expected integer");
240251 retval.btcount = json["BTCOUNT"];
241252 retval.description = json["DESCRIPTION"];
253+ if (!intp(json["DOCTORCOUNT"])) error("Expected integer");
242254 retval.doctorcount = json["DOCTORCOUNT"];
255+ if (!intp(json["ENFCOUNT"])) error("Expected integer");
243256 retval.enfcount = json["ENFCOUNT"];
257+ if (!intp(json["ENGINEEERCOUNT"])) error("Expected integer");
244258 retval.engineeercount = json["ENGINEEERCOUNT"];
259+ if (!intp(json["FEMALECOUNT"])) error("Expected integer");
245260 retval.femalecount = json["FEMALECOUNT"];
261+ if (!intp(json["FIXERCOUNT"])) error("Expected integer");
246262 retval.fixercount = json["FIXERCOUNT"];
247263 retval.governingname = json["GOVERNINGNAME"];
248264 retval.history = json["HISTORY"];
265+ if (!intp(json["KEEPERCOUNT"])) error("Expected integer");
249266 retval.keepercount = json["KEEPERCOUNT"];
267+ if (!intp(json["MACOUNT"])) error("Expected integer");
250268 retval.macount = json["MACOUNT"];
269+ if (!intp(json["MALECOUNT"])) error("Expected integer");
251270 retval.malecount = json["MALECOUNT"];
271+ if (!intp(json["MAXLVL"])) error("Expected integer");
252272 retval.maxlvl = json["MAXLVL"];
273+ if (!intp(json["METACOUNT"])) error("Expected integer");
253274 retval.metacount = json["METACOUNT"];
275+ if (!intp(json["MINLVL"])) error("Expected integer");
254276 retval.minlvl = json["MINLVL"];
277+ if (!intp(json["MONSTERCOUNT"])) error("Expected integer");
255278 retval.monstercount = json["MONSTERCOUNT"];
256279 retval.name = json["NAME"];
280+ if (!intp(json["NANOCOUNT"])) error("Expected integer");
257281 retval.nanocount = json["NANOCOUNT"];
282+ if (!intp(json["NANORACECOUNT"])) error("Expected integer");
258283 retval.nanoracecount = json["NANORACECOUNT"];
284+ if (!intp(json["NEUTERCOUNT"])) error("Expected integer");
259285 retval.neutercount = json["NEUTERCOUNT"];
286+ if (!intp(json["NUMMEMBERS"])) error("Expected integer");
260287 retval.nummembers = json["NUMMEMBERS"];
261288 retval.objective = json["OBJECTIVE"];
289+ if (!intp(json["OPIFEXCOUNT"])) error("Expected integer");
262290 retval.opifexcount = json["OPIFEXCOUNT"];
291+ if (!intp(json["ORG_DIMENSION"])) error("Expected integer");
263292 retval.org_dimension = json["ORG_DIMENSION"];
293+ if (!intp(json["ORG_INSTANCE"])) error("Expected integer");
264294 retval.org_instance = json["ORG_INSTANCE"];
295+ if (!intp(json["SHADECOUNT"])) error("Expected integer");
265296 retval.shadecount = json["SHADECOUNT"];
297+ if (!intp(json["SIDE"])) error("Expected integer");
266298 retval.side = json["SIDE"];
267299 retval.side_name = json["SIDE_NAME"];
300+ if (!intp(json["SOLIDERCOUNT"])) error("Expected integer");
268301 retval.solidercount = json["SOLIDERCOUNT"];
302+ if (!intp(json["SOLITUSCOUNT"])) error("Expected integer");
269303 retval.solituscount = json["SOLITUSCOUNT"];
304+ if (!intp(json["TRADERCOUNT"])) error("Expected integer");
270305 retval.tradercount = json["TRADERCOUNT"];
271306
272307 return retval;
Test case

test/inputs/json/priority/coin-pairs.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -30,6 +30,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3030 TopLevel retval = TopLevel();
3131
3232 retval.pairs = json["pairs"];
33+ if (!intp(json["server_time"])) error("Expected integer");
3334 retval.server_time = json["server_time"];
3435
3536 return retval;
@@ -64,10 +65,14 @@ class Pair {
6465 Pair Pair_from_JSON(mixed json) {
6566 Pair retval = Pair();
6667
68+ if (!intp(json["decimal_places"])) error("Expected integer");
6769 retval.decimal_places = json["decimal_places"];
6870 retval.fee = (float)json["fee"];
71+ if (!intp(json["hidden"])) error("Expected integer");
6972 retval.hidden = json["hidden"];
73+ if (!intp(json["max_amount"])) error("Expected integer");
7074 retval.max_amount = json["max_amount"];
75+ if (!intp(json["max_price"])) error("Expected integer");
7176 retval.max_price = json["max_price"];
7277 retval.min_amount = (float)json["min_amount"];
7378 retval.min_price = (float)json["min_price"];
Test case

test/inputs/json/priority/combinations1.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -115,6 +115,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
115115 retval.cerograph = json["cerograph"];
116116 retval.chemotherapeutics = json["chemotherapeutics"];
117117 retval.cimelia = json["cimelia"];
118+ if (!intp(json["citrated"])) error("Expected integer");
118119 retval.citrated = json["citrated"];
119120 retval.clinodome = json["clinodome"];
120121 retval.coadjust = json["coadjust"];
@@ -369,6 +370,7 @@ CimeliaClass CimeliaClass_from_JSON(mixed json) {
369370 CimeliaClass retval = CimeliaClass();
370371
371372 retval.catharticalness = (float)json["catharticalness"];
373+ if (!intp(json["Chirotherium"])) error("Expected integer");
372374 retval.chirotherium = json["Chirotherium"];
373375 retval.disdiapason = json["disdiapason"];
374376 if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool");
@@ -1302,6 +1304,7 @@ Interacinar Interacinar_from_JSON(mixed json) {
13021304 if (json["benefactorship"] != Standards.JSON.true && json["benefactorship"] != Standards.JSON.false) error("Expected bool");
13031305 retval.benefactorship = json["benefactorship"];
13041306 retval.triseriatim = json["triseriatim"];
1307+ if (!intp(json["tubbing"])) error("Expected integer");
13051308 retval.tubbing = json["tubbing"];
13061309 retval.untrimmed = json["untrimmed"];
Test case

test/inputs/json/priority/combinations2.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -309,6 +309,7 @@ Rebecca Rebecca_from_JSON(mixed json) {
309309 Rebecca retval = Rebecca();
310310
311311 retval.catharticalness = (float)json["catharticalness"];
312+ if (!intp(json["Chirotherium"])) error("Expected integer");
312313 retval.chirotherium = json["Chirotherium"];
313314 retval.disdiapason = json["disdiapason"];
314315 if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool");
Test case

test/inputs/json/priority/combinations3.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -696,6 +696,7 @@ MonaziteClass MonaziteClass_from_JSON(mixed json) {
696696 MonaziteClass retval = MonaziteClass();
697697
698698 retval.catharticalness = (float)json["catharticalness"];
699+ if (!intp(json["Chirotherium"])) error("Expected integer");
699700 retval.chirotherium = json["Chirotherium"];
700701 retval.disdiapason = json["disdiapason"];
701702 if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool");
@@ -864,6 +865,7 @@ Noncontributing Noncontributing_from_JSON(mixed json) {
864865
865866 retval.estevin = json["estevin"];
866867 retval.jolterhead = (float)json["jolterhead"];
868+ if (!intp(json["sauternes"])) error("Expected integer");
867869 retval.sauternes = json["sauternes"];
868870 if (json["sparsely"] != Standards.JSON.true && json["sparsely"] != Standards.JSON.false) error("Expected bool");
869871 retval.sparsely = json["sparsely"];
Test case

test/inputs/json/priority/combinations4.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -387,6 +387,7 @@ QuebrachineClass QuebrachineClass_from_JSON(mixed json) {
387387 QuebrachineClass retval = QuebrachineClass();
388388
389389 retval.catharticalness = (float)json["catharticalness"];
390+ if (!intp(json["Chirotherium"])) error("Expected integer");
390391 retval.chirotherium = json["Chirotherium"];
391392 retval.disdiapason = json["disdiapason"];
392393 if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool");
Test case

test/inputs/json/priority/direct-recursive.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -38,6 +38,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3838 retval.also = json["also"] == Val.null ? Val.null : TopLevel_from_JSON(json["also"]);
3939 if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool");
4040 retval.bar = json["bar"];
41+ if (!intp(json["foo"])) error("Expected integer");
4142 retval.foo = json["foo"];
4243 retval.moo = (float)json["moo"];
4344 retval.quux = json["quux"];
Test case

test/inputs/json/priority/identifiers.json

1 generated file · +8 −0
Mpikedefault / TopLevel.pmod+8 −0
@@ -41,6 +41,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
4141 retval.empty = Empty_from_JSON(json[""]);
4242 retval.foo = Foo_from_JSON(json["foo"]);
4343 retval.this_is_a_tough_one = ThisIsAToughOne_from_JSON(json["ThisIsA\U0001f61cTough\"\n\nOne"]);
44+ if (!intp(json["!"])) error("Expected integer");
4445 retval.top_level = json["!"];
4546 retval.top_level_empty = EmptyClass_from_JSON(json["Empty"]);
4647
@@ -62,6 +63,7 @@ class TopLevelBla {
6263 TopLevelBla TopLevelBla_from_JSON(mixed json) {
6364 TopLevelBla retval = TopLevelBla();
6465
66+ if (!intp(json["bar"])) error("Expected integer");
6567 retval.bar = json["bar"];
6668
6769 return retval;
@@ -82,6 +84,7 @@ class Empty {
8284 Empty Empty_from_JSON(mixed json) {
8385 Empty retval = Empty();
8486
87+ if (!intp(json["x"])) error("Expected integer");
8588 retval.x = json["x"];
8689
8790 return retval;
@@ -107,7 +110,9 @@ Foo Foo_from_JSON(mixed json) {
107110 Foo retval = Foo();
108111
109112 retval.bla = FooBla_from_JSON(json["bla"]);
113+ if (!intp(json["_"])) error("Expected integer");
110114 retval.empty = json["_"];
115+ if (!intp(json["__"])) error("Expected integer");
111116 retval.foo = json["__"];
112117
113118 return retval;
@@ -146,7 +151,9 @@ class ThisIsAToughOne {
146151 ThisIsAToughOne ThisIsAToughOne_from_JSON(mixed json) {
147152 ThisIsAToughOne retval = ThisIsAToughOne();
148153
154+ if (!intp(json["\n\n\n"])) error("Expected integer");
149155 retval.empty = json["\n\n\n"];
156+ if (!intp(json["\""])) error("Expected integer");
150157 retval.this_is_a_tough_one = json["\""];
151158
152159 return retval;
@@ -167,6 +174,7 @@ class EmptyClass {
167174 EmptyClass EmptyClass_from_JSON(mixed json) {
168175 EmptyClass retval = EmptyClass();
169176
177+ if (!intp(json["y"])) error("Expected integer");
170178 retval.y = json["y"];
171179
172180 return retval;
Test case

test/inputs/json/priority/keywords.json

1 generated file · +285 −0
Mpikedefault / TopLevel.pmod+285 −0
@@ -37,6 +37,7 @@ class TopLevel {
3737 TopLevel TopLevel_from_JSON(mixed json) {
3838 TopLevel retval = TopLevel();
3939
40+ if (!intp(json["dummy"])) error("Expected integer");
4041 retval.dummy = json["dummy"];
4142 retval.obj1 = Obj1_from_JSON(json["obj1"]);
4243 retval.obj2 = Obj2_from_JSON(json["obj2"]);
@@ -243,6 +244,7 @@ Obj1 Obj1_from_JSON(mixed json) {
243244 retval.declare = Declare_from_JSON(json["declare"]);
244245 retval.decltype = Decltype_from_JSON(json["decltype"]);
245246 retval.decode_string = DecodeString_from_JSON(json["decode_string"]);
247+ if (!intp(json["dummy"])) error("Expected integer");
246248 retval.dummy = json["dummy"];
247249 retval.empty = Empty_from_JSON(json["_"]);
248250 retval.imaginery = Imaginery_from_JSON(json["_Imaginery"]);
@@ -277,6 +279,7 @@ class Abstract {
277279 Abstract Abstract_from_JSON(mixed json) {
278280 Abstract retval = Abstract();
279281
282+ if (!intp(json["abstract"])) error("Expected integer");
280283 retval.abstract = json["abstract"];
281284
282285 return retval;
@@ -297,6 +300,7 @@ class Alignas {
297300 Alignas Alignas_from_JSON(mixed json) {
298301 Alignas retval = Alignas();
299302
303+ if (!intp(json["alignas"])) error("Expected integer");
300304 retval.alignas = json["alignas"];
301305
302306 return retval;
@@ -317,6 +321,7 @@ class Alignof {
317321 Alignof Alignof_from_JSON(mixed json) {
318322 Alignof retval = Alignof();
319323
324+ if (!intp(json["alignof"])) error("Expected integer");
320325 retval.alignof = json["alignof"];
321326
322327 return retval;
@@ -337,6 +342,7 @@ class And {
337342 And And_from_JSON(mixed json) {
338343 And retval = And();
339344
345+ if (!intp(json["and"])) error("Expected integer");
340346 retval.and = json["and"];
341347
342348 return retval;
@@ -357,6 +363,7 @@ class AndEq {
357363 AndEq AndEq_from_JSON(mixed json) {
358364 AndEq retval = AndEq();
359365
366+ if (!intp(json["and_eq"])) error("Expected integer");
360367 retval.and_eq = json["and_eq"];
361368
362369 return retval;
@@ -377,6 +384,7 @@ class Any {
377384 Any Any_from_JSON(mixed json) {
378385 Any retval = Any();
379386
387+ if (!intp(json["Any"])) error("Expected integer");
380388 retval.any = json["Any"];
381389
382390 return retval;
@@ -397,6 +405,7 @@ class As {
397405 As As_from_JSON(mixed json) {
398406 As retval = As();
399407
408+ if (!intp(json["as"])) error("Expected integer");
400409 retval.as = json["as"];
401410
402411 return retval;
@@ -417,6 +426,7 @@ class Asm {
417426 Asm Asm_from_JSON(mixed json) {
418427 Asm retval = Asm();
419428
429+ if (!intp(json["asm"])) error("Expected integer");
420430 retval.asm = json["asm"];
421431
422432 return retval;
@@ -437,6 +447,7 @@ class Assert {
437447 Assert Assert_from_JSON(mixed json) {
438448 Assert retval = Assert();
439449
450+ if (!intp(json["assert"])) error("Expected integer");
440451 retval.assert = json["assert"];
441452
442453 return retval;
@@ -457,6 +468,7 @@ class Associatedtype {
457468 Associatedtype Associatedtype_from_JSON(mixed json) {
458469 Associatedtype retval = Associatedtype();
459470
471+ if (!intp(json["associatedtype"])) error("Expected integer");
460472 retval.associatedtype = json["associatedtype"];
461473
462474 return retval;
@@ -477,6 +489,7 @@ class Associativity {
477489 Associativity Associativity_from_JSON(mixed json) {
478490 Associativity retval = Associativity();
479491
492+ if (!intp(json["associativity"])) error("Expected integer");
480493 retval.associativity = json["associativity"];
481494
482495 return retval;
@@ -497,6 +510,7 @@ class Async {
497510 Async Async_from_JSON(mixed json) {
498511 Async retval = Async();
499512
513+ if (!intp(json["async"])) error("Expected integer");
500514 retval.async = json["async"];
501515
502516 return retval;
@@ -517,6 +531,7 @@ class Atomic {
517531 Atomic Atomic_from_JSON(mixed json) {
518532 Atomic retval = Atomic();
519533
534+ if (!intp(json["atomic"])) error("Expected integer");
520535 retval.atomic = json["atomic"];
521536
522537 return retval;
@@ -537,6 +552,7 @@ class AtomicCancel {
537552 AtomicCancel AtomicCancel_from_JSON(mixed json) {
538553 AtomicCancel retval = AtomicCancel();
539554
555+ if (!intp(json["atomic_cancel"])) error("Expected integer");
540556 retval.atomic_cancel = json["atomic_cancel"];
541557
542558 return retval;
@@ -557,6 +573,7 @@ class AtomicCommit {
557573 AtomicCommit AtomicCommit_from_JSON(mixed json) {
558574 AtomicCommit retval = AtomicCommit();
559575
576+ if (!intp(json["atomic_commit"])) error("Expected integer");
560577 retval.atomic_commit = json["atomic_commit"];
561578
562579 return retval;
@@ -577,6 +594,7 @@ class AtomicNoexcept {
577594 AtomicNoexcept AtomicNoexcept_from_JSON(mixed json) {
578595 AtomicNoexcept retval = AtomicNoexcept();
579596
597+ if (!intp(json["atomic_noexcept"])) error("Expected integer");
580598 retval.atomic_noexcept = json["atomic_noexcept"];
581599
582600 return retval;
@@ -597,6 +615,7 @@ class Await {
597615 Await Await_from_JSON(mixed json) {
598616 Await retval = Await();
599617
618+ if (!intp(json["await"])) error("Expected integer");
600619 retval.await = json["await"];
601620
602621 return retval;
@@ -617,6 +636,7 @@ class Base {
617636 Base Base_from_JSON(mixed json) {
618637 Base retval = Base();
619638
639+ if (!intp(json["base"])) error("Expected integer");
620640 retval.base = json["base"];
621641
622642 return retval;
@@ -637,6 +657,7 @@ class Bitand {
637657 Bitand Bitand_from_JSON(mixed json) {
638658 Bitand retval = Bitand();
639659
660+ if (!intp(json["bitand"])) error("Expected integer");
640661 retval.bitand = json["bitand"];
641662
642663 return retval;
@@ -657,6 +678,7 @@ class Bitor {
657678 Bitor Bitor_from_JSON(mixed json) {
658679 Bitor retval = Bitor();
659680
681+ if (!intp(json["bitor"])) error("Expected integer");
660682 retval.bitor = json["bitor"];
661683
662684 return retval;
@@ -677,6 +699,7 @@ class Bool {
677699 Bool Bool_from_JSON(mixed json) {
678700 Bool retval = Bool();
679701
702+ if (!intp(json["BOOL"])) error("Expected integer");
680703 retval.bool = json["BOOL"];
681704
682705 return retval;
@@ -697,6 +720,7 @@ class Boolean {
697720 Boolean Boolean_from_JSON(mixed json) {
698721 Boolean retval = Boolean();
699722
723+ if (!intp(json["boolean"])) error("Expected integer");
700724 retval.boolean = json["boolean"];
701725
702726 return retval;
@@ -717,6 +741,7 @@ class Bycopy {
717741 Bycopy Bycopy_from_JSON(mixed json) {
718742 Bycopy retval = Bycopy();
719743
744+ if (!intp(json["bycopy"])) error("Expected integer");
720745 retval.bycopy = json["bycopy"];
721746
722747 return retval;
@@ -737,6 +762,7 @@ class Byref {
737762 Byref Byref_from_JSON(mixed json) {
738763 Byref retval = Byref();
739764
765+ if (!intp(json["byref"])) error("Expected integer");
740766 retval.byref = json["byref"];
741767
742768 return retval;
@@ -757,6 +783,7 @@ class Byte {
757783 Byte Byte_from_JSON(mixed json) {
758784 Byte retval = Byte();
759785
786+ if (!intp(json["byte"])) error("Expected integer");
760787 retval.byte = json["byte"];
761788
762789 return retval;
@@ -777,6 +804,7 @@ class Chan {
777804 Chan Chan_from_JSON(mixed json) {
778805 Chan retval = Chan();
779806
807+ if (!intp(json["chan"])) error("Expected integer");
780808 retval.chan = json["chan"];
781809
782810 return retval;
@@ -797,6 +825,7 @@ class Char {
797825 Char Char_from_JSON(mixed json) {
798826 Char retval = Char();
799827
828+ if (!intp(json["char"])) error("Expected integer");
800829 retval.char = json["char"];
801830
802831 return retval;
@@ -817,6 +846,7 @@ class Char16T {
817846 Char16T Char16T_from_JSON(mixed json) {
818847 Char16T retval = Char16T();
819848
849+ if (!intp(json["char16_t"])) error("Expected integer");
820850 retval.char16_t = json["char16_t"];
821851
822852 return retval;
@@ -837,6 +867,7 @@ class Char32T {
837867 Char32T Char32T_from_JSON(mixed json) {
838868 Char32T retval = Char32T();
839869
870+ if (!intp(json["char32_t"])) error("Expected integer");
840871 retval.char32_t = json["char32_t"];
841872
842873 return retval;
@@ -857,6 +888,7 @@ class Checked {
857888 Checked Checked_from_JSON(mixed json) {
858889 Checked retval = Checked();
859890
891+ if (!intp(json["checked"])) error("Expected integer");
860892 retval.checked = json["checked"];
861893
862894 return retval;
@@ -877,6 +909,7 @@ class Clone {
877909 Clone Clone_from_JSON(mixed json) {
878910 Clone retval = Clone();
879911
912+ if (!intp(json["clone"])) error("Expected integer");
880913 retval.clone = json["clone"];
881914
882915 return retval;
@@ -897,6 +930,7 @@ class CoAwait {
897930 CoAwait CoAwait_from_JSON(mixed json) {
898931 CoAwait retval = CoAwait();
899932
933+ if (!intp(json["co_await"])) error("Expected integer");
900934 retval.co_await = json["co_await"];
901935
902936 return retval;
@@ -917,6 +951,7 @@ class CoReturn {
917951 CoReturn CoReturn_from_JSON(mixed json) {
918952 CoReturn retval = CoReturn();
919953
954+ if (!intp(json["co_return"])) error("Expected integer");
920955 retval.co_return = json["co_return"];
921956
922957 return retval;
@@ -937,6 +972,7 @@ class CoYield {
937972 CoYield CoYield_from_JSON(mixed json) {
938973 CoYield retval = CoYield();
939974
975+ if (!intp(json["co_yield"])) error("Expected integer");
940976 retval.co_yield = json["co_yield"];
941977
942978 return retval;
@@ -957,6 +993,7 @@ class Compl {
957993 Compl Compl_from_JSON(mixed json) {
958994 Compl retval = Compl();
959995
996+ if (!intp(json["compl"])) error("Expected integer");
960997 retval.compl = json["compl"];
961998
962999 return retval;
@@ -977,6 +1014,7 @@ class Complex {
9771014 Complex Complex_from_JSON(mixed json) {
9781015 Complex retval = Complex();
9791016
1017+ if (!intp(json["_Complex"])) error("Expected integer");
9801018 retval.complex = json["_Complex"];
9811019
9821020 return retval;
@@ -997,6 +1035,7 @@ class Concept {
9971035 Concept Concept_from_JSON(mixed json) {
9981036 Concept retval = Concept();
9991037
1038+ if (!intp(json["concept"])) error("Expected integer");
10001039 retval.concept = json["concept"];
10011040
10021041 return retval;
@@ -1017,6 +1056,7 @@ class Console {
10171056 Console Console_from_JSON(mixed json) {
10181057 Console retval = Console();
10191058
1059+ if (!intp(json["console"])) error("Expected integer");
10201060 retval.console = json["console"];
10211061
10221062 return retval;
@@ -1037,6 +1077,7 @@ class ConstCast {
10371077 ConstCast ConstCast_from_JSON(mixed json) {
10381078 ConstCast retval = ConstCast();
10391079
1080+ if (!intp(json["const_cast"])) error("Expected integer");
10401081 retval.const_cast = json["const_cast"];
10411082
10421083 return retval;
@@ -1057,6 +1098,7 @@ class Constexpr {
10571098 Constexpr Constexpr_from_JSON(mixed json) {
10581099 Constexpr retval = Constexpr();
10591100
1101+ if (!intp(json["constexpr"])) error("Expected integer");
10601102 retval.constexpr = json["constexpr"];
10611103
10621104 return retval;
@@ -1077,6 +1119,7 @@ class Constructor {
10771119 Constructor Constructor_from_JSON(mixed json) {
10781120 Constructor retval = Constructor();
10791121
1122+ if (!intp(json["constructor"])) error("Expected integer");
10801123 retval.constructor = json["constructor"];
10811124
10821125 return retval;
@@ -1097,6 +1140,7 @@ class Convenience {
10971140 Convenience Convenience_from_JSON(mixed json) {
10981141 Convenience retval = Convenience();
10991142
1143+ if (!intp(json["convenience"])) error("Expected integer");
11001144 retval.convenience = json["convenience"];
11011145
11021146 return retval;
@@ -1117,6 +1161,7 @@ class Convert {
11171161 Convert Convert_from_JSON(mixed json) {
11181162 Convert retval = Convert();
11191163
1164+ if (!intp(json["convert"])) error("Expected integer");
11201165 retval.convert = json["convert"];
11211166
11221167 return retval;
@@ -1137,6 +1182,7 @@ class Converter {
11371182 Converter Converter_from_JSON(mixed json) {
11381183 Converter retval = Converter();
11391184
1185+ if (!intp(json["converter"])) error("Expected integer");
11401186 retval.converter = json["converter"];
11411187
11421188 return retval;
@@ -1157,6 +1203,7 @@ class Date {
11571203 Date Date_from_JSON(mixed json) {
11581204 Date retval = Date();
11591205
1206+ if (!intp(json["date"])) error("Expected integer");
11601207 retval.date = json["date"];
11611208
11621209 return retval;
@@ -1177,6 +1224,7 @@ class DateParseHandling {
11771224 DateParseHandling DateParseHandling_from_JSON(mixed json) {
11781225 DateParseHandling retval = DateParseHandling();
11791226
1227+ if (!intp(json["date_parse_handling"])) error("Expected integer");
11801228 retval.date_parse_handling = json["date_parse_handling"];
11811229
11821230 return retval;
@@ -1197,6 +1245,7 @@ class Debugger {
11971245 Debugger Debugger_from_JSON(mixed json) {
11981246 Debugger retval = Debugger();
11991247
1248+ if (!intp(json["debugger"])) error("Expected integer");
12001249 retval.debugger = json["debugger"];
12011250
12021251 return retval;
@@ -1217,6 +1266,7 @@ class Decimal {
12171266 Decimal Decimal_from_JSON(mixed json) {
12181267 Decimal retval = Decimal();
12191268
1269+ if (!intp(json["decimal"])) error("Expected integer");
12201270 retval.decimal = json["decimal"];
12211271
12221272 return retval;
@@ -1237,6 +1287,7 @@ class Declare {
12371287 Declare Declare_from_JSON(mixed json) {
12381288 Declare retval = Declare();
12391289
1290+ if (!intp(json["declare"])) error("Expected integer");
12401291 retval.declare = json["declare"];
12411292
12421293 return retval;
@@ -1257,6 +1308,7 @@ class Decltype {
12571308 Decltype Decltype_from_JSON(mixed json) {
12581309 Decltype retval = Decltype();
12591310
1311+ if (!intp(json["decltype"])) error("Expected integer");
12601312 retval.decltype = json["decltype"];
12611313
12621314 return retval;
@@ -1277,6 +1329,7 @@ class DecodeString {
12771329 DecodeString DecodeString_from_JSON(mixed json) {
12781330 DecodeString retval = DecodeString();
12791331
1332+ if (!intp(json["decode_string"])) error("Expected integer");
12801333 retval.decode_string = json["decode_string"];
12811334
12821335 return retval;
@@ -1297,6 +1350,7 @@ class Empty {
12971350 Empty Empty_from_JSON(mixed json) {
12981351 Empty retval = Empty();
12991352
1353+ if (!intp(json["_"])) error("Expected integer");
13001354 retval.empty = json["_"];
13011355
13021356 return retval;
@@ -1317,6 +1371,7 @@ class Imaginery {
13171371 Imaginery Imaginery_from_JSON(mixed json) {
13181372 Imaginery retval = Imaginery();
13191373
1374+ if (!intp(json["_Imaginery"])) error("Expected integer");
13201375 retval.imaginery = json["_Imaginery"];
13211376
13221377 return retval;
@@ -1337,6 +1392,7 @@ class AnyClass {
13371392 AnyClass AnyClass_from_JSON(mixed json) {
13381393 AnyClass retval = AnyClass();
13391394
1395+ if (!intp(json["any"])) error("Expected integer");
13401396 retval.any = json["any"];
13411397
13421398 return retval;
@@ -1357,6 +1413,7 @@ class Array {
13571413 Array Array_from_JSON(mixed json) {
13581414 Array retval = Array();
13591415
1416+ if (!intp(json["array"])) error("Expected integer");
13601417 retval.array_array = json["array"];
13611418
13621419 return retval;
@@ -1377,6 +1434,7 @@ class Auto {
13771434 Auto Auto_from_JSON(mixed json) {
13781435 Auto retval = Auto();
13791436
1437+ if (!intp(json["auto"])) error("Expected integer");
13801438 retval.auto_auto = json["auto"];
13811439
13821440 return retval;
@@ -1397,6 +1455,7 @@ class BoolClass {
13971455 BoolClass BoolClass_from_JSON(mixed json) {
13981456 BoolClass retval = BoolClass();
13991457
1458+ if (!intp(json["_Bool"])) error("Expected integer");
14001459 retval.bool = json["_Bool"];
14011460
14021461 return retval;
@@ -1417,6 +1476,7 @@ class Break {
14171476 Break Break_from_JSON(mixed json) {
14181477 Break retval = Break();
14191478
1479+ if (!intp(json["break"])) error("Expected integer");
14201480 retval.break_break = json["break"];
14211481
14221482 return retval;
@@ -1437,6 +1497,7 @@ class Case {
14371497 Case Case_from_JSON(mixed json) {
14381498 Case retval = Case();
14391499
1500+ if (!intp(json["case"])) error("Expected integer");
14401501 retval.case_case = json["case"];
14411502
14421503 return retval;
@@ -1457,6 +1518,7 @@ class Catch {
14571518 Catch Catch_from_JSON(mixed json) {
14581519 Catch retval = Catch();
14591520
1521+ if (!intp(json["catch"])) error("Expected integer");
14601522 retval.catch_catch = json["catch"];
14611523
14621524 return retval;
@@ -1477,6 +1539,7 @@ class Class {
14771539 Class Class_from_JSON(mixed json) {
14781540 Class retval = Class();
14791541
1542+ if (!intp(json["Class"])) error("Expected integer");
14801543 retval.class_class = json["Class"];
14811544
14821545 return retval;
@@ -1497,6 +1560,7 @@ class Const {
14971560 Const Const_from_JSON(mixed json) {
14981561 Const retval = Const();
14991562
1563+ if (!intp(json["const"])) error("Expected integer");
15001564 retval.const_const = json["const"];
15011565
15021566 return retval;
@@ -1517,6 +1581,7 @@ class Continue {
15171581 Continue Continue_from_JSON(mixed json) {
15181582 Continue retval = Continue();
15191583
1584+ if (!intp(json["continue"])) error("Expected integer");
15201585 retval.continue_continue = json["continue"];
15211586
15221587 return retval;
@@ -1537,6 +1602,7 @@ class Obj1Bool {
15371602 Obj1Bool Obj1Bool_from_JSON(mixed json) {
15381603 Obj1Bool retval = Obj1Bool();
15391604
1605+ if (!intp(json["bool"])) error("Expected integer");
15401606 retval.bool = json["bool"];
15411607
15421608 return retval;
@@ -1557,6 +1623,7 @@ class ClassClass {
15571623 ClassClass ClassClass_from_JSON(mixed json) {
15581624 ClassClass retval = ClassClass();
15591625
1626+ if (!intp(json["class"])) error("Expected integer");
15601627 retval.class_class = json["class"];
15611628
15621629 return retval;
@@ -1717,6 +1784,7 @@ Obj2 Obj2_from_JSON(mixed json) {
17171784 retval.dictionary = Dictionary_from_JSON(json["dictionary"]);
17181785 retval.did_set = DidSet_from_JSON(json["didSet"]);
17191786 retval.double = Double_from_JSON(json["double"]);
1787+ if (!intp(json["dummy"])) error("Expected integer");
17201788 retval.dummy = json["dummy"];
17211789 retval.dynamic = Dynamic_from_JSON(json["dynamic"]);
17221790 retval.dynamic_cast = DynamicCast_from_JSON(json["dynamic_cast"]);
@@ -1792,6 +1860,7 @@ class Def {
17921860 Def Def_from_JSON(mixed json) {
17931861 Def retval = Def();
17941862
1863+ if (!intp(json["def"])) error("Expected integer");
17951864 retval.def = json["def"];
17961865
17971866 return retval;
@@ -1812,6 +1881,7 @@ class Defer {
18121881 Defer Defer_from_JSON(mixed json) {
18131882 Defer retval = Defer();
18141883
1884+ if (!intp(json["defer"])) error("Expected integer");
18151885 retval.defer = json["defer"];
18161886
18171887 return retval;
@@ -1832,6 +1902,7 @@ class Deinit {
18321902 Deinit Deinit_from_JSON(mixed json) {
18331903 Deinit retval = Deinit();
18341904
1905+ if (!intp(json["deinit"])) error("Expected integer");
18351906 retval.deinit = json["deinit"];
18361907
18371908 return retval;
@@ -1852,6 +1923,7 @@ class Del {
18521923 Del Del_from_JSON(mixed json) {
18531924 Del retval = Del();
18541925
1926+ if (!intp(json["del"])) error("Expected integer");
18551927 retval.del = json["del"];
18561928
18571929 return retval;
@@ -1872,6 +1944,7 @@ class Delegate {
18721944 Delegate Delegate_from_JSON(mixed json) {
18731945 Delegate retval = Delegate();
18741946
1947+ if (!intp(json["delegate"])) error("Expected integer");
18751948 retval.delegate = json["delegate"];
18761949
18771950 return retval;
@@ -1892,6 +1965,7 @@ class Delete {
18921965 Delete Delete_from_JSON(mixed json) {
18931966 Delete retval = Delete();
18941967
1968+ if (!intp(json["delete"])) error("Expected integer");
18951969 retval.delete = json["delete"];
18961970
18971971 return retval;
@@ -1912,6 +1986,7 @@ class Dict {
19121986 Dict Dict_from_JSON(mixed json) {
19131987 Dict retval = Dict();
19141988
1989+ if (!intp(json["dict"])) error("Expected integer");
19151990 retval.dict = json["dict"];
19161991
19171992 return retval;
@@ -1932,6 +2007,7 @@ class Dictionary {
19322007 Dictionary Dictionary_from_JSON(mixed json) {
19332008 Dictionary retval = Dictionary();
19342009
2010+ if (!intp(json["dictionary"])) error("Expected integer");
19352011 retval.dictionary = json["dictionary"];
19362012
19372013 return retval;
@@ -1952,6 +2028,7 @@ class DidSet {
19522028 DidSet DidSet_from_JSON(mixed json) {
19532029 DidSet retval = DidSet();
19542030
2031+ if (!intp(json["didSet"])) error("Expected integer");
19552032 retval.did_set = json["didSet"];
19562033
19572034 return retval;
@@ -1972,6 +2049,7 @@ class Double {
19722049 Double Double_from_JSON(mixed json) {
19732050 Double retval = Double();
19742051
2052+ if (!intp(json["double"])) error("Expected integer");
19752053 retval.double = json["double"];
19762054
19772055 return retval;
@@ -1992,6 +2070,7 @@ class Dynamic {
19922070 Dynamic Dynamic_from_JSON(mixed json) {
19932071 Dynamic retval = Dynamic();
19942072
2073+ if (!intp(json["dynamic"])) error("Expected integer");
19952074 retval.dynamic = json["dynamic"];
19962075
19972076 return retval;
@@ -2012,6 +2091,7 @@ class DynamicCast {
20122091 DynamicCast DynamicCast_from_JSON(mixed json) {
20132092 DynamicCast retval = DynamicCast();
20142093
2094+ if (!intp(json["dynamic_cast"])) error("Expected integer");
20152095 retval.dynamic_cast = json["dynamic_cast"];
20162096
20172097 return retval;
@@ -2032,6 +2112,7 @@ class Elif {
20322112 Elif Elif_from_JSON(mixed json) {
20332113 Elif retval = Elif();
20342114
2115+ if (!intp(json["elif"])) error("Expected integer");
20352116 retval.elif = json["elif"];
20362117
20372118 return retval;
@@ -2052,6 +2133,7 @@ class EncodeQuickType {
20522133 EncodeQuickType EncodeQuickType_from_JSON(mixed json) {
20532134 EncodeQuickType retval = EncodeQuickType();
20542135
2136+ if (!intp(json["encode_quick_type"])) error("Expected integer");
20552137 retval.encode_quick_type = json["encode_quick_type"];
20562138
20572139 return retval;
@@ -2072,6 +2154,7 @@ class EqualityContract {
20722154 EqualityContract EqualityContract_from_JSON(mixed json) {
20732155 EqualityContract retval = EqualityContract();
20742156
2157+ if (!intp(json["equalityContract"])) error("Expected integer");
20752158 retval.equality_contract = json["equalityContract"];
20762159
20772160 return retval;
@@ -2092,6 +2175,7 @@ class Event {
20922175 Event Event_from_JSON(mixed json) {
20932176 Event retval = Event();
20942177
2178+ if (!intp(json["event"])) error("Expected integer");
20952179 retval.event = json["event"];
20962180
20972181 return retval;
@@ -2112,6 +2196,7 @@ class Except {
21122196 Except Except_from_JSON(mixed json) {
21132197 Except retval = Except();
21142198
2199+ if (!intp(json["except"])) error("Expected integer");
21152200 retval.except = json["except"];
21162201
21172202 return retval;
@@ -2132,6 +2217,7 @@ class Exception {
21322217 Exception Exception_from_JSON(mixed json) {
21332218 Exception retval = Exception();
21342219
2220+ if (!intp(json["exception"])) error("Expected integer");
21352221 retval.exception = json["exception"];
21362222
21372223 return retval;
@@ -2152,6 +2238,7 @@ class Explicit {
21522238 Explicit Explicit_from_JSON(mixed json) {
21532239 Explicit retval = Explicit();
21542240
2241+ if (!intp(json["explicit"])) error("Expected integer");
21552242 retval.explicit = json["explicit"];
21562243
21572244 return retval;
@@ -2172,6 +2259,7 @@ class Export {
21722259 Export Export_from_JSON(mixed json) {
21732260 Export retval = Export();
21742261
2262+ if (!intp(json["export"])) error("Expected integer");
21752263 retval.export = json["export"];
21762264
21772265 return retval;
@@ -2192,6 +2280,7 @@ class Exposing {
21922280 Exposing Exposing_from_JSON(mixed json) {
21932281 Exposing retval = Exposing();
21942282
2283+ if (!intp(json["exposing"])) error("Expected integer");
21952284 retval.exposing = json["exposing"];
21962285
21972286 return retval;
@@ -2212,6 +2301,7 @@ class Extends {
22122301 Extends Extends_from_JSON(mixed json) {
22132302 Extends retval = Extends();
22142303
2304+ if (!intp(json["extends"])) error("Expected integer");
22152305 retval.extends = json["extends"];
22162306
22172307 return retval;
@@ -2232,6 +2322,7 @@ class Extension {
22322322 Extension Extension_from_JSON(mixed json) {
22332323 Extension retval = Extension();
22342324
2325+ if (!intp(json["extension"])) error("Expected integer");
22352326 retval.extension = json["extension"];
22362327
22372328 return retval;
@@ -2252,6 +2343,7 @@ class Fallthrough {
22522343 Fallthrough Fallthrough_from_JSON(mixed json) {
22532344 Fallthrough retval = Fallthrough();
22542345
2346+ if (!intp(json["fallthrough"])) error("Expected integer");
22552347 retval.fallthrough = json["fallthrough"];
22562348
22572349 return retval;
@@ -2272,6 +2364,7 @@ class False {
22722364 False False_from_JSON(mixed json) {
22732365 False retval = False();
22742366
2367+ if (!intp(json["False"])) error("Expected integer");
22752368 retval.false = json["False"];
22762369
22772370 return retval;
@@ -2292,6 +2385,7 @@ class Fileprivate {
22922385 Fileprivate Fileprivate_from_JSON(mixed json) {
22932386 Fileprivate retval = Fileprivate();
22942387
2388+ if (!intp(json["fileprivate"])) error("Expected integer");
22952389 retval.fileprivate = json["fileprivate"];
22962390
22972391 return retval;
@@ -2312,6 +2406,7 @@ class Finally {
23122406 Finally Finally_from_JSON(mixed json) {
23132407 Finally retval = Finally();
23142408
2409+ if (!intp(json["finally"])) error("Expected integer");
23152410 retval.finally = json["finally"];
23162411
23172412 return retval;
@@ -2332,6 +2427,7 @@ class Fixed {
23322427 Fixed Fixed_from_JSON(mixed json) {
23332428 Fixed retval = Fixed();
23342429
2430+ if (!intp(json["fixed"])) error("Expected integer");
23352431 retval.fixed = json["fixed"];
23362432
23372433 return retval;
@@ -2352,6 +2448,7 @@ class Friend {
23522448 Friend Friend_from_JSON(mixed json) {
23532449 Friend retval = Friend();
23542450
2451+ if (!intp(json["friend"])) error("Expected integer");
23552452 retval.friend = json["friend"];
23562453
23572454 return retval;
@@ -2372,6 +2469,7 @@ class From {
23722469 From From_from_JSON(mixed json) {
23732470 From retval = From();
23742471
2472+ if (!intp(json["from"])) error("Expected integer");
23752473 retval.from = json["from"];
23762474
23772475 return retval;
@@ -2392,6 +2490,7 @@ class FromJson {
23922490 FromJson FromJson_from_JSON(mixed json) {
23932491 FromJson retval = FromJson();
23942492
2493+ if (!intp(json["from_json"])) error("Expected integer");
23952494 retval.from_json = json["from_json"];
23962495
23972496 return retval;
@@ -2412,6 +2511,7 @@ class Func {
24122511 Func Func_from_JSON(mixed json) {
24132512 Func retval = Func();
24142513
2514+ if (!intp(json["func"])) error("Expected integer");
24152515 retval.func = json["func"];
24162516
24172517 return retval;
@@ -2432,6 +2532,7 @@ class Get {
24322532 Get Get_from_JSON(mixed json) {
24332533 Get retval = Get();
24342534
2535+ if (!intp(json["get"])) error("Expected integer");
24352536 retval.get = json["get"];
24362537
24372538 return retval;
@@ -2452,6 +2553,7 @@ class Go {
24522553 Go Go_from_JSON(mixed json) {
24532554 Go retval = Go();
24542555
2556+ if (!intp(json["go"])) error("Expected integer");
24552557 retval.go = json["go"];
24562558
24572559 return retval;
@@ -2472,6 +2574,7 @@ class Goto {
24722574 Goto Goto_from_JSON(mixed json) {
24732575 Goto retval = Goto();
24742576
2577+ if (!intp(json["goto"])) error("Expected integer");
24752578 retval.goto = json["goto"];
24762579
24772580 return retval;
@@ -2492,6 +2595,7 @@ class Guard {
24922595 Guard Guard_from_JSON(mixed json) {
24932596 Guard retval = Guard();
24942597
2598+ if (!intp(json["guard"])) error("Expected integer");
24952599 retval.guard = json["guard"];
24962600
24972601 return retval;
@@ -2512,6 +2616,7 @@ class HasOwnProperty {
25122616 HasOwnProperty HasOwnProperty_from_JSON(mixed json) {
25132617 HasOwnProperty retval = HasOwnProperty();
25142618
2619+ if (!intp(json["hasOwnProperty"])) error("Expected integer");
25152620 retval.has_own_property = json["hasOwnProperty"];
25162621
25172622 return retval;
@@ -2532,6 +2637,7 @@ class Id {
25322637 Id Id_from_JSON(mixed json) {
25332638 Id retval = Id();
25342639
2640+ if (!intp(json["id"])) error("Expected integer");
25352641 retval.id = json["id"];
25362642
25372643 return retval;
@@ -2552,6 +2658,7 @@ class Imp {
25522658 Imp Imp_from_JSON(mixed json) {
25532659 Imp retval = Imp();
25542660
2661+ if (!intp(json["IMP"])) error("Expected integer");
25552662 retval.imp = json["IMP"];
25562663
25572664 return retval;
@@ -2572,6 +2679,7 @@ class Implements {
25722679 Implements Implements_from_JSON(mixed json) {
25732680 Implements retval = Implements();
25742681
2682+ if (!intp(json["implements"])) error("Expected integer");
25752683 retval.implements = json["implements"];
25762684
25772685 return retval;
@@ -2592,6 +2700,7 @@ class Implicit {
25922700 Implicit Implicit_from_JSON(mixed json) {
25932701 Implicit retval = Implicit();
25942702
2703+ if (!intp(json["implicit"])) error("Expected integer");
25952704 retval.implicit = json["implicit"];
25962705
25972706 return retval;
@@ -2612,6 +2721,7 @@ class In {
26122721 In In_from_JSON(mixed json) {
26132722 In retval = In();
26142723
2724+ if (!intp(json["in"])) error("Expected integer");
26152725 retval.in = json["in"];
26162726
26172727 return retval;
@@ -2632,6 +2742,7 @@ class Indirect {
26322742 Indirect Indirect_from_JSON(mixed json) {
26332743 Indirect retval = Indirect();
26342744
2745+ if (!intp(json["indirect"])) error("Expected integer");
26352746 retval.indirect = json["indirect"];
26362747
26372748 return retval;
@@ -2652,6 +2763,7 @@ class Infix {
26522763 Infix Infix_from_JSON(mixed json) {
26532764 Infix retval = Infix();
26542765
2766+ if (!intp(json["infix"])) error("Expected integer");
26552767 retval.infix = json["infix"];
26562768
26572769 return retval;
@@ -2672,6 +2784,7 @@ class Init {
26722784 Init Init_from_JSON(mixed json) {
26732785 Init retval = Init();
26742786
2787+ if (!intp(json["init"])) error("Expected integer");
26752788 retval.init = json["init"];
26762789
26772790 return retval;
@@ -2692,6 +2805,7 @@ class Inout {
26922805 Inout Inout_from_JSON(mixed json) {
26932806 Inout retval = Inout();
26942807
2808+ if (!intp(json["inout"])) error("Expected integer");
26952809 retval.inout = json["inout"];
26962810
26972811 return retval;
@@ -2712,6 +2826,7 @@ class Instanceof {
27122826 Instanceof Instanceof_from_JSON(mixed json) {
27132827 Instanceof retval = Instanceof();
27142828
2829+ if (!intp(json["instanceof"])) error("Expected integer");
27152830 retval.instanceof = json["instanceof"];
27162831
27172832 return retval;
@@ -2732,6 +2847,7 @@ class Interface {
27322847 Interface Interface_from_JSON(mixed json) {
27332848 Interface retval = Interface();
27342849
2850+ if (!intp(json["interface"])) error("Expected integer");
27352851 retval.interface = json["interface"];
27362852
27372853 return retval;
@@ -2752,6 +2868,7 @@ class Internal {
27522868 Internal Internal_from_JSON(mixed json) {
27532869 Internal retval = Internal();
27542870
2871+ if (!intp(json["internal"])) error("Expected integer");
27552872 retval.internal = json["internal"];
27562873
27572874 return retval;
@@ -2772,6 +2889,7 @@ class Default {
27722889 Default Default_from_JSON(mixed json) {
27732890 Default retval = Default();
27742891
2892+ if (!intp(json["default"])) error("Expected integer");
27752893 retval.default_default = json["default"];
27762894
27772895 return retval;
@@ -2792,6 +2910,7 @@ class Do {
27922910 Do Do_from_JSON(mixed json) {
27932911 Do retval = Do();
27942912
2913+ if (!intp(json["do"])) error("Expected integer");
27952914 retval.do_do = json["do"];
27962915
27972916 return retval;
@@ -2812,6 +2931,7 @@ class Else {
28122931 Else Else_from_JSON(mixed json) {
28132932 Else retval = Else();
28142933
2934+ if (!intp(json["else"])) error("Expected integer");
28152935 retval.else_else = json["else"];
28162936
28172937 return retval;
@@ -2832,6 +2952,7 @@ class Enum {
28322952 Enum Enum_from_JSON(mixed json) {
28332953 Enum retval = Enum();
28342954
2955+ if (!intp(json["enum"])) error("Expected integer");
28352956 retval.enum_enum = json["enum"];
28362957
28372958 return retval;
@@ -2852,6 +2973,7 @@ class Extern {
28522973 Extern Extern_from_JSON(mixed json) {
28532974 Extern retval = Extern();
28542975
2976+ if (!intp(json["extern"])) error("Expected integer");
28552977 retval.extern_extern = json["extern"];
28562978
28572979 return retval;
@@ -2872,6 +2994,7 @@ class FalseClass {
28722994 FalseClass FalseClass_from_JSON(mixed json) {
28732995 FalseClass retval = FalseClass();
28742996
2997+ if (!intp(json["false"])) error("Expected integer");
28752998 retval.false = json["false"];
28762999
28773000 return retval;
@@ -2892,6 +3015,7 @@ class Final {
28923015 Final Final_from_JSON(mixed json) {
28933016 Final retval = Final();
28943017
3018+ if (!intp(json["final"])) error("Expected integer");
28953019 retval.final_final = json["final"];
28963020
28973021 return retval;
@@ -2912,6 +3036,7 @@ class Float {
29123036 Float Float_from_JSON(mixed json) {
29133037 Float retval = Float();
29143038
3039+ if (!intp(json["float"])) error("Expected integer");
29153040 retval.float_float = json["float"];
29163041
29173042 return retval;
@@ -2932,6 +3057,7 @@ class For {
29323057 For For_from_JSON(mixed json) {
29333058 For retval = For();
29343059
3060+ if (!intp(json["for"])) error("Expected integer");
29353061 retval.for_for = json["for"];
29363062
29373063 return retval;
@@ -2952,6 +3078,7 @@ class Foreach {
29523078 Foreach Foreach_from_JSON(mixed json) {
29533079 Foreach retval = Foreach();
29543080
3081+ if (!intp(json["foreach"])) error("Expected integer");
29553082 retval.foreach_foreach = json["foreach"];
29563083
29573084 return retval;
@@ -2972,6 +3099,7 @@ class Function {
29723099 Function Function_from_JSON(mixed json) {
29733100 Function retval = Function();
29743101
3102+ if (!intp(json["function"])) error("Expected integer");
29753103 retval.function_function = json["function"];
29763104
29773105 return retval;
@@ -2992,6 +3120,7 @@ class Global {
29923120 Global Global_from_JSON(mixed json) {
29933121 Global retval = Global();
29943122
3123+ if (!intp(json["global"])) error("Expected integer");
29953124 retval.global_global = json["global"];
29963125
29973126 return retval;
@@ -3012,6 +3141,7 @@ class If {
30123141 If If_from_JSON(mixed json) {
30133142 If retval = If();
30143143
3144+ if (!intp(json["if"])) error("Expected integer");
30153145 retval.if_if = json["if"];
30163146
30173147 return retval;
@@ -3032,6 +3162,7 @@ class Import {
30323162 Import Import_from_JSON(mixed json) {
30333163 Import retval = Import();
30343164
3165+ if (!intp(json["import"])) error("Expected integer");
30353166 retval.import_import = json["import"];
30363167
30373168 return retval;
@@ -3052,6 +3183,7 @@ class Inline {
30523183 Inline Inline_from_JSON(mixed json) {
30533184 Inline retval = Inline();
30543185
3186+ if (!intp(json["inline"])) error("Expected integer");
30553187 retval.inline_inline = json["inline"];
30563188
30573189 return retval;
@@ -3072,6 +3204,7 @@ class Int {
30723204 Int Int_from_JSON(mixed json) {
30733205 Int retval = Int();
30743206
3207+ if (!intp(json["int"])) error("Expected integer");
30753208 retval.int_int = json["int"];
30763209
30773210 return retval;
@@ -3222,6 +3355,7 @@ class Obj3 {
32223355 Obj3 Obj3_from_JSON(mixed json) {
32233356 Obj3 retval = Obj3();
32243357
3358+ if (!intp(json["dummy"])) error("Expected integer");
32253359 retval.dummy = json["dummy"];
32263360 retval.is = Is_from_JSON(json["is"]);
32273361 retval.iterable = Iterable_from_JSON(json["iterable"]);
@@ -3307,6 +3441,7 @@ class Is {
33073441 Is Is_from_JSON(mixed json) {
33083442 Is retval = Is();
33093443
3444+ if (!intp(json["is"])) error("Expected integer");
33103445 retval.is = json["is"];
33113446
33123447 return retval;
@@ -3327,6 +3462,7 @@ class Iterable {
33273462 Iterable Iterable_from_JSON(mixed json) {
33283463 Iterable retval = Iterable();
33293464
3465+ if (!intp(json["iterable"])) error("Expected integer");
33303466 retval.iterable = json["iterable"];
33313467
33323468 return retval;
@@ -3347,6 +3483,7 @@ class Jdec {
33473483 Jdec Jdec_from_JSON(mixed json) {
33483484 Jdec retval = Jdec();
33493485
3486+ if (!intp(json["jdec"])) error("Expected integer");
33503487 retval.jdec = json["jdec"];
33513488
33523489 return retval;
@@ -3367,6 +3504,7 @@ class Jenc {
33673504 Jenc Jenc_from_JSON(mixed json) {
33683505 Jenc retval = Jenc();
33693506
3507+ if (!intp(json["jenc"])) error("Expected integer");
33703508 retval.jenc = json["jenc"];
33713509
33723510 return retval;
@@ -3387,6 +3525,7 @@ class Jpipe {
33873525 Jpipe Jpipe_from_JSON(mixed json) {
33883526 Jpipe retval = Jpipe();
33893527
3528+ if (!intp(json["jpipe"])) error("Expected integer");
33903529 retval.jpipe = json["jpipe"];
33913530
33923531 return retval;
@@ -3407,6 +3546,7 @@ class Json {
34073546 Json Json_from_JSON(mixed json) {
34083547 Json retval = Json();
34093548
3549+ if (!intp(json["json"])) error("Expected integer");
34103550 retval.json = json["json"];
34113551
34123552 return retval;
@@ -3427,6 +3567,7 @@ class JsonConverter {
34273567 JsonConverter JsonConverter_from_JSON(mixed json) {
34283568 JsonConverter retval = JsonConverter();
34293569
3570+ if (!intp(json["json_converter"])) error("Expected integer");
34303571 retval.json_converter = json["json_converter"];
34313572
34323573 return retval;
@@ -3447,6 +3588,7 @@ class JsonSerializer {
34473588 JsonSerializer JsonSerializer_from_JSON(mixed json) {
34483589 JsonSerializer retval = JsonSerializer();
34493590
3591+ if (!intp(json["json_serializer"])) error("Expected integer");
34503592 retval.json_serializer = json["json_serializer"];
34513593
34523594 return retval;
@@ -3467,6 +3609,7 @@ class JsonToken {
34673609 JsonToken JsonToken_from_JSON(mixed json) {
34683610 JsonToken retval = JsonToken();
34693611
3612+ if (!intp(json["json_token"])) error("Expected integer");
34703613 retval.json_token = json["json_token"];
34713614
34723615 return retval;
@@ -3487,6 +3630,7 @@ class JsonWriter {
34873630 JsonWriter JsonWriter_from_JSON(mixed json) {
34883631 JsonWriter retval = JsonWriter();
34893632
3633+ if (!intp(json["json_writer"])) error("Expected integer");
34903634 retval.json_writer = json["json_writer"];
34913635
34923636 return retval;
@@ -3507,6 +3651,7 @@ class Lazy {
35073651 Lazy Lazy_from_JSON(mixed json) {
35083652 Lazy retval = Lazy();
35093653
3654+ if (!intp(json["lazy"])) error("Expected integer");
35103655 retval.lazy = json["lazy"];
35113656
35123657 return retval;
@@ -3527,6 +3672,7 @@ class Left {
35273672 Left Left_from_JSON(mixed json) {
35283673 Left retval = Left();
35293674
3675+ if (!intp(json["left"])) error("Expected integer");
35303676 retval.left = json["left"];
35313677
35323678 return retval;
@@ -3547,6 +3693,7 @@ class Let {
35473693 Let Let_from_JSON(mixed json) {
35483694 Let retval = Let();
35493695
3696+ if (!intp(json["let"])) error("Expected integer");
35503697 retval.let = json["let"];
35513698
35523699 return retval;
@@ -3567,6 +3714,7 @@ class List {
35673714 List List_from_JSON(mixed json) {
35683715 List retval = List();
35693716
3717+ if (!intp(json["list"])) error("Expected integer");
35703718 retval.list = json["list"];
35713719
35723720 return retval;
@@ -3587,6 +3735,7 @@ class Lock {
35873735 Lock Lock_from_JSON(mixed json) {
35883736 Lock retval = Lock();
35893737
3738+ if (!intp(json["lock"])) error("Expected integer");
35903739 retval.lock = json["lock"];
35913740
35923741 return retval;
@@ -3607,6 +3756,7 @@ class Long {
36073756 Long Long_from_JSON(mixed json) {
36083757 Long retval = Long();
36093758
3759+ if (!intp(json["long"])) error("Expected integer");
36103760 retval.long = json["long"];
36113761
36123762 return retval;
@@ -3627,6 +3777,7 @@ class Map {
36273777 Map Map_from_JSON(mixed json) {
36283778 Map retval = Map();
36293779
3780+ if (!intp(json["map"])) error("Expected integer");
36303781 retval.map = json["map"];
36313782
36323783 return retval;
@@ -3647,6 +3798,7 @@ class MetadataPropertyHandling {
36473798 MetadataPropertyHandling MetadataPropertyHandling_from_JSON(mixed json) {
36483799 MetadataPropertyHandling retval = MetadataPropertyHandling();
36493800
3801+ if (!intp(json["metadata_property_handling"])) error("Expected integer");
36503802 retval.metadata_property_handling = json["metadata_property_handling"];
36513803
36523804 return retval;
@@ -3667,6 +3819,7 @@ class Module {
36673819 Module Module_from_JSON(mixed json) {
36683820 Module retval = Module();
36693821
3822+ if (!intp(json["module"])) error("Expected integer");
36703823 retval.module = json["module"];
36713824
36723825 return retval;
@@ -3687,6 +3840,7 @@ class Mutable {
36873840 Mutable Mutable_from_JSON(mixed json) {
36883841 Mutable retval = Mutable();
36893842
3843+ if (!intp(json["mutable"])) error("Expected integer");
36903844 retval.mutable = json["mutable"];
36913845
36923846 return retval;
@@ -3707,6 +3861,7 @@ class Mutating {
37073861 Mutating Mutating_from_JSON(mixed json) {
37083862 Mutating retval = Mutating();
37093863
3864+ if (!intp(json["mutating"])) error("Expected integer");
37103865 retval.mutating = json["mutating"];
37113866
37123867 return retval;
@@ -3727,6 +3882,7 @@ class Namespace {
37273882 Namespace Namespace_from_JSON(mixed json) {
37283883 Namespace retval = Namespace();
37293884
3885+ if (!intp(json["namespace"])) error("Expected integer");
37303886 retval.namespace = json["namespace"];
37313887
37323888 return retval;
@@ -3747,6 +3903,7 @@ class Native {
37473903 Native Native_from_JSON(mixed json) {
37483904 Native retval = Native();
37493905
3906+ if (!intp(json["native"])) error("Expected integer");
37503907 retval.native = json["native"];
37513908
37523909 return retval;
@@ -3767,6 +3924,7 @@ class New {
37673924 New New_from_JSON(mixed json) {
37683925 New retval = New();
37693926
3927+ if (!intp(json["new"])) error("Expected integer");
37703928 retval.new = json["new"];
37713929
37723930 return retval;
@@ -3787,6 +3945,7 @@ class Newtonsoft {
37873945 Newtonsoft Newtonsoft_from_JSON(mixed json) {
37883946 Newtonsoft retval = Newtonsoft();
37893947
3948+ if (!intp(json["newtonsoft"])) error("Expected integer");
37903949 retval.newtonsoft = json["newtonsoft"];
37913950
37923951 return retval;
@@ -3807,6 +3966,7 @@ class Nil {
38073966 Nil Nil_from_JSON(mixed json) {
38083967 Nil retval = Nil();
38093968
3969+ if (!intp(json["nil"])) error("Expected integer");
38103970 retval.nil = json["nil"];
38113971
38123972 return retval;
@@ -3827,6 +3987,7 @@ class No {
38273987 No No_from_JSON(mixed json) {
38283988 No retval = No();
38293989
3990+ if (!intp(json["NO"])) error("Expected integer");
38303991 retval.no = json["NO"];
38313992
38323993 return retval;
@@ -3847,6 +4008,7 @@ class Noexcept {
38474008 Noexcept Noexcept_from_JSON(mixed json) {
38484009 Noexcept retval = Noexcept();
38494010
4011+ if (!intp(json["noexcept"])) error("Expected integer");
38504012 retval.noexcept = json["noexcept"];
38514013
38524014 return retval;
@@ -3867,6 +4029,7 @@ class Nonatomic {
38674029 Nonatomic Nonatomic_from_JSON(mixed json) {
38684030 Nonatomic retval = Nonatomic();
38694031
4032+ if (!intp(json["nonatomic"])) error("Expected integer");
38704033 retval.nonatomic = json["nonatomic"];
38714034
38724035 return retval;
@@ -3887,6 +4050,7 @@ class None {
38874050 None None_from_JSON(mixed json) {
38884051 None retval = None();
38894052
4053+ if (!intp(json["None"])) error("Expected integer");
38904054 retval.none = json["None"];
38914055
38924056 return retval;
@@ -3907,6 +4071,7 @@ class Nonlocal {
39074071 Nonlocal Nonlocal_from_JSON(mixed json) {
39084072 Nonlocal retval = Nonlocal();
39094073
4074+ if (!intp(json["nonlocal"])) error("Expected integer");
39104075 retval.nonlocal = json["nonlocal"];
39114076
39124077 return retval;
@@ -3927,6 +4092,7 @@ class Nonmutating {
39274092 Nonmutating Nonmutating_from_JSON(mixed json) {
39284093 Nonmutating retval = Nonmutating();
39294094
4095+ if (!intp(json["nonmutating"])) error("Expected integer");
39304096 retval.nonmutating = json["nonmutating"];
39314097
39324098 return retval;
@@ -3947,6 +4113,7 @@ class Not {
39474113 Not Not_from_JSON(mixed json) {
39484114 Not retval = Not();
39494115
4116+ if (!intp(json["not"])) error("Expected integer");
39504117 retval.not = json["not"];
39514118
39524119 return retval;
@@ -3967,6 +4134,7 @@ class NotEq {
39674134 NotEq NotEq_from_JSON(mixed json) {
39684135 NotEq retval = NotEq();
39694136
4137+ if (!intp(json["not_eq"])) error("Expected integer");
39704138 retval.not_eq = json["not_eq"];
39714139
39724140 return retval;
@@ -3987,6 +4155,7 @@ class NsString {
39874155 NsString NsString_from_JSON(mixed json) {
39884156 NsString retval = NsString();
39894157
4158+ if (!intp(json["NSString"])) error("Expected integer");
39904159 retval.ns_string = json["NSString"];
39914160
39924161 return retval;
@@ -4007,6 +4176,7 @@ class Null {
40074176 Null Null_from_JSON(mixed json) {
40084177 Null retval = Null();
40094178
4179+ if (!intp(json["NULL"])) error("Expected integer");
40104180 retval.null = json["NULL"];
40114181
40124182 return retval;
@@ -4027,6 +4197,7 @@ class Nullptr {
40274197 Nullptr Nullptr_from_JSON(mixed json) {
40284198 Nullptr retval = Nullptr();
40294199
4200+ if (!intp(json["nullptr"])) error("Expected integer");
40304201 retval.nullptr = json["nullptr"];
40314202
40324203 return retval;
@@ -4047,6 +4218,7 @@ class Number {
40474218 Number Number_from_JSON(mixed json) {
40484219 Number retval = Number();
40494220
4221+ if (!intp(json["number"])) error("Expected integer");
40504222 retval.number = json["number"];
40514223
40524224 return retval;
@@ -4067,6 +4239,7 @@ class Lambda {
40674239 Lambda Lambda_from_JSON(mixed json) {
40684240 Lambda retval = Lambda();
40694241
4242+ if (!intp(json["lambda"])) error("Expected integer");
40704243 retval.lambda_lambda = json["lambda"];
40714244
40724245 return retval;
@@ -4087,6 +4260,7 @@ class NoneClass {
40874260 NoneClass NoneClass_from_JSON(mixed json) {
40884261 NoneClass retval = NoneClass();
40894262
4263+ if (!intp(json["none"])) error("Expected integer");
40904264 retval.none = json["none"];
40914265
40924266 return retval;
@@ -4107,6 +4281,7 @@ class NullClass {
41074281 NullClass NullClass_from_JSON(mixed json) {
41084282 NullClass retval = NullClass();
41094283
4284+ if (!intp(json["null"])) error("Expected integer");
41104285 retval.null = json["null"];
41114286
41124287 return retval;
@@ -4127,6 +4302,7 @@ class Object {
41274302 Object Object_from_JSON(mixed json) {
41284303 Object retval = Object();
41294304
4305+ if (!intp(json["object"])) error("Expected integer");
41304306 retval.object_object = json["object"];
41314307
41324308 return retval;
@@ -4147,6 +4323,7 @@ class Optional {
41474323 Optional Optional_from_JSON(mixed json) {
41484324 Optional retval = Optional();
41494325
4326+ if (!intp(json["optional"])) error("Expected integer");
41504327 retval.optional_optional = json["optional"];
41514328
41524329 return retval;
@@ -4167,6 +4344,7 @@ class Private {
41674344 Private Private_from_JSON(mixed json) {
41684345 Private retval = Private();
41694346
4347+ if (!intp(json["private"])) error("Expected integer");
41704348 retval.private_private = json["private"];
41714349
41724350 return retval;
@@ -4187,6 +4365,7 @@ class Protected {
41874365 Protected Protected_from_JSON(mixed json) {
41884366 Protected retval = Protected();
41894367
4368+ if (!intp(json["protected"])) error("Expected integer");
41904369 retval.protected_protected = json["protected"];
41914370
41924371 return retval;
@@ -4207,6 +4386,7 @@ class ProtocolClass {
42074386 ProtocolClass ProtocolClass_from_JSON(mixed json) {
42084387 ProtocolClass retval = ProtocolClass();
42094388
4389+ if (!intp(json["protocol"])) error("Expected integer");
42104390 retval.protocol = json["protocol"];
42114391
42124392 return retval;
@@ -4227,6 +4407,7 @@ class Of {
42274407 Of Of_from_JSON(mixed json) {
42284408 Of retval = Of();
42294409
4410+ if (!intp(json["of"])) error("Expected integer");
42304411 retval.of = json["of"];
42314412
42324413 return retval;
@@ -4247,6 +4428,7 @@ class Oneway {
42474428 Oneway Oneway_from_JSON(mixed json) {
42484429 Oneway retval = Oneway();
42494430
4431+ if (!intp(json["oneway"])) error("Expected integer");
42504432 retval.oneway = json["oneway"];
42514433
42524434 return retval;
@@ -4267,6 +4449,7 @@ class Open {
42674449 Open Open_from_JSON(mixed json) {
42684450 Open retval = Open();
42694451
4452+ if (!intp(json["open"])) error("Expected integer");
42704453 retval.open = json["open"];
42714454
42724455 return retval;
@@ -4287,6 +4470,7 @@ class Operator {
42874470 Operator Operator_from_JSON(mixed json) {
42884471 Operator retval = Operator();
42894472
4473+ if (!intp(json["operator"])) error("Expected integer");
42904474 retval.operator = json["operator"];
42914475
42924476 return retval;
@@ -4307,6 +4491,7 @@ class Or {
43074491 Or Or_from_JSON(mixed json) {
43084492 Or retval = Or();
43094493
4494+ if (!intp(json["or"])) error("Expected integer");
43104495 retval.or = json["or"];
43114496
43124497 return retval;
@@ -4327,6 +4512,7 @@ class OrEq {
43274512 OrEq OrEq_from_JSON(mixed json) {
43284513 OrEq retval = OrEq();
43294514
4515+ if (!intp(json["or_eq"])) error("Expected integer");
43304516 retval.or_eq = json["or_eq"];
43314517
43324518 return retval;
@@ -4347,6 +4533,7 @@ class Out {
43474533 Out Out_from_JSON(mixed json) {
43484534 Out retval = Out();
43494535
4536+ if (!intp(json["out"])) error("Expected integer");
43504537 retval.out = json["out"];
43514538
43524539 return retval;
@@ -4367,6 +4554,7 @@ class Override {
43674554 Override Override_from_JSON(mixed json) {
43684555 Override retval = Override();
43694556
4557+ if (!intp(json["override"])) error("Expected integer");
43704558 retval.override = json["override"];
43714559
43724560 return retval;
@@ -4387,6 +4575,7 @@ class Package {
43874575 Package Package_from_JSON(mixed json) {
43884576 Package retval = Package();
43894577
4578+ if (!intp(json["package"])) error("Expected integer");
43904579 retval.package = json["package"];
43914580
43924581 return retval;
@@ -4407,6 +4596,7 @@ class Params {
44074596 Params Params_from_JSON(mixed json) {
44084597 Params retval = Params();
44094598
4599+ if (!intp(json["params"])) error("Expected integer");
44104600 retval.params = json["params"];
44114601
44124602 return retval;
@@ -4427,6 +4617,7 @@ class Pass {
44274617 Pass Pass_from_JSON(mixed json) {
44284618 Pass retval = Pass();
44294619
4620+ if (!intp(json["pass"])) error("Expected integer");
44304621 retval.pass = json["pass"];
44314622
44324623 return retval;
@@ -4447,6 +4638,7 @@ class Port {
44474638 Port Port_from_JSON(mixed json) {
44484639 Port retval = Port();
44494640
4641+ if (!intp(json["port"])) error("Expected integer");
44504642 retval.port = json["port"];
44514643
44524644 return retval;
@@ -4467,6 +4659,7 @@ class Postfix {
44674659 Postfix Postfix_from_JSON(mixed json) {
44684660 Postfix retval = Postfix();
44694661
4662+ if (!intp(json["postfix"])) error("Expected integer");
44704663 retval.postfix = json["postfix"];
44714664
44724665 return retval;
@@ -4487,6 +4680,7 @@ class Precedence {
44874680 Precedence Precedence_from_JSON(mixed json) {
44884681 Precedence retval = Precedence();
44894682
4683+ if (!intp(json["precedence"])) error("Expected integer");
44904684 retval.precedence = json["precedence"];
44914685
44924686 return retval;
@@ -4507,6 +4701,7 @@ class Prefix {
45074701 Prefix Prefix_from_JSON(mixed json) {
45084702 Prefix retval = Prefix();
45094703
4704+ if (!intp(json["prefix"])) error("Expected integer");
45104705 retval.prefix = json["prefix"];
45114706
45124707 return retval;
@@ -4527,6 +4722,7 @@ class Print {
45274722 Print Print_from_JSON(mixed json) {
45284723 Print retval = Print();
45294724
4725+ if (!intp(json["print"])) error("Expected integer");
45304726 retval.print = json["print"];
45314727
45324728 return retval;
@@ -4547,6 +4743,7 @@ class PrintMembers {
45474743 PrintMembers PrintMembers_from_JSON(mixed json) {
45484744 PrintMembers retval = PrintMembers();
45494745
4746+ if (!intp(json["printMembers"])) error("Expected integer");
45504747 retval.print_members = json["printMembers"];
45514748
45524749 return retval;
@@ -4567,6 +4764,7 @@ class Printf {
45674764 Printf Printf_from_JSON(mixed json) {
45684765 Printf retval = Printf();
45694766
4767+ if (!intp(json["printf"])) error("Expected integer");
45704768 retval.printf = json["printf"];
45714769
45724770 return retval;
@@ -4587,6 +4785,7 @@ class Protocol {
45874785 Protocol Protocol_from_JSON(mixed json) {
45884786 Protocol retval = Protocol();
45894787
4788+ if (!intp(json["Protocol"])) error("Expected integer");
45904789 retval.protocol = json["Protocol"];
45914790
45924791 return retval;
@@ -4735,6 +4934,7 @@ class Obj4 {
47354934 Obj4 Obj4_from_JSON(mixed json) {
47364935 Obj4 retval = Obj4();
47374936
4937+ if (!intp(json["dummy"])) error("Expected integer");
47384938 retval.dummy = json["dummy"];
47394939 retval.obj4_public = Public_from_JSON(json["public"]);
47404940 retval.obj4_return = Return_from_JSON(json["return"]);
@@ -4819,6 +5019,7 @@ class Public {
48195019 Public Public_from_JSON(mixed json) {
48205020 Public retval = Public();
48215021
5022+ if (!intp(json["public"])) error("Expected integer");
48225023 retval.public_public = json["public"];
48235024
48245025 return retval;
@@ -4839,6 +5040,7 @@ class Return {
48395040 Return Return_from_JSON(mixed json) {
48405041 Return retval = Return();
48415042
5043+ if (!intp(json["return"])) error("Expected integer");
48425044 retval.return_return = json["return"];
48435045
48445046 return retval;
@@ -4859,6 +5061,7 @@ class SelfClass {
48595061 SelfClass SelfClass_from_JSON(mixed json) {
48605062 SelfClass retval = SelfClass();
48615063
5064+ if (!intp(json["self"])) error("Expected integer");
48625065 retval.self = json["self"];
48635066
48645067 return retval;
@@ -4879,6 +5082,7 @@ class Static {
48795082 Static Static_from_JSON(mixed json) {
48805083 Static retval = Static();
48815084
5085+ if (!intp(json["static"])) error("Expected integer");
48825086 retval.static_static = json["static"];
48835087
48845088 return retval;
@@ -4899,6 +5103,7 @@ class String {
48995103 String String_from_JSON(mixed json) {
49005104 String retval = String();
49015105
5106+ if (!intp(json["string"])) error("Expected integer");
49025107 retval.string_string = json["string"];
49035108
49045109 return retval;
@@ -4919,6 +5124,7 @@ class Switch {
49195124 Switch Switch_from_JSON(mixed json) {
49205125 Switch retval = Switch();
49215126
5127+ if (!intp(json["switch"])) error("Expected integer");
49225128 retval.switch_switch = json["switch"];
49235129
49245130 return retval;
@@ -4939,6 +5145,7 @@ class TrueClass {
49395145 TrueClass TrueClass_from_JSON(mixed json) {
49405146 TrueClass retval = TrueClass();
49415147
5148+ if (!intp(json["true"])) error("Expected integer");
49425149 retval.true = json["true"];
49435150
49445151 return retval;
@@ -4959,6 +5166,7 @@ class TypeClass {
49595166 TypeClass TypeClass_from_JSON(mixed json) {
49605167 TypeClass retval = TypeClass();
49615168
5169+ if (!intp(json["type"])) error("Expected integer");
49625170 retval.type = json["type"];
49635171
49645172 return retval;
@@ -4979,6 +5187,7 @@ class Typedef {
49795187 Typedef Typedef_from_JSON(mixed json) {
49805188 Typedef retval = Typedef();
49815189
5190+ if (!intp(json["typedef"])) error("Expected integer");
49825191 retval.typedef_typedef = json["typedef"];
49835192
49845193 return retval;
@@ -4999,6 +5208,7 @@ class Typeof {
49995208 Typeof Typeof_from_JSON(mixed json) {
50005209 Typeof retval = Typeof();
50015210
5211+ if (!intp(json["typeof"])) error("Expected integer");
50025212 retval.typeof_typeof = json["typeof"];
50035213
50045214 return retval;
@@ -5019,6 +5229,7 @@ class Quicktype {
50195229 Quicktype Quicktype_from_JSON(mixed json) {
50205230 Quicktype retval = Quicktype();
50215231
5232+ if (!intp(json["quicktype"])) error("Expected integer");
50225233 retval.quicktype = json["quicktype"];
50235234
50245235 return retval;
@@ -5039,6 +5250,7 @@ class Raise {
50395250 Raise Raise_from_JSON(mixed json) {
50405251 Raise retval = Raise();
50415252
5253+ if (!intp(json["raise"])) error("Expected integer");
50425254 retval.raise = json["raise"];
50435255
50445256 return retval;
@@ -5059,6 +5271,7 @@ class Range {
50595271 Range Range_from_JSON(mixed json) {
50605272 Range retval = Range();
50615273
5274+ if (!intp(json["range"])) error("Expected integer");
50625275 retval.range = json["range"];
50635276
50645277 return retval;
@@ -5079,6 +5292,7 @@ class Readonly {
50795292 Readonly Readonly_from_JSON(mixed json) {
50805293 Readonly retval = Readonly();
50815294
5295+ if (!intp(json["readonly"])) error("Expected integer");
50825296 retval.readonly = json["readonly"];
50835297
50845298 return retval;
@@ -5099,6 +5313,7 @@ class Ref {
50995313 Ref Ref_from_JSON(mixed json) {
51005314 Ref retval = Ref();
51015315
5316+ if (!intp(json["ref"])) error("Expected integer");
51025317 retval.ref = json["ref"];
51035318
51045319 return retval;
@@ -5119,6 +5334,7 @@ class Register {
51195334 Register Register_from_JSON(mixed json) {
51205335 Register retval = Register();
51215336
5337+ if (!intp(json["register"])) error("Expected integer");
51225338 retval.register = json["register"];
51235339
51245340 return retval;
@@ -5139,6 +5355,7 @@ class ReinterpretCast {
51395355 ReinterpretCast ReinterpretCast_from_JSON(mixed json) {
51405356 ReinterpretCast retval = ReinterpretCast();
51415357
5358+ if (!intp(json["reinterpret_cast"])) error("Expected integer");
51425359 retval.reinterpret_cast = json["reinterpret_cast"];
51435360
51445361 return retval;
@@ -5159,6 +5376,7 @@ class Repeat {
51595376 Repeat Repeat_from_JSON(mixed json) {
51605377 Repeat retval = Repeat();
51615378
5379+ if (!intp(json["repeat"])) error("Expected integer");
51625380 retval.repeat = json["repeat"];
51635381
51645382 return retval;
@@ -5179,6 +5397,7 @@ class Require {
51795397 Require Require_from_JSON(mixed json) {
51805398 Require retval = Require();
51815399
5400+ if (!intp(json["require"])) error("Expected integer");
51825401 retval.require = json["require"];
51835402
51845403 return retval;
@@ -5199,6 +5418,7 @@ class Required {
51995418 Required Required_from_JSON(mixed json) {
52005419 Required retval = Required();
52015420
5421+ if (!intp(json["required"])) error("Expected integer");
52025422 retval.required = json["required"];
52035423
52045424 return retval;
@@ -5219,6 +5439,7 @@ class Requires {
52195439 Requires Requires_from_JSON(mixed json) {
52205440 Requires retval = Requires();
52215441
5442+ if (!intp(json["requires"])) error("Expected integer");
52225443 retval.requires = json["requires"];
52235444
52245445 return retval;
@@ -5239,6 +5460,7 @@ class Restrict {
52395460 Restrict Restrict_from_JSON(mixed json) {
52405461 Restrict retval = Restrict();
52415462
5463+ if (!intp(json["restrict"])) error("Expected integer");
52425464 retval.restrict = json["restrict"];
52435465
52445466 return retval;
@@ -5259,6 +5481,7 @@ class Retain {
52595481 Retain Retain_from_JSON(mixed json) {
52605482 Retain retval = Retain();
52615483
5484+ if (!intp(json["retain"])) error("Expected integer");
52625485 retval.retain = json["retain"];
52635486
52645487 return retval;
@@ -5279,6 +5502,7 @@ class Rethrows {
52795502 Rethrows Rethrows_from_JSON(mixed json) {
52805503 Rethrows retval = Rethrows();
52815504
5505+ if (!intp(json["rethrows"])) error("Expected integer");
52825506 retval.rethrows = json["rethrows"];
52835507
52845508 return retval;
@@ -5299,6 +5523,7 @@ class Right {
52995523 Right Right_from_JSON(mixed json) {
53005524 Right retval = Right();
53015525
5526+ if (!intp(json["right"])) error("Expected integer");
53025527 retval.right = json["right"];
53035528
53045529 return retval;
@@ -5319,6 +5544,7 @@ class Sbyte {
53195544 Sbyte Sbyte_from_JSON(mixed json) {
53205545 Sbyte retval = Sbyte();
53215546
5547+ if (!intp(json["sbyte"])) error("Expected integer");
53225548 retval.sbyte = json["sbyte"];
53235549
53245550 return retval;
@@ -5339,6 +5565,7 @@ class Sealed {
53395565 Sealed Sealed_from_JSON(mixed json) {
53405566 Sealed retval = Sealed();
53415567
5568+ if (!intp(json["sealed"])) error("Expected integer");
53425569 retval.sealed = json["sealed"];
53435570
53445571 return retval;
@@ -5359,6 +5586,7 @@ class Sel {
53595586 Sel Sel_from_JSON(mixed json) {
53605587 Sel retval = Sel();
53615588
5589+ if (!intp(json["SEL"])) error("Expected integer");
53625590 retval.sel = json["SEL"];
53635591
53645592 return retval;
@@ -5379,6 +5607,7 @@ class Select {
53795607 Select Select_from_JSON(mixed json) {
53805608 Select retval = Select();
53815609
5610+ if (!intp(json["select"])) error("Expected integer");
53825611 retval.select = json["select"];
53835612
53845613 return retval;
@@ -5399,6 +5628,7 @@ class Self {
53995628 Self Self_from_JSON(mixed json) {
54005629 Self retval = Self();
54015630
5631+ if (!intp(json["Self"])) error("Expected integer");
54025632 retval.self = json["Self"];
54035633
54045634 return retval;
@@ -5419,6 +5649,7 @@ class Serialize {
54195649 Serialize Serialize_from_JSON(mixed json) {
54205650 Serialize retval = Serialize();
54215651
5652+ if (!intp(json["serialize"])) error("Expected integer");
54225653 retval.serialize = json["serialize"];
54235654
54245655 return retval;
@@ -5439,6 +5670,7 @@ class Set {
54395670 Set Set_from_JSON(mixed json) {
54405671 Set retval = Set();
54415672
5673+ if (!intp(json["set"])) error("Expected integer");
54425674 retval.set = json["set"];
54435675
54445676 return retval;
@@ -5459,6 +5691,7 @@ class Short {
54595691 Short Short_from_JSON(mixed json) {
54605692 Short retval = Short();
54615693
5694+ if (!intp(json["short"])) error("Expected integer");
54625695 retval.short = json["short"];
54635696
54645697 return retval;
@@ -5479,6 +5712,7 @@ class Signed {
54795712 Signed Signed_from_JSON(mixed json) {
54805713 Signed retval = Signed();
54815714
5715+ if (!intp(json["signed"])) error("Expected integer");
54825716 retval.signed = json["signed"];
54835717
54845718 return retval;
@@ -5499,6 +5733,7 @@ class Sizeof {
54995733 Sizeof Sizeof_from_JSON(mixed json) {
55005734 Sizeof retval = Sizeof();
55015735
5736+ if (!intp(json["sizeof"])) error("Expected integer");
55025737 retval.sizeof = json["sizeof"];
55035738
55045739 return retval;
@@ -5519,6 +5754,7 @@ class Stackalloc {
55195754 Stackalloc Stackalloc_from_JSON(mixed json) {
55205755 Stackalloc retval = Stackalloc();
55215756
5757+ if (!intp(json["stackalloc"])) error("Expected integer");
55225758 retval.stackalloc = json["stackalloc"];
55235759
55245760 return retval;
@@ -5539,6 +5775,7 @@ class StaticAssert {
55395775 StaticAssert StaticAssert_from_JSON(mixed json) {
55405776 StaticAssert retval = StaticAssert();
55415777
5778+ if (!intp(json["static_assert"])) error("Expected integer");
55425779 retval.static_assert = json["static_assert"];
55435780
55445781 return retval;
@@ -5559,6 +5796,7 @@ class StaticCast {
55595796 StaticCast StaticCast_from_JSON(mixed json) {
55605797 StaticCast retval = StaticCast();
55615798
5799+ if (!intp(json["static_cast"])) error("Expected integer");
55625800 retval.static_cast = json["static_cast"];
55635801
55645802 return retval;
@@ -5579,6 +5817,7 @@ class Strictfp {
55795817 Strictfp Strictfp_from_JSON(mixed json) {
55805818 Strictfp retval = Strictfp();
55815819
5820+ if (!intp(json["strictfp"])) error("Expected integer");
55825821 retval.strictfp = json["strictfp"];
55835822
55845823 return retval;
@@ -5599,6 +5838,7 @@ class Struct {
55995838 Struct Struct_from_JSON(mixed json) {
56005839 Struct retval = Struct();
56015840
5841+ if (!intp(json["struct"])) error("Expected integer");
56025842 retval.struct = json["struct"];
56035843
56045844 return retval;
@@ -5619,6 +5859,7 @@ class Subscript {
56195859 Subscript Subscript_from_JSON(mixed json) {
56205860 Subscript retval = Subscript();
56215861
5862+ if (!intp(json["subscript"])) error("Expected integer");
56225863 retval.subscript = json["subscript"];
56235864
56245865 return retval;
@@ -5639,6 +5880,7 @@ class Super {
56395880 Super Super_from_JSON(mixed json) {
56405881 Super retval = Super();
56415882
5883+ if (!intp(json["super"])) error("Expected integer");
56425884 retval.super = json["super"];
56435885
56445886 return retval;
@@ -5659,6 +5901,7 @@ class Symbol {
56595901 Symbol Symbol_from_JSON(mixed json) {
56605902 Symbol retval = Symbol();
56615903
5904+ if (!intp(json["symbol"])) error("Expected integer");
56625905 retval.symbol = json["symbol"];
56635906
56645907 return retval;
@@ -5679,6 +5922,7 @@ class Synchronized {
56795922 Synchronized Synchronized_from_JSON(mixed json) {
56805923 Synchronized retval = Synchronized();
56815924
5925+ if (!intp(json["synchronized"])) error("Expected integer");
56825926 retval.synchronized = json["synchronized"];
56835927
56845928 return retval;
@@ -5699,6 +5943,7 @@ class System {
56995943 System System_from_JSON(mixed json) {
57005944 System retval = System();
57015945
5946+ if (!intp(json["system"])) error("Expected integer");
57025947 retval.system = json["system"];
57035948
57045949 return retval;
@@ -5719,6 +5964,7 @@ class Template {
57195964 Template Template_from_JSON(mixed json) {
57205965 Template retval = Template();
57215966
5967+ if (!intp(json["template"])) error("Expected integer");
57225968 retval.template = json["template"];
57235969
57245970 return retval;
@@ -5739,6 +5985,7 @@ class Then {
57395985 Then Then_from_JSON(mixed json) {
57405986 Then retval = Then();
57415987
5988+ if (!intp(json["then"])) error("Expected integer");
57425989 retval.then = json["then"];
57435990
57445991 return retval;
@@ -5759,6 +6006,7 @@ class This {
57596006 This This_from_JSON(mixed json) {
57606007 This retval = This();
57616008
6009+ if (!intp(json["this"])) error("Expected integer");
57626010 retval.this = json["this"];
57636011
57646012 return retval;
@@ -5779,6 +6027,7 @@ class ThreadLocal {
57796027 ThreadLocal ThreadLocal_from_JSON(mixed json) {
57806028 ThreadLocal retval = ThreadLocal();
57816029
6030+ if (!intp(json["thread_local"])) error("Expected integer");
57826031 retval.thread_local = json["thread_local"];
57836032
57846033 return retval;
@@ -5799,6 +6048,7 @@ class Throw {
57996048 Throw Throw_from_JSON(mixed json) {
58006049 Throw retval = Throw();
58016050
6051+ if (!intp(json["throw"])) error("Expected integer");
58026052 retval.throw = json["throw"];
58036053
58046054 return retval;
@@ -5819,6 +6069,7 @@ class Throws {
58196069 Throws Throws_from_JSON(mixed json) {
58206070 Throws retval = Throws();
58216071
6072+ if (!intp(json["throws"])) error("Expected integer");
58226073 retval.throws = json["throws"];
58236074
58246075 return retval;
@@ -5839,6 +6090,7 @@ class ToJson {
58396090 ToJson ToJson_from_JSON(mixed json) {
58406091 ToJson retval = ToJson();
58416092
6093+ if (!intp(json["to_json"])) error("Expected integer");
58426094 retval.to_json = json["to_json"];
58436095
58446096 return retval;
@@ -5859,6 +6111,7 @@ class TopLevelClass {
58596111 TopLevelClass TopLevelClass_from_JSON(mixed json) {
58606112 TopLevelClass retval = TopLevelClass();
58616113
6114+ if (!intp(json["top_level"])) error("Expected integer");
58626115 retval.top_level = json["top_level"];
58636116
58646117 return retval;
@@ -5879,6 +6132,7 @@ class Transient {
58796132 Transient Transient_from_JSON(mixed json) {
58806133 Transient retval = Transient();
58816134
6135+ if (!intp(json["transient"])) error("Expected integer");
58826136 retval.transient = json["transient"];
58836137
58846138 return retval;
@@ -5899,6 +6153,7 @@ class True {
58996153 True True_from_JSON(mixed json) {
59006154 True retval = True();
59016155
6156+ if (!intp(json["True"])) error("Expected integer");
59026157 retval.true = json["True"];
59036158
59046159 return retval;
@@ -5919,6 +6174,7 @@ class Try {
59196174 Try Try_from_JSON(mixed json) {
59206175 Try retval = Try();
59216176
6177+ if (!intp(json["try"])) error("Expected integer");
59226178 retval.try = json["try"];
59236179
59246180 return retval;
@@ -5939,6 +6195,7 @@ class Type {
59396195 Type Type_from_JSON(mixed json) {
59406196 Type retval = Type();
59416197
6198+ if (!intp(json["Type"])) error("Expected integer");
59426199 retval.type = json["Type"];
59436200
59446201 return retval;
@@ -5959,6 +6216,7 @@ class Typealias {
59596216 Typealias Typealias_from_JSON(mixed json) {
59606217 Typealias retval = Typealias();
59616218
6219+ if (!intp(json["typealias"])) error("Expected integer");
59626220 retval.typealias = json["typealias"];
59636221
59646222 return retval;
@@ -5979,6 +6237,7 @@ class Typeid {
59796237 Typeid Typeid_from_JSON(mixed json) {
59806238 Typeid retval = Typeid();
59816239
6240+ if (!intp(json["typeid"])) error("Expected integer");
59826241 retval.typeid = json["typeid"];
59836242
59846243 return retval;
@@ -5999,6 +6258,7 @@ class Typename {
59996258 Typename Typename_from_JSON(mixed json) {
60006259 Typename retval = Typename();
60016260
6261+ if (!intp(json["typename"])) error("Expected integer");
60026262 retval.typename = json["typename"];
60036263
60046264 return retval;
@@ -6019,6 +6279,7 @@ class Uint {
60196279 Uint Uint_from_JSON(mixed json) {
60206280 Uint retval = Uint();
60216281
6282+ if (!intp(json["uint"])) error("Expected integer");
60226283 retval.uint = json["uint"];
60236284
60246285 return retval;
@@ -6039,6 +6300,7 @@ class Ulong {
60396300 Ulong Ulong_from_JSON(mixed json) {
60406301 Ulong retval = Ulong();
60416302
6303+ if (!intp(json["ulong"])) error("Expected integer");
60426304 retval.ulong = json["ulong"];
60436305
60446306 return retval;
@@ -6059,6 +6321,7 @@ class Unchecked {
60596321 Unchecked Unchecked_from_JSON(mixed json) {
60606322 Unchecked retval = Unchecked();
60616323
6324+ if (!intp(json["unchecked"])) error("Expected integer");
60626325 retval.unchecked = json["unchecked"];
60636326
60646327 return retval;
@@ -6079,6 +6342,7 @@ class Undefined {
60796342 Undefined Undefined_from_JSON(mixed json) {
60806343 Undefined retval = Undefined();
60816344
6345+ if (!intp(json["undefined"])) error("Expected integer");
60826346 retval.undefined = json["undefined"];
60836347
60846348 return retval;
@@ -6139,6 +6403,7 @@ class Obj5 {
61396403 Obj5 Obj5_from_JSON(mixed json) {
61406404 Obj5 retval = Obj5();
61416405
6406+ if (!intp(json["dummy"])) error("Expected integer");
61426407 retval.dummy = json["dummy"];
61436408 retval.obj5_void = Void_from_JSON(json["void"]);
61446409 retval.obj5_while = While_from_JSON(json["while"]);
@@ -6179,6 +6444,7 @@ class Void {
61796444 Void Void_from_JSON(mixed json) {
61806445 Void retval = Void();
61816446
6447+ if (!intp(json["void"])) error("Expected integer");
61826448 retval.void_void = json["void"];
61836449
61846450 return retval;
@@ -6199,6 +6465,7 @@ class While {
61996465 While While_from_JSON(mixed json) {
62006466 While retval = While();
62016467
6468+ if (!intp(json["while"])) error("Expected integer");
62026469 retval.while_while = json["while"];
62036470
62046471 return retval;
@@ -6219,6 +6486,7 @@ class Union {
62196486 Union Union_from_JSON(mixed json) {
62206487 Union retval = Union();
62216488
6489+ if (!intp(json["union"])) error("Expected integer");
62226490 retval.union = json["union"];
62236491
62246492 return retval;
@@ -6239,6 +6507,7 @@ class Unowned {
62396507 Unowned Unowned_from_JSON(mixed json) {
62406508 Unowned retval = Unowned();
62416509
6510+ if (!intp(json["unowned"])) error("Expected integer");
62426511 retval.unowned = json["unowned"];
62436512
62446513 return retval;
@@ -6259,6 +6528,7 @@ class Unsafe {
62596528 Unsafe Unsafe_from_JSON(mixed json) {
62606529 Unsafe retval = Unsafe();
62616530
6531+ if (!intp(json["unsafe"])) error("Expected integer");
62626532 retval.unsafe = json["unsafe"];
62636533
62646534 return retval;
@@ -6279,6 +6549,7 @@ class Unsigned {
62796549 Unsigned Unsigned_from_JSON(mixed json) {
62806550 Unsigned retval = Unsigned();
62816551
6552+ if (!intp(json["unsigned"])) error("Expected integer");
62826553 retval.unsigned = json["unsigned"];
62836554
62846555 return retval;
@@ -6299,6 +6570,7 @@ class Ushort {
62996570 Ushort Ushort_from_JSON(mixed json) {
63006571 Ushort retval = Ushort();
63016572
6573+ if (!intp(json["ushort"])) error("Expected integer");
63026574 retval.ushort = json["ushort"];
63036575
63046576 return retval;
@@ -6319,6 +6591,7 @@ class Using {
63196591 Using Using_from_JSON(mixed json) {
63206592 Using retval = Using();
63216593
6594+ if (!intp(json["using"])) error("Expected integer");
63226595 retval.using = json["using"];
63236596
63246597 return retval;
@@ -6339,6 +6612,7 @@ class Var {
63396612 Var Var_from_JSON(mixed json) {
63406613 Var retval = Var();
63416614
6615+ if (!intp(json["var"])) error("Expected integer");
63426616 retval.var = json["var"];
63436617
63446618 return retval;
@@ -6359,6 +6633,7 @@ class Virtual {
63596633 Virtual Virtual_from_JSON(mixed json) {
63606634 Virtual retval = Virtual();
63616635
6636+ if (!intp(json["virtual"])) error("Expected integer");
63626637 retval.virtual = json["virtual"];
63636638
63646639 return retval;
@@ -6379,6 +6654,7 @@ class Volatile {
63796654 Volatile Volatile_from_JSON(mixed json) {
63806655 Volatile retval = Volatile();
63816656
6657+ if (!intp(json["volatile"])) error("Expected integer");
63826658 retval.volatile = json["volatile"];
63836659
63846660 return retval;
@@ -6399,6 +6675,7 @@ class WcharT {
63996675 WcharT WcharT_from_JSON(mixed json) {
64006676 WcharT retval = WcharT();
64016677
6678+ if (!intp(json["wchar_t"])) error("Expected integer");
64026679 retval.wchar_t = json["wchar_t"];
64036680
64046681 return retval;
@@ -6419,6 +6696,7 @@ class Weak {
64196696 Weak Weak_from_JSON(mixed json) {
64206697 Weak retval = Weak();
64216698
6699+ if (!intp(json["weak"])) error("Expected integer");
64226700 retval.weak = json["weak"];
64236701
64246702 return retval;
@@ -6439,6 +6717,7 @@ class Where {
64396717 Where Where_from_JSON(mixed json) {
64406718 Where retval = Where();
64416719
6720+ if (!intp(json["where"])) error("Expected integer");
64426721 retval.where = json["where"];
64436722
64446723 return retval;
@@ -6459,6 +6738,7 @@ class WillSet {
64596738 WillSet WillSet_from_JSON(mixed json) {
64606739 WillSet retval = WillSet();
64616740
6741+ if (!intp(json["willSet"])) error("Expected integer");
64626742 retval.will_set = json["willSet"];
64636743
64646744 return retval;
@@ -6479,6 +6759,7 @@ class With {
64796759 With With_from_JSON(mixed json) {
64806760 With retval = With();
64816761
6762+ if (!intp(json["with"])) error("Expected integer");
64826763 retval.with = json["with"];
64836764
64846765 return retval;
@@ -6499,6 +6780,7 @@ class Xor {
64996780 Xor Xor_from_JSON(mixed json) {
65006781 Xor retval = Xor();
65016782
6783+ if (!intp(json["xor"])) error("Expected integer");
65026784 retval.xor = json["xor"];
65036785
65046786 return retval;
@@ -6519,6 +6801,7 @@ class XorEq {
65196801 XorEq XorEq_from_JSON(mixed json) {
65206802 XorEq retval = XorEq();
65216803
6804+ if (!intp(json["xor_eq"])) error("Expected integer");
65226805 retval.xor_eq = json["xor_eq"];
65236806
65246807 return retval;
@@ -6539,6 +6822,7 @@ class Yes {
65396822 Yes Yes_from_JSON(mixed json) {
65406823 Yes retval = Yes();
65416824
6825+ if (!intp(json["YES"])) error("Expected integer");
65426826 retval.yes = json["YES"];
65436827
65446828 return retval;
@@ -6559,6 +6843,7 @@ class Yield {
65596843 Yield Yield_from_JSON(mixed json) {
65606844 Yield retval = Yield();
65616845
6846+ if (!intp(json["yield"])) error("Expected integer");
65626847 retval.yield = json["yield"];
65636848
65646849 return retval;
Test case

test/inputs/json/priority/list.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -29,6 +29,7 @@ class TopLevel {
2929 TopLevel TopLevel_from_JSON(mixed json) {
3030 TopLevel retval = TopLevel();
3131
32+ if (!intp(json["data"])) error("Expected integer");
3233 retval.data = json["data"];
3334 if (!has_index(json, "next")) error("Missing required property");
3435 retval.next = json["next"] == Val.null ? Val.null : TopLevel_from_JSON(json["next"]);
Test case

test/inputs/json/priority/name-style.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -39,6 +39,7 @@ class TopLevel {
3939 TopLevel TopLevel_from_JSON(mixed json) {
4040 TopLevel retval = TopLevel();
4141
42+ if (!intp(json["anEasyOne"])) error("Expected integer");
4243 retval.an_easy_one = json["anEasyOne"];
4344 if (json["isMNISTLetter"] != Standards.JSON.true && json["isMNISTLetter"] != Standards.JSON.false) error("Expected bool");
4445 retval.is_mnist_letter = json["isMNISTLetter"];
Test case

test/inputs/json/priority/nbl-stats.json

1 generated file · +115 −0
Mpikedefault / TopLevel.pmod+115 −0
@@ -65,9 +65,12 @@ class TopLevel {
6565 TopLevel TopLevel_from_JSON(mixed json) {
6666 TopLevel retval = TopLevel();
6767
68+ if (!intp(json["attendance"])) error("Expected integer");
6869 retval.attendance = json["attendance"];
6970 retval.clock = json["clock"];
71+ if (!intp(json["disableMatch"])) error("Expected integer");
7072 retval.disable_match = json["disableMatch"];
73+ if (!intp(json["inOT"])) error("Expected integer");
7174 retval.in_ot = json["inOT"];
7275 retval.leaddata = json["leaddata"];
7376 retval.officials_referee1 = json["officials_referee1"];
@@ -75,15 +78,20 @@ TopLevel TopLevel_from_JSON(mixed json) {
7578 retval.officials_referee3 = json["officials_referee3"];
7679 retval.othermatches = json["othermatches"];
7780 retval.pbp = json["pbp"];
81+ if (!intp(json["period"])) error("Expected integer");
7882 retval.period = json["period"];
83+ if (!intp(json["periodLengthOVERTIME"])) error("Expected integer");
7984 retval.period_length_overtime = json["periodLengthOVERTIME"];
85+ if (!intp(json["periodLengthREGULAR"])) error("Expected integer");
8086 retval.period_length_regular = json["periodLengthREGULAR"];
8187 retval.period_type = PerType_from_JSON(json["periodType"]);
88+ if (!intp(json["periodsMax"])) error("Expected integer");
8289 retval.periods_max = json["periodsMax"];
8390 foreach (json["scorers"]; mixed _; mixed value) if (!arrayp(value)) error("Expected array");
8491 retval.scorers = json["scorers"];
8592 retval.timeline = json["timeline"];
8693 retval.tm = json["tm"];
94+ if (!intp(json["totalTimeAdded"])) error("Expected integer");
8795 retval.total_time_added = json["totalTimeAdded"];
8896 retval.totallds = Totallds_from_JSON(json["totallds"]);
8997
@@ -146,13 +154,16 @@ Othermatch Othermatch_from_JSON(mixed json) {
146154 retval.clock = json["clock"];
147155 retval.competition_name = json["competitionName"];
148156 retval.id = json["id"];
157+ if (!intp(json["period"])) error("Expected integer");
149158 retval.period = json["period"];
150159 retval.period_type = PerType_from_JSON(json["periodType"]);
151160 retval.team1 = Team_from_JSON(json["team1"]);
152161 retval.team1_name = json["team1Name"];
162+ if (!intp(json["team1Score"])) error("Expected integer");
153163 retval.team1_score = json["team1Score"];
154164 retval.team2 = Team_from_JSON(json["team2"]);
155165 retval.team2_name = json["team2Name"];
166+ if (!intp(json["team2Score"])) error("Expected integer");
156167 retval.team2_score = json["team2Score"];
157168
158169 return retval;
@@ -266,19 +277,27 @@ Pbp Pbp_from_JSON(mixed json) {
266277 retval.international_family_name_initial = FamilyNameInitial_from_JSON(json["internationalFamilyNameInitial"]);
267278 retval.international_first_name = json["internationalFirstName"];
268279 retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]);
280+ if (!intp(json["lead"])) error("Expected integer");
269281 retval.lead = json["lead"];
282+ if (!intp(json["period"])) error("Expected integer");
270283 retval.period = json["period"];
271284 retval.period_type = PerType_from_JSON(json["periodType"]);
272285 retval.player = json["player"];
286+ if (!intp(json["pno"])) error("Expected integer");
273287 retval.pno = json["pno"];
274288 retval.qualifier = json["qualifier"];
289+ if (!intp(json["s1"])) error("Expected integer");
275290 retval.s1 = json["s1"];
291+ if (!intp(json["s2"])) error("Expected integer");
276292 retval.s2 = json["s2"];
277293 retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]);
294+ if (!intp(json["scoring"])) error("Expected integer");
278295 retval.scoring = json["scoring"];
279296 retval.shirt_number = json["shirtNumber"];
280297 retval.sub_type = json["subType"];
298+ if (!intp(json["success"])) error("Expected integer");
281299 retval.success = json["success"];
300+ if (!intp(json["tno"])) error("Expected integer");
282301 retval.tno = json["tno"];
283302
284303 return retval;
@@ -424,11 +443,13 @@ Scorer Scorer_from_JSON(mixed json) {
424443 retval.per = json["per"];
425444 retval.per_type = PerType_from_JSON(json["perType"]);
426445 retval.player = json["player"];
446+ if (!intp(json["pno"])) error("Expected integer");
427447 retval.pno = json["pno"];
428448 retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]);
429449 retval.shirt_number = json["shirtNumber"];
430450 retval.summary = json["summary"];
431451 retval.times = json["times"];
452+ if (!intp(json["tno"])) error("Expected integer");
432453 retval.tno = json["tno"];
433454 retval.tot = json["tot"];
434455
@@ -455,6 +476,7 @@ Time Time_from_JSON(mixed json) {
455476 Time retval = Time();
456477
457478 retval.gt = json["gt"];
479+ if (!intp(json["per"])) error("Expected integer");
458480 retval.per = json["per"];
459481 retval.per_type = PerType_from_JSON(json["perType"]);
460482
@@ -606,68 +628,120 @@ Tm Tm_from_JSON(mixed json) {
606628
607629 retval.code = json["code"];
608630 retval.code_international = json["codeInternational"];
631+ if (!intp(json["fouls"])) error("Expected integer");
609632 retval.fouls = json["fouls"];
633+ if (!intp(json["full_score"])) error("Expected integer");
610634 retval.full_score = json["full_score"];
611635 retval.lds = Lds_from_JSON(json["lds"]);
612636 retval.logo = json["logo"];
613637 retval.name = json["name"];
614638 retval.name_international = json["nameInternational"];
639+ if (!intp(json["p1_score"])) error("Expected integer");
615640 retval.p1_score = json["p1_score"];
641+ if (!intp(json["p2_score"])) error("Expected integer");
616642 retval.p2_score = json["p2_score"];
643+ if (!intp(json["p3_score"])) error("Expected integer");
617644 retval.p3_score = json["p3_score"];
645+ if (!intp(json["p4_score"])) error("Expected integer");
618646 retval.p4_score = json["p4_score"];
619647 retval.pl = json["pl"];
648+ if (!intp(json["score"])) error("Expected integer");
620649 retval.score = json["score"];
621650 retval.scoring = json["scoring"];
622651 retval.short_name = json["shortName"];
623652 retval.short_name_international = json["shortNameInternational"];
624653 retval.shot = json["shot"];
654+ if (!intp(json["timeouts"])) error("Expected integer");
625655 retval.timeouts = json["timeouts"];
656+ if (!intp(json["tot_eff_1"])) error("Expected integer");
626657 retval.tot_eff_1 = json["tot_eff_1"];
658+ if (!intp(json["tot_eff_2"])) error("Expected integer");
627659 retval.tot_eff_2 = json["tot_eff_2"];
628660 retval.tot_eff_3 = (float)json["tot_eff_3"];
661+ if (!intp(json["tot_eff_4"])) error("Expected integer");
629662 retval.tot_eff_4 = json["tot_eff_4"];
663+ if (!intp(json["tot_eff_5"])) error("Expected integer");
630664 retval.tot_eff_5 = json["tot_eff_5"];
665+ if (!intp(json["tot_eff_6"])) error("Expected integer");
631666 retval.tot_eff_6 = json["tot_eff_6"];
667+ if (!intp(json["tot_eff_7"])) error("Expected integer");
632668 retval.tot_eff_7 = json["tot_eff_7"];
669+ if (!intp(json["tot_sAssists"])) error("Expected integer");
633670 retval.tot_s_assists = json["tot_sAssists"];
671+ if (!intp(json["tot_sBenchPoints"])) error("Expected integer");
634672 retval.tot_s_bench_points = json["tot_sBenchPoints"];
673+ if (!intp(json["tot_sBiggestLead"])) error("Expected integer");
635674 retval.tot_s_biggest_lead = json["tot_sBiggestLead"];
675+ if (!intp(json["tot_sBiggestScoringRun"])) error("Expected integer");
636676 retval.tot_s_biggest_scoring_run = json["tot_sBiggestScoringRun"];
677+ if (!intp(json["tot_sBlocks"])) error("Expected integer");
637678 retval.tot_s_blocks = json["tot_sBlocks"];
679+ if (!intp(json["tot_sBlocksReceived"])) error("Expected integer");
638680 retval.tot_s_blocks_received = json["tot_sBlocksReceived"];
681+ if (!intp(json["tot_sFieldGoalsAttempted"])) error("Expected integer");
639682 retval.tot_s_field_goals_attempted = json["tot_sFieldGoalsAttempted"];
683+ if (!intp(json["tot_sFieldGoalsMade"])) error("Expected integer");
640684 retval.tot_s_field_goals_made = json["tot_sFieldGoalsMade"];
685+ if (!intp(json["tot_sFieldGoalsPercentage"])) error("Expected integer");
641686 retval.tot_s_field_goals_percentage = json["tot_sFieldGoalsPercentage"];
687+ if (!intp(json["tot_sFoulsOn"])) error("Expected integer");
642688 retval.tot_s_fouls_on = json["tot_sFoulsOn"];
689+ if (!intp(json["tot_sFoulsPersonal"])) error("Expected integer");
643690 retval.tot_s_fouls_personal = json["tot_sFoulsPersonal"];
691+ if (!intp(json["tot_sFoulsTeam"])) error("Expected integer");
644692 retval.tot_s_fouls_team = json["tot_sFoulsTeam"];
693+ if (!intp(json["tot_sFreeThrowsAttempted"])) error("Expected integer");
645694 retval.tot_s_free_throws_attempted = json["tot_sFreeThrowsAttempted"];
695+ if (!intp(json["tot_sFreeThrowsMade"])) error("Expected integer");
646696 retval.tot_s_free_throws_made = json["tot_sFreeThrowsMade"];
697+ if (!intp(json["tot_sFreeThrowsPercentage"])) error("Expected integer");
647698 retval.tot_s_free_throws_percentage = json["tot_sFreeThrowsPercentage"];
699+ if (!intp(json["tot_sLeadChanges"])) error("Expected integer");
648700 retval.tot_s_lead_changes = json["tot_sLeadChanges"];
701+ if (!intp(json["tot_sMinutes"])) error("Expected integer");
649702 retval.tot_s_minutes = json["tot_sMinutes"];
703+ if (!intp(json["tot_sPoints"])) error("Expected integer");
650704 retval.tot_s_points = json["tot_sPoints"];
705+ if (!intp(json["tot_sPointsFastBreak"])) error("Expected integer");
651706 retval.tot_s_points_fast_break = json["tot_sPointsFastBreak"];
707+ if (!intp(json["tot_sPointsFromTurnovers"])) error("Expected integer");
652708 retval.tot_s_points_from_turnovers = json["tot_sPointsFromTurnovers"];
709+ if (!intp(json["tot_sPointsInThePaint"])) error("Expected integer");
653710 retval.tot_s_points_in_the_paint = json["tot_sPointsInThePaint"];
711+ if (!intp(json["tot_sPointsSecondChance"])) error("Expected integer");
654712 retval.tot_s_points_second_chance = json["tot_sPointsSecondChance"];
713+ if (!intp(json["tot_sReboundsDefensive"])) error("Expected integer");
655714 retval.tot_s_rebounds_defensive = json["tot_sReboundsDefensive"];
715+ if (!intp(json["tot_sReboundsOffensive"])) error("Expected integer");
656716 retval.tot_s_rebounds_offensive = json["tot_sReboundsOffensive"];
717+ if (!intp(json["tot_sReboundsTeam"])) error("Expected integer");
657718 retval.tot_s_rebounds_team = json["tot_sReboundsTeam"];
719+ if (!intp(json["tot_sReboundsTeamDefensive"])) error("Expected integer");
658720 retval.tot_s_rebounds_team_defensive = json["tot_sReboundsTeamDefensive"];
721+ if (!intp(json["tot_sReboundsTeamOffensive"])) error("Expected integer");
659722 retval.tot_s_rebounds_team_offensive = json["tot_sReboundsTeamOffensive"];
723+ if (!intp(json["tot_sReboundsTotal"])) error("Expected integer");
660724 retval.tot_s_rebounds_total = json["tot_sReboundsTotal"];
725+ if (!intp(json["tot_sSteals"])) error("Expected integer");
661726 retval.tot_s_steals = json["tot_sSteals"];
727+ if (!intp(json["tot_sThreePointersAttempted"])) error("Expected integer");
662728 retval.tot_s_three_pointers_attempted = json["tot_sThreePointersAttempted"];
729+ if (!intp(json["tot_sThreePointersMade"])) error("Expected integer");
663730 retval.tot_s_three_pointers_made = json["tot_sThreePointersMade"];
731+ if (!intp(json["tot_sThreePointersPercentage"])) error("Expected integer");
664732 retval.tot_s_three_pointers_percentage = json["tot_sThreePointersPercentage"];
665733 retval.tot_s_time_leading = (float)json["tot_sTimeLeading"];
734+ if (!intp(json["tot_sTimesScoresLevel"])) error("Expected integer");
666735 retval.tot_s_times_scores_level = json["tot_sTimesScoresLevel"];
736+ if (!intp(json["tot_sTurnovers"])) error("Expected integer");
667737 retval.tot_s_turnovers = json["tot_sTurnovers"];
738+ if (!intp(json["tot_sTurnoversTeam"])) error("Expected integer");
668739 retval.tot_s_turnovers_team = json["tot_sTurnoversTeam"];
740+ if (!intp(json["tot_sTwoPointersAttempted"])) error("Expected integer");
669741 retval.tot_s_two_pointers_attempted = json["tot_sTwoPointersAttempted"];
742+ if (!intp(json["tot_sTwoPointersMade"])) error("Expected integer");
670743 retval.tot_s_two_pointers_made = json["tot_sTwoPointersMade"];
744+ if (!intp(json["tot_sTwoPointersPercentage"])) error("Expected integer");
671745 retval.tot_s_two_pointers_percentage = json["tot_sTwoPointersPercentage"];
672746
673747 return retval;
@@ -838,15 +912,21 @@ class Pl {
838912 Pl Pl_from_JSON(mixed json) {
839913 Pl retval = Pl();
840914
915+ if (!intp(json["active"])) error("Expected integer");
841916 retval.active = json["active"];
842917 retval.captain = json["captain"];
843918 retval.comp = json["comp"] == Val.null ? Val.null : Comp_from_JSON(json["comp"]);
919+ if (!intp(json["eff_1"])) error("Expected integer");
844920 retval.eff_1 = json["eff_1"];
921+ if (!intp(json["eff_2"])) error("Expected integer");
845922 retval.eff_2 = json["eff_2"];
846923 retval.eff_3 = (float)json["eff_3"];
847924 retval.eff_4 = (float)json["eff_4"];
925+ if (!intp(json["eff_5"])) error("Expected integer");
848926 retval.eff_5 = json["eff_5"];
927+ if (!intp(json["eff_6"])) error("Expected integer");
849928 retval.eff_6 = json["eff_6"];
929+ if (!intp(json["eff_7"])) error("Expected integer");
850930 retval.eff_7 = json["eff_7"];
851931 retval.family_name = json["familyName"];
852932 retval.family_name_initial = FamilyNameInitial_from_JSON(json["familyNameInitial"]);
@@ -858,36 +938,64 @@ Pl Pl_from_JSON(mixed json) {
858938 retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]);
859939 retval.name = json["name"];
860940 retval.playing_position = json["playingPosition"];
941+ if (!intp(json["sAssists"])) error("Expected integer");
861942 retval.s_assists = json["sAssists"];
943+ if (!intp(json["sBlocks"])) error("Expected integer");
862944 retval.s_blocks = json["sBlocks"];
945+ if (!intp(json["sBlocksReceived"])) error("Expected integer");
863946 retval.s_blocks_received = json["sBlocksReceived"];
947+ if (!intp(json["sFieldGoalsAttempted"])) error("Expected integer");
864948 retval.s_field_goals_attempted = json["sFieldGoalsAttempted"];
949+ if (!intp(json["sFieldGoalsMade"])) error("Expected integer");
865950 retval.s_field_goals_made = json["sFieldGoalsMade"];
951+ if (!intp(json["sFieldGoalsPercentage"])) error("Expected integer");
866952 retval.s_field_goals_percentage = json["sFieldGoalsPercentage"];
953+ if (!intp(json["sFoulsOn"])) error("Expected integer");
867954 retval.s_fouls_on = json["sFoulsOn"];
955+ if (!intp(json["sFoulsPersonal"])) error("Expected integer");
868956 retval.s_fouls_personal = json["sFoulsPersonal"];
957+ if (!intp(json["sFreeThrowsAttempted"])) error("Expected integer");
869958 retval.s_free_throws_attempted = json["sFreeThrowsAttempted"];
959+ if (!intp(json["sFreeThrowsMade"])) error("Expected integer");
870960 retval.s_free_throws_made = json["sFreeThrowsMade"];
961+ if (!intp(json["sFreeThrowsPercentage"])) error("Expected integer");
871962 retval.s_free_throws_percentage = json["sFreeThrowsPercentage"];
872963 if (arrayp(json["sMinutes"])) error("Unexpected array");
873964 retval.s_minutes = json["sMinutes"];
965+ if (!intp(json["sPlusMinusPoints"])) error("Expected integer");
874966 retval.s_plus_minus_points = json["sPlusMinusPoints"];
967+ if (!intp(json["sPoints"])) error("Expected integer");
875968 retval.s_points = json["sPoints"];
969+ if (!intp(json["sPointsFastBreak"])) error("Expected integer");
876970 retval.s_points_fast_break = json["sPointsFastBreak"];
971+ if (!intp(json["sPointsInThePaint"])) error("Expected integer");
877972 retval.s_points_in_the_paint = json["sPointsInThePaint"];
973+ if (!intp(json["sPointsSecondChance"])) error("Expected integer");
878974 retval.s_points_second_chance = json["sPointsSecondChance"];
975+ if (!intp(json["sReboundsDefensive"])) error("Expected integer");
879976 retval.s_rebounds_defensive = json["sReboundsDefensive"];
977+ if (!intp(json["sReboundsOffensive"])) error("Expected integer");
880978 retval.s_rebounds_offensive = json["sReboundsOffensive"];
979+ if (!intp(json["sReboundsTotal"])) error("Expected integer");
881980 retval.s_rebounds_total = json["sReboundsTotal"];
981+ if (!intp(json["sSteals"])) error("Expected integer");
882982 retval.s_steals = json["sSteals"];
983+ if (!intp(json["sThreePointersAttempted"])) error("Expected integer");
883984 retval.s_three_pointers_attempted = json["sThreePointersAttempted"];
985+ if (!intp(json["sThreePointersMade"])) error("Expected integer");
884986 retval.s_three_pointers_made = json["sThreePointersMade"];
987+ if (!intp(json["sThreePointersPercentage"])) error("Expected integer");
885988 retval.s_three_pointers_percentage = json["sThreePointersPercentage"];
989+ if (!intp(json["sTurnovers"])) error("Expected integer");
886990 retval.s_turnovers = json["sTurnovers"];
991+ if (!intp(json["sTwoPointersAttempted"])) error("Expected integer");
887992 retval.s_two_pointers_attempted = json["sTwoPointersAttempted"];
993+ if (!intp(json["sTwoPointersMade"])) error("Expected integer");
888994 retval.s_two_pointers_made = json["sTwoPointersMade"];
995+ if (!intp(json["sTwoPointersPercentage"])) error("Expected integer");
889996 retval.s_two_pointers_percentage = json["sTwoPointersPercentage"];
890997 retval.shirt_number = json["shirtNumber"];
998+ if (!intp(json["starter"])) error("Expected integer");
891999 retval.starter = json["starter"];
8921000
8931001 return retval;
@@ -966,16 +1074,23 @@ Shot Shot_from_JSON(mixed json) {
9661074 Shot retval = Shot();
9671075
9681076 retval.action_type = ActionType_from_JSON(json["actionType"]);
1077+ if (!intp(json["p"])) error("Expected integer");
9691078 retval.p = json["p"];
1079+ if (!intp(json["per"])) error("Expected integer");
9701080 retval.per = json["per"];
9711081 retval.per_type = PerType_from_JSON(json["perType"]);
9721082 retval.player = json["player"];
1083+ if (!intp(json["pno"])) error("Expected integer");
9731084 retval.pno = json["pno"];
1085+ if (!intp(json["r"])) error("Expected integer");
9741086 retval.r = json["r"];
9751087 retval.shirt_number = json["shirtNumber"];
9761088 retval.sub_type = SubType_from_JSON(json["subType"]);
1089+ if (!intp(json["tno"])) error("Expected integer");
9771090 retval.tno = json["tno"];
1091+ if (!intp(json["x"])) error("Expected integer");
9781092 retval.x = json["x"];
1093+ if (!intp(json["y"])) error("Expected integer");
9791094 retval.y = json["y"];
9801095
9811096 return retval;
Test case

test/inputs/json/priority/nst-test-suite.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -296,6 +296,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
296296 retval.y_string_with_del_character_json = json["y_string_with_del_character.json"];
297297 if (json["y_structure_lonely_false.json"] != Standards.JSON.true && json["y_structure_lonely_false.json"] != Standards.JSON.false) error("Expected bool");
298298 retval.y_structure_lonely_false_json = json["y_structure_lonely_false.json"];
299+ if (!intp(json["y_structure_lonely_int.json"])) error("Expected integer");
299300 retval.y_structure_lonely_int_json = json["y_structure_lonely_int.json"];
300301 retval.y_structure_lonely_negative_real_json = (float)json["y_structure_lonely_negative_real.json"];
301302 retval.y_structure_lonely_null_json = json["y_structure_lonely_null.json"];
@@ -367,6 +368,7 @@ class YObjectEmptyKeyJson {
367368 YObjectEmptyKeyJson YObjectEmptyKeyJson_from_JSON(mixed json) {
368369 YObjectEmptyKeyJson retval = YObjectEmptyKeyJson();
369370
371+ if (!intp(json[""])) error("Expected integer");
370372 retval.empty = json[""];
371373
372374 return retval;
@@ -387,6 +389,7 @@ class YObjectEscapedNullInKeyJson {
387389 YObjectEscapedNullInKeyJson YObjectEscapedNullInKeyJson_from_JSON(mixed json) {
388390 YObjectEscapedNullInKeyJson retval = YObjectEscapedNullInKeyJson();
389391
392+ if (!intp(json["foo\u0000bar"])) error("Expected integer");
390393 retval.foo_bar = json["foo\u0000bar"];
391394
392395 return retval;
Test case

test/inputs/json/priority/omit-empty.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -49,6 +49,7 @@ class Result {
4949 Result Result_from_JSON(mixed json) {
5050 Result retval = Result();
5151
52+ if (!intp(json["age"])) error("Expected integer");
5253 retval.age = json["age"];
5354 retval.name = json["name"];
Test case

test/inputs/json/priority/php-validation.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -37,6 +37,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3737
3838 if (json["boolean"] != Standards.JSON.true && json["boolean"] != Standards.JSON.false) error("Expected bool");
3939 retval.boolean = json["boolean"];
40+ if (!intp(json["integer"])) error("Expected integer");
4041 retval.integer = json["integer"];
4142 retval.integers = json["integers"];
4243 retval.number = (float)json["number"];
Test case

test/inputs/json/priority/recursive.json

1 generated file · +26 −0
Mpikedefault / TopLevel.pmod+26 −0
@@ -48,13 +48,18 @@ TopLevel TopLevel_from_JSON(mixed json) {
4848 retval.category = Category_from_JSON(json["category"]);
4949 retval.details = Details_from_JSON(json["details"]);
5050 retval.match = json["match"];
51+ if (!intp(json["page"])) error("Expected integer");
5152 retval.page = json["page"];
5253 retval.product = json["product"];
5354 if (json["schk"] != Standards.JSON.true && json["schk"] != Standards.JSON.false) error("Expected bool");
5455 retval.schk = json["schk"];
56+ if (!intp(json["totallooseoffers"])) error("Expected integer");
5557 retval.totallooseoffers = json["totallooseoffers"];
58+ if (!intp(json["totalpages"])) error("Expected integer");
5659 retval.totalpages = json["totalpages"];
60+ if (!intp(json["totalresultsavailable"])) error("Expected integer");
5761 retval.totalresultsavailable = json["totalresultsavailable"];
62+ if (!intp(json["totalresultsreturned"])) error("Expected integer");
5863 retval.totalresultsreturned = json["totalresultsreturned"];
5964
6065 return retval;
@@ -93,11 +98,13 @@ Category Category_from_JSON(mixed json) {
9398 retval.concatenatecategoryname = json["concatenatecategoryname"];
9499 if (json["hasoffer"] != Standards.JSON.true && json["hasoffer"] != Standards.JSON.false) error("Expected bool");
95100 retval.hasoffer = json["hasoffer"];
101+ if (!intp(json["id"])) error("Expected integer");
96102 retval.id = json["id"];
97103 if (json["isfinal"] != Standards.JSON.true && json["isfinal"] != Standards.JSON.false) error("Expected bool");
98104 retval.isfinal = json["isfinal"];
99105 retval.links = json["links"];
100106 retval.name = json["name"];
107+ if (!intp(json["parentcategoryid"])) error("Expected integer");
101108 retval.parentcategoryid = json["parentcategoryid"];
102109 retval.thumbnail = CategoryThumbnail_from_JSON(json["thumbnail"]);
103110
@@ -196,8 +203,10 @@ Details Details_from_JSON(mixed json) {
196203
197204 retval.applicationid = json["applicationid"];
198205 retval.applicationversion = json["applicationversion"];
206+ if (!intp(json["code"])) error("Expected integer");
199207 retval.code = json["code"];
200208 retval.date = Date_from_JSON(json["date"]);
209+ if (!intp(json["elapsedtime"])) error("Expected integer");
201210 retval.elapsedtime = json["elapsedtime"];
202211 retval.message = json["message"];
203212 retval.status = json["status"];
@@ -240,17 +249,25 @@ class Date {
240249 Date Date_from_JSON(mixed json) {
241250 Date retval = Date();
242251
252+ if (!intp(json["day"])) error("Expected integer");
243253 retval.day = json["day"];
244254 retval.eonandyear = Eonandyear_from_JSON(json["eonandyear"]);
255+ if (!intp(json["hour"])) error("Expected integer");
245256 retval.hour = json["hour"];
257+ if (!intp(json["millisecond"])) error("Expected integer");
246258 retval.millisecond = json["millisecond"];
259+ if (!intp(json["minute"])) error("Expected integer");
247260 retval.minute = json["minute"];
261+ if (!intp(json["month"])) error("Expected integer");
248262 retval.month = json["month"];
263+ if (!intp(json["second"])) error("Expected integer");
249264 retval.second = json["second"];
265+ if (!intp(json["timezone"])) error("Expected integer");
250266 retval.timezone = json["timezone"];
251267 if (json["valid"] != Standards.JSON.true && json["valid"] != Standards.JSON.false) error("Expected bool");
252268 retval.valid = json["valid"];
253269 retval.xmlschematype = Xmlschematype_from_JSON(json["xmlschematype"]);
270+ if (!intp(json["year"])) error("Expected integer");
254271 retval.year = json["year"];
255272
256273 return retval;
@@ -271,6 +288,7 @@ class Eonandyear {
271288 Eonandyear Eonandyear_from_JSON(mixed json) {
272289 Eonandyear retval = Eonandyear();
273290
291+ if (!intp(json["lowestsetbit"])) error("Expected integer");
274292 retval.lowestsetbit = json["lowestsetbit"];
275293
276294 return retval;
@@ -367,6 +385,7 @@ class ProductProduct {
367385 ProductProduct ProductProduct_from_JSON(mixed json) {
368386 ProductProduct retval = ProductProduct();
369387
388+ if (!intp(json["categoryid"])) error("Expected integer");
370389 retval.categoryid = json["categoryid"];
371390 retval.currency = Currency_from_JSON(json["currency"]);
372391 if (json["eco"] != Standards.JSON.true && json["eco"] != Standards.JSON.false) error("Expected bool");
@@ -375,16 +394,20 @@ ProductProduct ProductProduct_from_JSON(mixed json) {
375394 retval.fulldescription = json["fulldescription"];
376395 if (json["hasmetasearch"] != Standards.JSON.true && json["hasmetasearch"] != Standards.JSON.false) error("Expected bool");
377396 retval.hasmetasearch = json["hasmetasearch"];
397+ if (!intp(json["id"])) error("Expected integer");
378398 retval.id = json["id"];
379399 retval.links = json["links"];
400+ if (!intp(json["numoffers"])) error("Expected integer");
380401 retval.numoffers = json["numoffers"];
381402 retval.pricemax = json["pricemax"];
382403 retval.pricemin = json["pricemin"];
383404 retval.productname = json["productname"];
405+ if (!intp(json["quantity"])) error("Expected integer");
384406 retval.quantity = json["quantity"];
385407 retval.rating = Rating_from_JSON(json["rating"]);
386408 retval.specification = Specification_from_JSON(json["specification"]);
387409 retval.thumbnail = FormatsClass_from_JSON(json["thumbnail"]);
410+ if (!intp(json["totalsellers"])) error("Expected integer");
388411 retval.totalsellers = json["totalsellers"];
389412
390413 return retval;
@@ -450,6 +473,7 @@ Useraveragerating Useraveragerating_from_JSON(mixed json) {
450473 Useraveragerating retval = Useraveragerating();
451474
452475 retval.links = json["links"];
476+ if (!intp(json["numcomments"])) error("Expected integer");
453477 retval.numcomments = json["numcomments"];
454478 retval.rating = json["rating"];
455479
@@ -518,8 +542,10 @@ FormatsClass FormatsClass_from_JSON(mixed json) {
518542 FormatsClass retval = FormatsClass();
519543
520544 retval.formats = json["formats"];
545+ if (!intp(json["height"])) error("Expected integer");
521546 retval.height = json["height"];
522547 retval.url = json["url"];
548+ if (!intp(json["width"])) error("Expected integer");
523549 retval.width = json["width"];
524550
525551 return retval;
Test case

test/inputs/json/priority/uuids.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -40,6 +40,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
4040 if (json["booleanValue"] != Standards.JSON.true && json["booleanValue"] != Standards.JSON.false) error("Expected bool");
4141 retval.boolean_value = json["booleanValue"];
4242 retval.double_value = (float)json["doubleValue"];
43+ if (!intp(json["intValue"])) error("Expected integer");
4344 retval.int_value = json["intValue"];
4445 retval.string_value = json["stringValue"];
4546 retval.uuid_value = json["uuidValue"];
Test case

test/inputs/json/samples/bitcoin-block.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -35,9 +35,12 @@ class TopLevel {
3535 TopLevel TopLevel_from_JSON(mixed json) {
3636 TopLevel retval = TopLevel();
3737
38+ if (!intp(json["block_index"])) error("Expected integer");
3839 retval.block_index = json["block_index"];
3940 retval.hash = json["hash"];
41+ if (!intp(json["height"])) error("Expected integer");
4042 retval.height = json["height"];
43+ if (!intp(json["time"])) error("Expected integer");
4144 retval.time = json["time"];
4245 retval.tx_indexes = json["txIndexes"];
Test case

test/inputs/json/samples/github-events.json

1 generated file · +29 −0
Mpikedefault / TopLevel.pmod+29 −0
@@ -88,6 +88,7 @@ Actor Actor_from_JSON(mixed json) {
8888 retval.avatar_url = json["avatar_url"];
8989 retval.display_login = json["display_login"];
9090 retval.gravatar_id = json["gravatar_id"];
91+ if (!intp(json["id"])) error("Expected integer");
9192 retval.id = json["id"];
9293 retval.login = json["login"];
9394 retval.url = json["url"];
@@ -192,6 +193,7 @@ Comment Comment_from_JSON(mixed json) {
192193 retval.body = json["body"];
193194 retval.created_at = json["created_at"];
194195 retval.html_url = json["html_url"];
196+ if (!intp(json["id"])) error("Expected integer");
195197 retval.id = json["id"];
196198 retval.issue_url = json["issue_url"];
197199 retval.updated_at = json["updated_at"];
@@ -255,6 +257,7 @@ User User_from_JSON(mixed json) {
255257 retval.gists_url = json["gists_url"];
256258 retval.gravatar_id = json["gravatar_id"];
257259 retval.html_url = json["html_url"];
260+ if (!intp(json["id"])) error("Expected integer");
258261 retval.id = json["id"];
259262 retval.login = json["login"];
260263 retval.organizations_url = json["organizations_url"];
@@ -397,11 +400,13 @@ Issue Issue_from_JSON(mixed json) {
397400 retval.body = json["body"];
398401 if (!has_index(json, "closed_at")) error("Missing required property");
399402 retval.closed_at = json["closed_at"];
403+ if (!intp(json["comments"])) error("Expected integer");
400404 retval.comments = json["comments"];
401405 retval.comments_url = json["comments_url"];
402406 retval.created_at = json["created_at"];
403407 retval.events_url = json["events_url"];
404408 retval.html_url = json["html_url"];
409+ if (!intp(json["id"])) error("Expected integer");
405410 retval.id = json["id"];
406411 retval.labels = json["labels"];
407412 retval.labels_url = json["labels_url"];
@@ -409,6 +414,7 @@ Issue Issue_from_JSON(mixed json) {
409414 retval.locked = json["locked"];
410415 if (!has_index(json, "milestone")) error("Missing required property");
411416 retval.milestone = json["milestone"] == Val.null ? Val.null : Milestone_from_JSON(json["milestone"]);
417+ if (!intp(json["number"])) error("Expected integer");
412418 retval.number = json["number"];
413419 retval.pull_request = json["pull_request"] == Val.null ? Val.null : IssuePullRequest_from_JSON(json["pull_request"]);
414420 retval.repository_url = json["repository_url"];
@@ -445,6 +451,7 @@ Label Label_from_JSON(mixed json) {
445451 Label retval = Label();
446452
447453 retval.color = json["color"];
454+ if (!intp(json["id"])) error("Expected integer");
448455 retval.id = json["id"];
449456 if (json["default"] != Standards.JSON.true && json["default"] != Standards.JSON.false) error("Expected bool");
450457 retval.label_default = json["default"];
@@ -498,6 +505,7 @@ Milestone Milestone_from_JSON(mixed json) {
498505 Milestone retval = Milestone();
499506
500507 retval.closed_at = json["closed_at"];
508+ if (!intp(json["closed_issues"])) error("Expected integer");
501509 retval.closed_issues = json["closed_issues"];
502510 retval.created_at = json["created_at"];
503511 retval.creator = User_from_JSON(json["creator"]);
@@ -505,9 +513,12 @@ Milestone Milestone_from_JSON(mixed json) {
505513 if (!has_index(json, "due_on")) error("Missing required property");
506514 retval.due_on = json["due_on"];
507515 retval.html_url = json["html_url"];
516+ if (!intp(json["id"])) error("Expected integer");
508517 retval.id = json["id"];
509518 retval.labels_url = json["labels_url"];
519+ if (!intp(json["number"])) error("Expected integer");
510520 retval.number = json["number"];
521+ if (!intp(json["open_issues"])) error("Expected integer");
511522 retval.open_issues = json["open_issues"];
512523 retval.state = json["state"];
513524 retval.title = json["title"];
@@ -641,22 +652,28 @@ class PayloadPullRequest {
641652 PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) {
642653 PayloadPullRequest retval = PayloadPullRequest();
643654
655+ if (!intp(json["additions"])) error("Expected integer");
644656 retval.additions = json["additions"];
645657 retval.assignee = json["assignee"];
646658 retval.assignees = json["assignees"];
647659 retval.base = Base_from_JSON(json["base"]);
648660 retval.body = json["body"];
661+ if (!intp(json["changed_files"])) error("Expected integer");
649662 retval.changed_files = json["changed_files"];
650663 retval.closed_at = json["closed_at"];
664+ if (!intp(json["comments"])) error("Expected integer");
651665 retval.comments = json["comments"];
652666 retval.comments_url = json["comments_url"];
667+ if (!intp(json["commits"])) error("Expected integer");
653668 retval.commits = json["commits"];
654669 retval.commits_url = json["commits_url"];
655670 retval.created_at = json["created_at"];
671+ if (!intp(json["deletions"])) error("Expected integer");
656672 retval.deletions = json["deletions"];
657673 retval.diff_url = json["diff_url"];
658674 retval.head = Base_from_JSON(json["head"]);
659675 retval.html_url = json["html_url"];
676+ if (!intp(json["id"])) error("Expected integer");
660677 retval.id = json["id"];
661678 retval.issue_url = json["issue_url"];
662679 retval.links = Links_from_JSON(json["_links"]);
@@ -672,11 +689,13 @@ PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) {
672689 retval.merged_at = json["merged_at"];
673690 retval.merged_by = User_from_JSON(json["merged_by"]);
674691 retval.milestone = json["milestone"];
692+ if (!intp(json["number"])) error("Expected integer");
675693 retval.number = json["number"];
676694 retval.patch_url = json["patch_url"];
677695 retval.rebaseable = json["rebaseable"];
678696 retval.requested_reviewers = json["requested_reviewers"];
679697 retval.review_comment_url = json["review_comment_url"];
698+ if (!intp(json["review_comments"])) error("Expected integer");
680699 retval.review_comments = json["review_comments"];
681700 retval.review_comments_url = json["review_comments_url"];
682701 retval.state = json["state"];
@@ -891,7 +910,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
891910 retval.events_url = json["events_url"];
892911 if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool");
893912 retval.fork = json["fork"];
913+ if (!intp(json["forks"])) error("Expected integer");
894914 retval.forks = json["forks"];
915+ if (!intp(json["forks_count"])) error("Expected integer");
895916 retval.forks_count = json["forks_count"];
896917 retval.forks_url = json["forks_url"];
897918 retval.full_name = json["full_name"];
@@ -912,6 +933,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
912933 retval.homepage = json["homepage"];
913934 retval.hooks_url = json["hooks_url"];
914935 retval.html_url = json["html_url"];
936+ if (!intp(json["id"])) error("Expected integer");
915937 retval.id = json["id"];
916938 retval.issue_comment_url = json["issue_comment_url"];
917939 retval.issue_events_url = json["issue_events_url"];
@@ -925,7 +947,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
925947 retval.mirror_url = json["mirror_url"];
926948 retval.name = json["name"];
927949 retval.notifications_url = json["notifications_url"];
950+ if (!intp(json["open_issues"])) error("Expected integer");
928951 retval.open_issues = json["open_issues"];
952+ if (!intp(json["open_issues_count"])) error("Expected integer");
929953 retval.open_issues_count = json["open_issues_count"];
930954 retval.owner = User_from_JSON(json["owner"]);
931955 retval.pulls_url = json["pulls_url"];
@@ -933,8 +957,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
933957 retval.releases_url = json["releases_url"];
934958 if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool");
935959 retval.repo_private = json["private"];
960+ if (!intp(json["size"])) error("Expected integer");
936961 retval.size = json["size"];
937962 retval.ssh_url = json["ssh_url"];
963+ if (!intp(json["stargazers_count"])) error("Expected integer");
938964 retval.stargazers_count = json["stargazers_count"];
939965 retval.stargazers_url = json["stargazers_url"];
940966 retval.statuses_url = json["statuses_url"];
@@ -946,7 +972,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
946972 retval.trees_url = json["trees_url"];
947973 retval.updated_at = json["updated_at"];
948974 retval.url = json["url"];
975+ if (!intp(json["watchers"])) error("Expected integer");
949976 retval.watchers = json["watchers"];
977+ if (!intp(json["watchers_count"])) error("Expected integer");
950978 retval.watchers_count = json["watchers_count"];
951979
952980 return retval;
@@ -1032,6 +1060,7 @@ class TopLevelRepo {
10321060 TopLevelRepo TopLevelRepo_from_JSON(mixed json) {
10331061 TopLevelRepo retval = TopLevelRepo();
10341062
1063+ if (!intp(json["id"])) error("Expected integer");
10351064 retval.id = json["id"];
10361065 retval.name = json["name"];
10371066 retval.url = json["url"];
Test case

test/inputs/json/samples/kitchen-sink.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -58,6 +58,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
5858 retval.date_value = json["dateValue"];
5959 retval.different_things = json["differentThings"];
6060 retval.double_value = (float)json["doubleValue"];
61+ if (!intp(json["intValue"])) error("Expected integer");
6162 retval.int_value = json["intValue"];
6263 foreach (json["mapValue"]; mixed _; mixed value) if (stringp(value)) error("Unexpected string");
6364 retval.map_value = json["mapValue"];
@@ -150,6 +151,7 @@ class PurplePerson {
150151 PurplePerson PurplePerson_from_JSON(mixed json) {
151152 PurplePerson retval = PurplePerson();
152153
154+ if (!intp(json["intOrString"])) error("Expected integer");
153155 retval.int_or_string = json["intOrString"];
154156 retval.name = json["name"];
Test case

test/inputs/json/samples/null-safe.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -56,6 +56,7 @@ Item Item_from_JSON(mixed json) {
5656 retval.address = json["address"] == Val.null ? Val.null : Address_from_JSON(json["address"]);
5757 retval.created_at = json["created_at"];
5858 retval.name = json["name"];
59+ if (!intp(json["sex"])) error("Expected integer");
5960 if (!has_index(json, "sex")) error("Missing required property");
6061 retval.sex = json["sex"];
Test case

test/inputs/json/samples/pokedex.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -84,6 +84,7 @@ Pokemon Pokemon_from_JSON(mixed json) {
8484 retval.candy_count = json["candy_count"];
8585 retval.egg = Egg_from_JSON(json["egg"]);
8686 retval.height = json["height"];
87+ if (!intp(json["id"])) error("Expected integer");
8788 retval.id = json["id"];
8889 retval.img = json["img"];
8990 if (!has_index(json, "multipliers")) error("Missing required property");
Test case

test/inputs/json/samples/reddit.json

1 generated file · +11 −0
Mpikedefault / TopLevel.pmod+11 −0
@@ -253,14 +253,18 @@ ChildData ChildData_from_JSON(mixed json) {
253253 retval.clicked = json["clicked"];
254254 if (json["contest_mode"] != Standards.JSON.true && json["contest_mode"] != Standards.JSON.false) error("Expected bool");
255255 retval.contest_mode = json["contest_mode"];
256+ if (!intp(json["created"])) error("Expected integer");
256257 retval.created = json["created"];
258+ if (!intp(json["created_utc"])) error("Expected integer");
257259 retval.created_utc = json["created_utc"];
258260 if (!has_index(json, "distinguished")) error("Missing required property");
259261 retval.distinguished = json["distinguished"];
260262 retval.domain = Domain_from_JSON(json["domain"]);
263+ if (!intp(json["downs"])) error("Expected integer");
261264 retval.downs = json["downs"];
262265 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
263266 retval.edited = json["edited"];
267+ if (!intp(json["gilded"])) error("Expected integer");
264268 retval.gilded = json["gilded"];
265269 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
266270 retval.hidden = json["hidden"];
@@ -282,6 +286,7 @@ ChildData ChildData_from_JSON(mixed json) {
282286 retval.media_embed = MediaEmbed_from_JSON(json["media_embed"]);
283287 retval.mod_reports = json["mod_reports"];
284288 retval.name = json["name"];
289+ if (!intp(json["num_comments"])) error("Expected integer");
285290 retval.num_comments = json["num_comments"];
286291 retval.num_reports = json["num_reports"];
287292 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) {
296301 retval.report_reasons = json["report_reasons"];
297302 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
298303 retval.saved = json["saved"];
304+ if (!intp(json["score"])) error("Expected integer");
299305 retval.score = json["score"];
300306 retval.secure_media = json["secure_media"];
301307 retval.secure_media_embed = MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -311,9 +317,12 @@ ChildData ChildData_from_JSON(mixed json) {
311317 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
312318 retval.suggested_sort = json["suggested_sort"];
313319 retval.thumbnail = json["thumbnail"];
320+ if (!intp(json["thumbnail_height"])) error("Expected integer");
314321 retval.thumbnail_height = json["thumbnail_height"];
322+ if (!intp(json["thumbnail_width"])) error("Expected integer");
315323 retval.thumbnail_width = json["thumbnail_width"];
316324 retval.title = json["title"];
325+ if (!intp(json["ups"])) error("Expected integer");
317326 retval.ups = json["ups"];
318327 retval.url = json["url"];
319328 retval.user_reports = json["user_reports"];
@@ -441,8 +450,10 @@ class Source {
441450 Source Source_from_JSON(mixed json) {
442451 Source retval = Source();
443452
453+ if (!intp(json["height"])) error("Expected integer");
444454 retval.height = json["height"];
445455 retval.url = json["url"];
456+ if (!intp(json["width"])) error("Expected integer");
446457 retval.width = json["width"];
447458
448459 return retval;
Test case

test/inputs/json/samples/simple-object.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -31,6 +31,7 @@ class TopLevel {
3131 TopLevel TopLevel_from_JSON(mixed json) {
3232 TopLevel retval = TopLevel();
3333
34+ if (!intp(json["date"])) error("Expected integer");
3435 retval.date = json["date"];
3536 retval.title = json["title"];
3637 if (json["validity"] != Standards.JSON.true && json["validity"] != Standards.JSON.false) error("Expected bool");
Test case

test/inputs/json/samples/spotify-album.json

1 generated file · +9 −0
Mpikedefault / TopLevel.pmod+9 −0
@@ -70,6 +70,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
7070 retval.id = json["id"];
7171 retval.images = json["images"];
7272 retval.name = json["name"];
73+ if (!intp(json["popularity"])) error("Expected integer");
7374 retval.popularity = json["popularity"];
7475 retval.release_date = json["release_date"];
7576 retval.release_date_precision = json["release_date_precision"];
@@ -197,8 +198,10 @@ class Image {
197198 Image Image_from_JSON(mixed json) {
198199 Image retval = Image();
199200
201+ if (!intp(json["height"])) error("Expected integer");
200202 retval.height = json["height"];
201203 retval.url = json["url"];
204+ if (!intp(json["width"])) error("Expected integer");
202205 retval.width = json["width"];
203206
204207 return retval;
@@ -233,10 +236,13 @@ Tracks Tracks_from_JSON(mixed json) {
233236
234237 retval.href = json["href"];
235238 retval.items = json["items"];
239+ if (!intp(json["limit"])) error("Expected integer");
236240 retval.limit = json["limit"];
237241 retval.next = json["next"];
242+ if (!intp(json["offset"])) error("Expected integer");
238243 retval.offset = json["offset"];
239244 retval.previous = json["previous"];
245+ if (!intp(json["total"])) error("Expected integer");
240246 retval.total = json["total"];
241247
242248 return retval;
@@ -283,7 +289,9 @@ Item Item_from_JSON(mixed json) {
283289
284290 retval.artists = json["artists"];
285291 retval.available_markets = json["available_markets"];
292+ if (!intp(json["disc_number"])) error("Expected integer");
286293 retval.disc_number = json["disc_number"];
294+ if (!intp(json["duration_ms"])) error("Expected integer");
287295 retval.duration_ms = json["duration_ms"];
288296 if (json["explicit"] != Standards.JSON.true && json["explicit"] != Standards.JSON.false) error("Expected bool");
289297 retval.explicit = json["explicit"];
@@ -292,6 +300,7 @@ Item Item_from_JSON(mixed json) {
292300 retval.id = json["id"];
293301 retval.name = json["name"];
294302 retval.preview_url = json["preview_url"];
303+ if (!intp(json["track_number"])) error("Expected integer");
295304 retval.track_number = json["track_number"];
296305 retval.type = json["type"];
297306 retval.uri = json["uri"];
Test case

test/inputs/json/samples/us-avg-temperatures.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -80,6 +80,7 @@ Description Description_from_JSON(mixed json) {
8080 Description retval = Description();
8181
8282 retval.base_period = json["base_period"];
83+ if (!intp(json["missing"])) error("Expected integer");
8384 retval.missing = json["missing"];
8485 retval.title = json["title"];
8586 retval.units = json["units"];
Test case

test/inputs/json/samples/us-senators.json

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -54,8 +54,11 @@ class Meta {
5454 Meta Meta_from_JSON(mixed json) {
5555 Meta retval = Meta();
5656
57+ if (!intp(json["limit"])) error("Expected integer");
5758 retval.limit = json["limit"];
59+ if (!intp(json["offset"])) error("Expected integer");
5860 retval.offset = json["offset"];
61+ if (!intp(json["total_count"])) error("Expected integer");
5962 retval.total_count = json["total_count"];
6063
6164 return retval;
@@ -238,6 +241,7 @@ Person Person_from_JSON(mixed json) {
238241
239242 retval.bioguideid = json["bioguideid"];
240243 retval.birthday = json["birthday"];
244+ if (!intp(json["cspanid"])) error("Expected integer");
241245 retval.cspanid = json["cspanid"];
242246 retval.firstname = json["firstname"];
243247 retval.gender = Gender_from_JSON(json["gender"]);
Test case

test/inputs/schema/const-non-string.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -35,6 +35,7 @@ class TopLevel {
3535 TopLevel TopLevel_from_JSON(mixed json) {
3636 TopLevel retval = TopLevel();
3737
38+ if (!intp(json["amount"])) error("Expected integer");
3839 retval.amount = json["amount"];
3940 if (json["enabled"] != Standards.JSON.true && json["enabled"] != Standards.JSON.false) error("Expected bool");
4041 retval.enabled = json["enabled"];
Test case

test/inputs/schema/cut-enum.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -27,6 +27,7 @@ class TopLevel {
2727 TopLevel TopLevel_from_JSON(mixed json) {
2828 TopLevel retval = TopLevel();
2929
30+ if (!intp(json["foo"])) error("Expected integer");
3031 retval.foo = json["foo"];
3132
3233 return retval;
Test case

test/inputs/schema/default-value.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -28,6 +28,7 @@ class TopLevel {
2828 TopLevel TopLevel_from_JSON(mixed json) {
2929 TopLevel retval = TopLevel();
3030
31+ if (!intp(json["id"])) error("Expected integer");
3132 retval.id = json["id"];
3233
3334 return retval;
Test case

test/inputs/schema/id-no-address.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -27,6 +27,7 @@ class TopLevel {
2727 TopLevel TopLevel_from_JSON(mixed json) {
2828 TopLevel retval = TopLevel();
2929
30+ if (!intp(json["item"])) error("Expected integer");
3031 retval.item = json["item"];
3132
3233 return retval;
Test case

test/inputs/schema/id-root.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -27,6 +27,7 @@ class TopLevel {
2727 TopLevel TopLevel_from_JSON(mixed json) {
2828 TopLevel retval = TopLevel();
2929
30+ if (!intp(json["bar"])) error("Expected integer");
3031 retval.bar = json["bar"];
3132
3233 return retval;
Test case

test/inputs/schema/implicit-all-of.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -31,6 +31,7 @@ class TopLevel {
3131 TopLevel TopLevel_from_JSON(mixed json) {
3232 TopLevel retval = TopLevel();
3333
34+ if (!intp(json["foo"])) error("Expected integer");
3435 retval.foo = json["foo"];
3536 if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool");
3637 retval.bar = json["bar"];
Test case

test/inputs/schema/implicit-one-of.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -31,6 +31,7 @@ class TopLevel {
3131 TopLevel TopLevel_from_JSON(mixed json) {
3232 TopLevel retval = TopLevel();
3333
34+ if (!intp(json["foo"])) error("Expected integer");
3435 retval.foo = json["foo"];
3536 retval.bar = json["bar"];
3637 retval.quux = json["quux"];
Test case

test/inputs/schema/integer-type.schema

1 generated file · +9 −0
Mschema-pikedefault / TopLevel.pmod+9 −0
@@ -45,26 +45,35 @@ TopLevel TopLevel_from_JSON(mixed json) {
4545
4646 if (json["above_i32_max"] < 0) error("Value below minimum");
4747 if (json["above_i32_max"] > 2147483648) error("Value above maximum");
48+ if (!intp(json["above_i32_max"])) error("Expected integer");
4849 retval.above_i32_max = json["above_i32_max"];
4950 if (json["below_i32_min"] < -2147483649) error("Value below minimum");
5051 if (json["below_i32_min"] > 0) error("Value above maximum");
52+ if (!intp(json["below_i32_min"])) error("Expected integer");
5153 retval.below_i32_min = json["below_i32_min"];
5254 if (json["i32_range"] < -2147483648) error("Value below minimum");
5355 if (json["i32_range"] > 2147483647) error("Value above maximum");
56+ if (!intp(json["i32_range"])) error("Expected integer");
5457 retval.i32_range = json["i32_range"];
5558 if (json["large_bounds"] < -9007199254740991) error("Value below minimum");
5659 if (json["large_bounds"] > 9007199254740991) error("Value above maximum");
60+ if (!intp(json["large_bounds"])) error("Expected integer");
5761 retval.large_bounds = json["large_bounds"];
5862 if (json["only_maximum"] > 0) error("Value above maximum");
63+ if (!intp(json["only_maximum"])) error("Expected integer");
5964 retval.only_maximum = json["only_maximum"];
6065 if (json["only_minimum"] < 0) error("Value below minimum");
66+ if (!intp(json["only_minimum"])) error("Expected integer");
6167 retval.only_minimum = json["only_minimum"];
6268 if (json["small_negative"] < -100) error("Value below minimum");
6369 if (json["small_negative"] > 0) error("Value above maximum");
70+ if (!intp(json["small_negative"])) error("Expected integer");
6471 retval.small_negative = json["small_negative"];
6572 if (json["small_positive"] < 0) error("Value below minimum");
6673 if (json["small_positive"] > 100) error("Value above maximum");
74+ if (!intp(json["small_positive"])) error("Expected integer");
6775 retval.small_positive = json["small_positive"];
76+ if (!intp(json["unbounded"])) error("Expected integer");
6877 retval.unbounded = json["unbounded"];
6978
7079 return retval;
Test case

test/inputs/schema/minmax-integer.schema

1 generated file · +8 −0
Mschema-pikedefault / TopLevel.pmod+8 −0
@@ -41,23 +41,31 @@ class TopLevel {
4141 TopLevel TopLevel_from_JSON(mixed json) {
4242 TopLevel retval = TopLevel();
4343
44+ if (!intp(json["free"])) error("Expected integer");
4445 retval.free = json["free"];
4546 if (json["intersection"] < 4) error("Value below minimum");
4647 if (json["intersection"] > 5) error("Value above maximum");
48+ if (!intp(json["intersection"])) error("Expected integer");
4749 retval.intersection = json["intersection"];
4850 if (json["max"] > 5) error("Value above maximum");
51+ if (!intp(json["max"])) error("Expected integer");
4952 retval.max = json["max"];
5053 if (json["min"] < 3) error("Value below minimum");
54+ if (!intp(json["min"])) error("Expected integer");
5155 retval.min = json["min"];
5256 if (json["minmax"] < 3) error("Value below minimum");
5357 if (json["minmax"] > 5) error("Value above maximum");
58+ if (!intp(json["minmax"])) error("Expected integer");
5459 retval.minmax = json["minmax"];
5560 if (json["minMaxIntersection"] < 3) error("Value below minimum");
5661 if (json["minMaxIntersection"] > 5) error("Value above maximum");
62+ if (!intp(json["minMaxIntersection"])) error("Expected integer");
5763 retval.min_max_intersection = json["minMaxIntersection"];
64+ if (!intp(json["minMaxUnion"])) error("Expected integer");
5865 retval.min_max_union = json["minMaxUnion"];
5966 if (json["union"] < 3) error("Value below minimum");
6067 if (json["union"] > 6) error("Value above maximum");
68+ if (!intp(json["union"])) error("Expected integer");
6169 retval.union = json["union"];
6270
6371 return retval;
Test case

test/inputs/schema/non-standard-ref.schema

1 generated file · +2 −0
Mschema-pikedefault / TopLevel.pmod+2 −0
@@ -31,7 +31,9 @@ class TopLevel {
3131 TopLevel TopLevel_from_JSON(mixed json) {
3232 TopLevel retval = TopLevel();
3333
34+ if (!intp(json["bar"])) error("Expected integer");
3435 retval.bar = json["bar"];
36+ if (!intp(json["foo"])) error("Expected integer");
3537 retval.foo = json["foo"];
3638 if (json["quux"] != Standards.JSON.true && json["quux"] != Standards.JSON.false) error("Expected bool");
3739 retval.quux = json["quux"];
Test case

test/inputs/schema/optional-const-ref.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -49,6 +49,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
4949 retval.required_coordinates = json["requiredCoordinates"];
5050 if (json["requiredCount"] < 1) error("Value below minimum");
5151 if (json["requiredCount"] > 100) error("Value above maximum");
52+ if (!intp(json["requiredCount"])) error("Expected integer");
5253 retval.required_count = json["requiredCount"];
5354 if (sizeof(json["requiredLabel"]) < 2) error("String too short");
5455 if (sizeof(json["requiredLabel"]) > 16) error("String too long");
Test case

test/inputs/schema/optional-constraints.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -48,6 +48,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
4848 retval.opt_string = json["optString"];
4949 if (json["reqZeroMin"] < 0) error("Value below minimum");
5050 if (json["reqZeroMin"] > 100) error("Value above maximum");
51+ if (!intp(json["reqZeroMin"])) error("Expected integer");
5152 retval.req_zero_min = json["reqZeroMin"];
5253
5354 return retval;
Test case

test/inputs/schema/ref-id-files.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -27,6 +27,7 @@ class TopLevel {
2727 TopLevel TopLevel_from_JSON(mixed json) {
2828 TopLevel retval = TopLevel();
2929
30+ if (!intp(json["foo"])) error("Expected integer");
3031 retval.foo = json["foo"];
3132
3233 return retval;
Test case

test/inputs/schema/required-non-properties.schema

1 generated file · +1 −0
Mschema-pikedefault / TopLevel.pmod+1 −0
@@ -29,6 +29,7 @@ class TopLevel {
2929 TopLevel TopLevel_from_JSON(mixed json) {
3030 TopLevel retval = TopLevel();
3131
32+ if (!intp(json["foo"])) error("Expected integer");
3233 retval.foo = json["foo"];
3334 retval.bar = json["bar"];
No generated files match these filters.