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 24fb39862c6245bc290941a6c0a1aed1ade855a2 · PR merge 8ac683948d806406c4660b83ec9fee5ee817ac19 · Head 8b4bc0c7a842c580734bcb90a1bd3a0050eedbd0 · raw patch
Test case

test/inputs/graphql/github2.graphql

1 generated file · +1 −0
Mgraphql-pikedefault / TopLevel.pmod+1 −0
@@ -99,6 +99,7 @@ class RepositoryConnection {
9999 RepositoryConnection RepositoryConnection_from_JSON(mixed json) {
100100 RepositoryConnection retval = RepositoryConnection();
101101
102+ if (!intp(json["totalCount"])) error("Expected integer");
102103 retval.total_count = json["totalCount"];
103104 if (!has_index(json, "nodes")) error("Missing required property");
104105 retval.nodes = json["nodes"];
Test case

test/inputs/graphql/github7.graphql

1 generated file · +1 −0
Mgraphql-pikedefault / TopLevel.pmod+1 −0
@@ -180,6 +180,7 @@ class Connection {
180180 Connection Connection_from_JSON(mixed json) {
181181 Connection retval = Connection();
182182
183+ if (!intp(json["totalCount"])) error("Expected integer");
183184 retval.total_count = json["totalCount"];
184185
185186 return retval;
Test case

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

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -120,9 +120,12 @@ class FluffyTopLevel {
120120 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
121121 FluffyTopLevel retval = FluffyTopLevel();
122122
123+ if (!intp(json["page"])) error("Expected integer");
123124 retval.page = json["page"];
125+ if (!intp(json["pages"])) error("Expected integer");
124126 retval.pages = json["pages"];
125127 retval.per_page = json["per_page"];
128+ if (!intp(json["total"])) error("Expected integer");
126129 retval.total = json["total"];
127130
128131 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
@@ -81,6 +81,7 @@ Description Description_from_JSON(mixed json) {
8181 Description retval = Description();
8282
8383 retval.base_period = json["base_period"];
84+ if (!intp(json["missing"])) error("Expected integer");
8485 retval.missing = json["missing"];
8586 retval.title = json["title"];
8687 retval.units = json["units"];
Test case

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

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
@@ -95,6 +98,7 @@ Result Result_from_JSON(mixed json) {
9598
9699 retval.code = json["code"];
97100 retval.created_at = json["created_at"];
101+ if (!intp(json["id"])) error("Expected integer");
98102 retval.id = json["id"];
99103 retval.name = json["name"];
100104 retval.updated_at = json["updated_at"];
Test case

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

1 generated file · +20 −0
Mpikedefault / TopLevel.pmod+20 −0
@@ -92,6 +92,7 @@ Actor Actor_from_JSON(mixed json) {
9292 retval.avatar_url = json["avatar_url"];
9393 retval.display_login = json["display_login"];
9494 retval.gravatar_id = json["gravatar_id"];
95+ if (!intp(json["id"])) error("Expected integer");
9596 retval.id = json["id"];
9697 retval.login = json["login"];
9798 retval.url = json["url"];
@@ -311,24 +312,30 @@ class PullRequest {
311312 PullRequest PullRequest_from_JSON(mixed json) {
312313 PullRequest retval = PullRequest();
313314
315+ if (!intp(json["additions"])) error("Expected integer");
314316 retval.additions = json["additions"];
315317 retval.assignee = json["assignee"];
316318 retval.assignees = json["assignees"];
317319 Base_from_JSON(json["base"]);
318320 retval.base = json["base"];
319321 retval.body = json["body"];
322+ if (!intp(json["changed_files"])) error("Expected integer");
320323 retval.changed_files = json["changed_files"];
321324 retval.closed_at = json["closed_at"];
325+ if (!intp(json["comments"])) error("Expected integer");
322326 retval.comments = json["comments"];
323327 retval.comments_url = json["comments_url"];
328+ if (!intp(json["commits"])) error("Expected integer");
324329 retval.commits = json["commits"];
325330 retval.commits_url = json["commits_url"];
326331 retval.created_at = json["created_at"];
332+ if (!intp(json["deletions"])) error("Expected integer");
327333 retval.deletions = json["deletions"];
328334 retval.diff_url = json["diff_url"];
329335 Base_from_JSON(json["head"]);
330336 retval.head = json["head"];
331337 retval.html_url = json["html_url"];
338+ if (!intp(json["id"])) error("Expected integer");
332339 retval.id = json["id"];
333340 retval.issue_url = json["issue_url"];
334341 Links_from_JSON(json["_links"]);
@@ -346,11 +353,13 @@ PullRequest PullRequest_from_JSON(mixed json) {
346353 MergedBy_from_JSON(json["merged_by"]);
347354 retval.merged_by = json["merged_by"];
348355 retval.milestone = json["milestone"];
356+ if (!intp(json["number"])) error("Expected integer");
349357 retval.number = json["number"];
350358 retval.patch_url = json["patch_url"];
351359 retval.rebaseable = json["rebaseable"];
352360 retval.requested_reviewers = json["requested_reviewers"];
353361 retval.review_comment_url = json["review_comment_url"];
362+ if (!intp(json["review_comments"])) error("Expected integer");
354363 retval.review_comments = json["review_comments"];
355364 retval.review_comments_url = json["review_comments_url"];
356365 retval.state = json["state"];
@@ -568,7 +577,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
568577 retval.events_url = json["events_url"];
569578 if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool");
570579 retval.fork = json["fork"];
580+ if (!intp(json["forks"])) error("Expected integer");
571581 retval.forks = json["forks"];
582+ if (!intp(json["forks_count"])) error("Expected integer");
572583 retval.forks_count = json["forks_count"];
573584 retval.forks_url = json["forks_url"];
574585 retval.full_name = json["full_name"];
@@ -589,6 +600,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
589600 retval.homepage = json["homepage"];
590601 retval.hooks_url = json["hooks_url"];
591602 retval.html_url = json["html_url"];
603+ if (!intp(json["id"])) error("Expected integer");
592604 retval.id = json["id"];
593605 retval.issue_comment_url = json["issue_comment_url"];
594606 retval.issue_events_url = json["issue_events_url"];
@@ -602,7 +614,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
602614 retval.mirror_url = json["mirror_url"];
603615 retval.name = json["name"];
604616 retval.notifications_url = json["notifications_url"];
617+ if (!intp(json["open_issues"])) error("Expected integer");
605618 retval.open_issues = json["open_issues"];
619+ if (!intp(json["open_issues_count"])) error("Expected integer");
606620 retval.open_issues_count = json["open_issues_count"];
607621 MergedBy_from_JSON(json["owner"]);
608622 retval.owner = json["owner"];
@@ -611,8 +625,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
611625 retval.releases_url = json["releases_url"];
612626 if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool");
613627 retval.repo_private = json["private"];
628+ if (!intp(json["size"])) error("Expected integer");
614629 retval.size = json["size"];
615630 retval.ssh_url = json["ssh_url"];
631+ if (!intp(json["stargazers_count"])) error("Expected integer");
616632 retval.stargazers_count = json["stargazers_count"];
617633 retval.stargazers_url = json["stargazers_url"];
618634 retval.statuses_url = json["statuses_url"];
@@ -624,7 +640,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
624640 retval.trees_url = json["trees_url"];
625641 retval.updated_at = json["updated_at"];
626642 retval.url = json["url"];
643+ if (!intp(json["watchers"])) error("Expected integer");
627644 retval.watchers = json["watchers"];
645+ if (!intp(json["watchers_count"])) error("Expected integer");
628646 retval.watchers_count = json["watchers_count"];
629647
630648 return retval;
@@ -684,6 +702,7 @@ MergedBy MergedBy_from_JSON(mixed json) {
684702 retval.gists_url = json["gists_url"];
685703 retval.gravatar_id = json["gravatar_id"];
686704 retval.html_url = json["html_url"];
705+ if (!intp(json["id"])) error("Expected integer");
687706 retval.id = json["id"];
688707 retval.login = json["login"];
689708 retval.organizations_url = json["organizations_url"];
@@ -787,6 +806,7 @@ class TopLevelRepo {
787806 TopLevelRepo TopLevelRepo_from_JSON(mixed json) {
788807 TopLevelRepo retval = TopLevelRepo();
789808
809+ if (!intp(json["id"])) error("Expected integer");
790810 retval.id = json["id"];
791811 retval.name = json["name"];
792812 retval.url = json["url"];
Test case

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

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
8282 ResponseInfo retval = ResponseInfo();
8383
8484 retval.developer_message = json["developerMessage"];
85+ if (!intp(json["status"])) error("Expected integer");
8586 retval.status = json["status"];
8687
8788 return retval;
@@ -106,8 +107,11 @@ class Resultset {
106107 Resultset Resultset_from_JSON(mixed json) {
107108 Resultset retval = Resultset();
108109
110+ if (!intp(json["count"])) error("Expected integer");
109111 retval.count = json["count"];
112+ if (!intp(json["page"])) error("Expected integer");
110113 retval.page = json["page"];
114+ if (!intp(json["pagesize"])) error("Expected integer");
111115 retval.pagesize = json["pagesize"];
112116
113117 return retval;
Test case

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

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -434,6 +435,7 @@ Meta Meta_from_JSON(mixed json) {
434435
435436 retval.msg = json["msg"];
436437 retval.response_id = json["response_id"];
438+ if (!intp(json["status"])) error("Expected integer");
437439 retval.status = json["status"];
438440
439441 return retval;
@@ -458,8 +460,11 @@ class Pagination {
458460 Pagination Pagination_from_JSON(mixed json) {
459461 Pagination retval = Pagination();
460462
463+ if (!intp(json["count"])) error("Expected integer");
461464 retval.count = json["count"];
465+ if (!intp(json["offset"])) error("Expected integer");
462466 retval.offset = json["offset"];
467+ if (!intp(json["total_count"])) error("Expected integer");
463468 retval.total_count = json["total_count"];
464469
465470 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,16 +85,20 @@ 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 FavMovie_from_JSON(json["fav_movie"]);
9295 retval.fav_movie = json["fav_movie"];
96+ if (!intp(json["id"])) error("Expected integer");
9397 retval.id = json["id"];
9498 retval.images = json["images"];
9599 retval.language = ResultLanguage_from_JSON(json["language"]);
96100 retval.release_date = json["release_date"];
101+ if (!intp(json["stars"])) error("Expected integer");
97102 retval.stars = json["stars"];
98103 if (!has_index(json, "tags")) error("Missing required property");
99104 retval.tags = json["tags"];
@@ -101,6 +106,7 @@ Result Result_from_JSON(mixed json) {
101106 retval.videos = json["videos"];
102107 VoteScore_from_JSON(json["vote_score"]);
103108 retval.vote_score = json["vote_score"];
109+ if (!intp(json["watches"])) error("Expected integer");
104110 retval.watches = json["watches"];
105111
106112 return retval;
@@ -127,6 +133,7 @@ class Collection {
127133 Collection Collection_from_JSON(mixed json) {
128134 Collection retval = Collection();
129135
136+ if (!intp(json["id"])) error("Expected integer");
130137 retval.id = json["id"];
131138 retval.movies = json["movies"];
132139 retval.name = json["name"];
@@ -164,6 +171,7 @@ Detail Detail_from_JSON(mixed json) {
164171
165172 retval.cast = json["cast"];
166173 retval.director = json["director"];
174+ if (!intp(json["id"])) error("Expected integer");
167175 retval.id = json["id"];
168176 retval.language = DetailLanguage_from_JSON(json["language"]);
169177 retval.storyline = json["storyline"];
@@ -234,7 +242,9 @@ class Image {
234242 Image Image_from_JSON(mixed json) {
235243 Image retval = Image();
236244
245+ if (!intp(json["favs"])) error("Expected integer");
237246 retval.favs = json["favs"];
247+ if (!intp(json["id"])) error("Expected integer");
238248 retval.id = json["id"];
239249 retval.thumbnail = json["thumbnail"];
240250 retval.type = Type_from_JSON(json["type"]);
@@ -309,8 +319,11 @@ class VoteScore {
309319 VoteScore VoteScore_from_JSON(mixed json) {
310320 VoteScore retval = VoteScore();
311321
322+ if (!intp(json["avg"])) error("Expected integer");
312323 retval.avg = json["avg"];
324+ if (!intp(json["score"])) error("Expected integer");
313325 retval.score = json["score"];
326+ if (!intp(json["total"])) error("Expected integer");
314327 retval.total = json["total"];
315328
316329 return retval;
Test case

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

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -433,6 +434,7 @@ Meta Meta_from_JSON(mixed json) {
433434
434435 retval.msg = json["msg"];
435436 retval.response_id = json["response_id"];
437+ if (!intp(json["status"])) error("Expected integer");
436438 retval.status = json["status"];
437439
438440 return retval;
@@ -457,8 +459,11 @@ class Pagination {
457459 Pagination Pagination_from_JSON(mixed json) {
458460 Pagination retval = Pagination();
459461
462+ if (!intp(json["count"])) error("Expected integer");
460463 retval.count = json["count"];
464+ if (!intp(json["offset"])) error("Expected integer");
461465 retval.offset = json["offset"];
466+ if (!intp(json["total_count"])) error("Expected integer");
462467 retval.total_count = json["total_count"];
463468
464469 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 Location_from_JSON(json["location"]);
5657 retval.location = json["location"];
@@ -108,6 +109,7 @@ class Street {
108109 Street Street_from_JSON(mixed json) {
109110 Street retval = Street();
110111
112+ if (!intp(json["id"])) error("Expected integer");
111113 retval.id = json["id"];
112114 retval.name = json["name"];
Test case

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

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 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 Results_from_JSON(json["Results"]);
3940 retval.results = json["Results"];
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
@@ -55,8 +55,11 @@ class Meta {
5555 Meta Meta_from_JSON(mixed json) {
5656 Meta retval = Meta();
5757
58+ if (!intp(json["limit"])) error("Expected integer");
5859 retval.limit = json["limit"];
60+ if (!intp(json["offset"])) error("Expected integer");
5961 retval.offset = json["offset"];
62+ if (!intp(json["total_count"])) error("Expected integer");
6063 retval.total_count = json["total_count"];
6164
6265 return retval;
@@ -122,10 +125,12 @@ Object Object_from_JSON(mixed json) {
122125 if (json["current"] != Standards.JSON.true && json["current"] != Standards.JSON.false) error("Expected bool");
123126 retval.current = json["current"];
124127 retval.description = json["description"];
128+ if (!intp(json["district"])) error("Expected integer");
125129 retval.district = json["district"];
126130 retval.enddate = json["enddate"];
127131 Extra_from_JSON(json["extra"]);
128132 retval.extra = json["extra"];
133+ if (!intp(json["id"])) error("Expected integer");
129134 retval.id = json["id"];
130135 if (!has_index(json, "leadership_title")) error("Missing required property");
131136 retval.leadership_title = json["leadership_title"];
@@ -238,10 +243,12 @@ Person Person_from_JSON(mixed json) {
238243
239244 retval.bioguideid = json["bioguideid"];
240245 retval.birthday = json["birthday"];
246+ if (!intp(json["cspanid"])) error("Expected integer");
241247 retval.cspanid = json["cspanid"];
242248 retval.firstname = json["firstname"];
243249 retval.gender = Gender_from_JSON(json["gender"]);
244250 retval.gender_label = GenderLabel_from_JSON(json["gender_label"]);
251+ if (!intp(json["id"])) error("Expected integer");
245252 retval.id = json["id"];
246253 retval.lastname = json["lastname"];
247254 retval.link = json["link"];
Test case

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

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

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

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -429,6 +430,7 @@ Meta Meta_from_JSON(mixed json) {
429430
430431 retval.msg = json["msg"];
431432 retval.response_id = json["response_id"];
433+ if (!intp(json["status"])) error("Expected integer");
432434 retval.status = json["status"];
433435
434436 return retval;
@@ -453,8 +455,11 @@ class Pagination {
453455 Pagination Pagination_from_JSON(mixed json) {
454456 Pagination retval = Pagination();
455457
458+ if (!intp(json["count"])) error("Expected integer");
456459 retval.count = json["count"];
460+ if (!intp(json["offset"])) error("Expected integer");
457461 retval.offset = json["offset"];
462+ if (!intp(json["total_count"])) error("Expected integer");
458463 retval.total_count = json["total_count"];
459464
460465 return retval;
Test case

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

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -154,12 +154,15 @@ View View_from_JSON(mixed json) {
154154
155155 retval.attribution = json["attribution"];
156156 retval.attribution_link = json["attributionLink"];
157+ if (!intp(json["averageRating"])) error("Expected integer");
157158 retval.average_rating = json["averageRating"];
158159 retval.category = json["category"];
159160 retval.columns = json["columns"];
161+ if (!intp(json["createdAt"])) error("Expected integer");
160162 retval.created_at = json["createdAt"];
161163 retval.description = json["description"];
162164 retval.display_type = json["displayType"];
165+ if (!intp(json["downloadCount"])) error("Expected integer");
163166 retval.download_count = json["downloadCount"];
164167 retval.flags = json["flags"];
165168 retval.grants = json["grants"];
@@ -168,6 +171,7 @@ View View_from_JSON(mixed json) {
168171 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
169172 retval.hide_from_data_json = json["hideFromDataJson"];
170173 retval.id = json["id"];
174+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
171175 retval.index_updated_at = json["indexUpdatedAt"];
172176 retval.locale = json["locale"];
173177 Metadata_from_JSON(json["metadata"]);
@@ -175,27 +179,36 @@ View View_from_JSON(mixed json) {
175179 retval.name = json["name"];
176180 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
177181 retval.new_backend = json["newBackend"];
182+ if (!intp(json["numberOfComments"])) error("Expected integer");
178183 retval.number_of_comments = json["numberOfComments"];
184+ if (!intp(json["oid"])) error("Expected integer");
179185 retval.oid = json["oid"];
180186 Owner_from_JSON(json["owner"]);
181187 retval.owner = json["owner"];
182188 retval.provenance = json["provenance"];
183189 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
184190 retval.publication_append_enabled = json["publicationAppendEnabled"];
191+ if (!intp(json["publicationDate"])) error("Expected integer");
185192 retval.publication_date = json["publicationDate"];
193+ if (!intp(json["publicationGroup"])) error("Expected integer");
186194 retval.publication_group = json["publicationGroup"];
187195 retval.publication_stage = json["publicationStage"];
188196 Query_from_JSON(json["query"]);
189197 retval.query = json["query"];
190198 retval.rights = json["rights"];
199+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
191200 retval.rows_updated_at = json["rowsUpdatedAt"];
192201 retval.rows_updated_by = json["rowsUpdatedBy"];
193202 Owner_from_JSON(json["tableAuthor"]);
194203 retval.table_author = 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
@@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) {
244257 retval.flags = json["flags"];
245258 Format_from_JSON(json["format"]);
246259 retval.format = json["format"];
260+ if (!intp(json["id"])) error("Expected integer");
247261 retval.id = json["id"];
248262 retval.name = json["name"];
263+ if (!intp(json["position"])) error("Expected integer");
249264 retval.position = json["position"];
250265 retval.render_type_name = json["renderTypeName"];
251266 retval.table_column_id = json["tableColumnId"];
@@ -283,7 +298,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
283298
284299 retval.average = json["average"];
285300 retval.largest = json["largest"];
301+ if (!intp(json["non_null"])) error("Expected integer");
286302 retval.non_null = json["non_null"];
303+ if (!intp(json["null"])) error("Expected integer");
287304 retval.null = json["null"];
288305 retval.smallest = json["smallest"];
289306 retval.sum = json["sum"];
@@ -309,6 +326,7 @@ class Top {
309326 Top Top_from_JSON(mixed json) {
310327 Top retval = Top();
311328
329+ if (!intp(json["count"])) error("Expected integer");
312330 retval.count = json["count"];
313331 retval.item = json["item"];
314332
@@ -797,6 +815,7 @@ class Expression {
797815 Expression Expression_from_JSON(mixed json) {
798816 Expression retval = Expression();
799817
818+ if (!intp(json["columnId"])) error("Expected integer");
800819 retval.column_id = json["columnId"];
801820 retval.type = json["type"];
Test case

test/inputs/json/misc/27332.json

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -256,9 +256,11 @@ ChildData ChildData_from_JSON(mixed json) {
256256 if (!has_index(json, "distinguished")) error("Missing required property");
257257 retval.distinguished = json["distinguished"];
258258 retval.domain = Domain_from_JSON(json["domain"]);
259+ if (!intp(json["downs"])) error("Expected integer");
259260 retval.downs = json["downs"];
260261 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
261262 retval.edited = json["edited"];
263+ if (!intp(json["gilded"])) error("Expected integer");
262264 retval.gilded = json["gilded"];
263265 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
264266 retval.hidden = json["hidden"];
@@ -283,6 +285,7 @@ ChildData ChildData_from_JSON(mixed json) {
283285 retval.media_embed = json["media_embed"];
284286 retval.mod_reports = json["mod_reports"];
285287 retval.name = json["name"];
288+ if (!intp(json["num_comments"])) error("Expected integer");
286289 retval.num_comments = json["num_comments"];
287290 retval.num_reports = json["num_reports"];
288291 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -297,6 +300,7 @@ ChildData ChildData_from_JSON(mixed json) {
297300 retval.report_reasons = json["report_reasons"];
298301 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
299302 retval.saved = json["saved"];
303+ if (!intp(json["score"])) error("Expected integer");
300304 retval.score = json["score"];
301305 if (!has_index(json, "secure_media")) error("Missing required property");
302306 if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]);
@@ -316,11 +320,14 @@ ChildData ChildData_from_JSON(mixed json) {
316320 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
317321 retval.suggested_sort = json["suggested_sort"];
318322 retval.thumbnail = json["thumbnail"];
323+ if (!intp(json["thumbnail_height"])) error("Expected integer");
319324 if (!has_index(json, "thumbnail_height")) error("Missing required property");
320325 retval.thumbnail_height = json["thumbnail_height"];
326+ if (!intp(json["thumbnail_width"])) error("Expected integer");
321327 if (!has_index(json, "thumbnail_width")) error("Missing required property");
322328 retval.thumbnail_width = json["thumbnail_width"];
323329 retval.title = json["title"];
330+ if (!intp(json["ups"])) error("Expected integer");
324331 retval.ups = json["ups"];
325332 retval.url = json["url"];
326333 retval.user_reports = json["user_reports"];
@@ -404,16 +411,20 @@ Oembed Oembed_from_JSON(mixed json) {
404411 Oembed retval = Oembed();
405412
406413 retval.description = json["description"];
414+ if (!intp(json["height"])) error("Expected integer");
407415 retval.height = json["height"];
408416 retval.html = json["html"];
409417 retval.provider_name = json["provider_name"];
410418 retval.provider_url = json["provider_url"];
419+ if (!intp(json["thumbnail_height"])) error("Expected integer");
411420 retval.thumbnail_height = json["thumbnail_height"];
412421 retval.thumbnail_url = json["thumbnail_url"];
422+ if (!intp(json["thumbnail_width"])) error("Expected integer");
413423 retval.thumbnail_width = json["thumbnail_width"];
414424 retval.title = json["title"];
415425 retval.type = json["type"];
416426 retval.version = json["version"];
427+ if (!intp(json["width"])) error("Expected integer");
417428 retval.width = json["width"];
418429
419430 return retval;
@@ -531,8 +542,10 @@ class Source {
531542 Source Source_from_JSON(mixed json) {
532543 Source retval = Source();
533544
545+ if (!intp(json["height"])) error("Expected integer");
534546 retval.height = json["height"];
535547 retval.url = json["url"];
548+ if (!intp(json["width"])) error("Expected integer");
536549 retval.width = json["width"];
537550
538551 return retval;
Test case

test/inputs/json/misc/29f47.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 = Distinguished_from_JSON(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 (arrayp(json["edited"])) error("Unexpected array");
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 = 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");
@@ -290,6 +293,7 @@ ChildData ChildData_from_JSON(mixed json) {
290293 retval.report_reasons = json["report_reasons"];
291294 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
292295 retval.saved = json["saved"];
296+ if (!intp(json["score"])) error("Expected integer");
293297 retval.score = json["score"];
294298 retval.secure_media = json["secure_media"];
295299 MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -308,11 +312,14 @@ ChildData ChildData_from_JSON(mixed json) {
308312 if (!has_index(json, "suggested_sort")) error("Missing required property");
309313 retval.suggested_sort = json["suggested_sort"];
310314 retval.thumbnail = json["thumbnail"];
315+ if (!intp(json["thumbnail_height"])) error("Expected integer");
311316 if (!has_index(json, "thumbnail_height")) error("Missing required property");
312317 retval.thumbnail_height = json["thumbnail_height"];
318+ if (!intp(json["thumbnail_width"])) error("Expected integer");
313319 if (!has_index(json, "thumbnail_width")) error("Missing required property");
314320 retval.thumbnail_width = json["thumbnail_width"];
315321 retval.title = json["title"];
322+ if (!intp(json["ups"])) error("Expected integer");
316323 retval.ups = json["ups"];
317324 retval.url = json["url"];
318325 retval.user_reports = json["user_reports"];
@@ -445,8 +452,10 @@ class Source {
445452 Source Source_from_JSON(mixed json) {
446453 Source retval = Source();
447454
455+ if (!intp(json["height"])) error("Expected integer");
448456 retval.height = json["height"];
449457 retval.url = json["url"];
458+ if (!intp(json["width"])) error("Expected integer");
450459 retval.width = json["width"];
451460
452461 return retval;
Test case

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

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -55,8 +55,11 @@ class Meta {
5555 Meta Meta_from_JSON(mixed json) {
5656 Meta retval = Meta();
5757
58+ if (!intp(json["limit"])) error("Expected integer");
5859 retval.limit = json["limit"];
60+ if (!intp(json["offset"])) error("Expected integer");
5961 retval.offset = json["offset"];
62+ if (!intp(json["total_count"])) error("Expected integer");
6063 retval.total_count = json["total_count"];
6164
6265 return retval;
@@ -131,6 +134,7 @@ Object Object_from_JSON(mixed json) {
131134 retval.enddate = json["enddate"];
132135 Extra_from_JSON(json["extra"]);
133136 retval.extra = json["extra"];
137+ if (!intp(json["id"])) error("Expected integer");
134138 retval.id = json["id"];
135139 if (!has_index(json, "leadership_title")) error("Missing required property");
136140 retval.leadership_title = json["leadership_title"];
@@ -246,10 +250,12 @@ Person Person_from_JSON(mixed json) {
246250
247251 retval.bioguideid = json["bioguideid"];
248252 retval.birthday = json["birthday"];
253+ if (!intp(json["cspanid"])) error("Expected integer");
249254 retval.cspanid = json["cspanid"];
250255 retval.firstname = json["firstname"];
251256 retval.gender = Gender_from_JSON(json["gender"]);
252257 retval.gender_label = GenderLabel_from_JSON(json["gender_label"]);
258+ if (!intp(json["id"])) error("Expected integer");
253259 retval.id = json["id"];
254260 retval.lastname = json["lastname"];
255261 retval.link = json["link"];
Test case

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

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -177,9 +177,12 @@ class FluffyTopLevel {
177177 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
178178 FluffyTopLevel retval = FluffyTopLevel();
179179
180+ if (!intp(json["page"])) error("Expected integer");
180181 retval.page = json["page"];
182+ if (!intp(json["pages"])) error("Expected integer");
181183 retval.pages = json["pages"];
182184 retval.per_page = json["per_page"];
185+ if (!intp(json["total"])) error("Expected integer");
183186 retval.total = json["total"];
184187
185188 return retval;
Test case

test/inputs/json/misc/32431.json

1 generated file · +10 −0
Mpikedefault / TopLevel.pmod+10 −0
@@ -176,6 +176,7 @@ Properties Properties_from_JSON(mixed json) {
176176 if (!has_index(json, "dmin")) error("Missing required property");
177177 retval.dmin = json["dmin"];
178178 retval.felt = json["felt"];
179+ if (!intp(json["gap"])) error("Expected integer");
179180 if (!has_index(json, "gap")) error("Missing required property");
180181 retval.gap = json["gap"];
181182 retval.ids = json["ids"];
@@ -183,19 +184,25 @@ Properties Properties_from_JSON(mixed json) {
183184 retval.mag_type = MagType_from_JSON(json["magType"]);
184185 retval.mmi = json["mmi"];
185186 retval.net = json["net"];
187+ if (!intp(json["nst"])) error("Expected integer");
186188 if (!has_index(json, "nst")) error("Missing required property");
187189 retval.nst = json["nst"];
188190 retval.place = json["place"];
189191 retval.rms = (float)json["rms"];
192+ if (!intp(json["sig"])) error("Expected integer");
190193 retval.sig = json["sig"];
191194 retval.sources = json["sources"];
192195 retval.status = Status_from_JSON(json["status"]);
196+ if (!intp(json["time"])) error("Expected integer");
193197 retval.time = json["time"];
194198 retval.title = json["title"];
199+ if (!intp(json["tsunami"])) error("Expected integer");
195200 retval.tsunami = json["tsunami"];
196201 retval.type = PropertiesType_from_JSON(json["type"]);
197202 retval.types = json["types"];
203+ if (!intp(json["tz"])) error("Expected integer");
198204 retval.tz = json["tz"];
205+ if (!intp(json["updated"])) error("Expected integer");
199206 retval.updated = json["updated"];
200207 retval.url = json["url"];
201208
@@ -263,8 +270,11 @@ Metadata Metadata_from_JSON(mixed json) {
263270 Metadata retval = Metadata();
264271
265272 retval.api = json["api"];
273+ if (!intp(json["count"])) error("Expected integer");
266274 retval.count = json["count"];
275+ if (!intp(json["generated"])) error("Expected integer");
267276 retval.generated = json["generated"];
277+ if (!intp(json["status"])) error("Expected integer");
268278 retval.status = json["status"];
269279 retval.title = json["title"];
270280 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,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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
@@ -145,10 +148,13 @@ class Result {
145148 Result Result_from_JSON(mixed json) {
146149 Result retval = Result();
147150
151+ if (!intp(json["cost_absolute"])) error("Expected integer");
148152 if (!has_index(json, "cost_absolute")) error("Missing required property");
149153 retval.cost_absolute = json["cost_absolute"];
154+ if (!intp(json["cost_max"])) error("Expected integer");
150155 if (!has_index(json, "cost_max")) error("Missing required property");
151156 retval.cost_max = json["cost_max"];
157+ if (!intp(json["cost_min"])) error("Expected integer");
152158 if (!has_index(json, "cost_min")) error("Missing required property");
153159 retval.cost_min = json["cost_min"];
154160 retval.created_at = json["created_at"];
@@ -156,9 +162,11 @@ Result Result_from_JSON(mixed json) {
156162 retval.direct_rep_costs_max = json["direct_rep_costs_max"];
157163 retval.direct_rep_costs_min = json["direct_rep_costs_min"];
158164 retval.end_date = json["end_date"];
165+ if (!intp(json["eur_sources_grants"])) error("Expected integer");
159166 retval.eur_sources_grants = json["eur_sources_grants"];
160167 if (!has_index(json, "eur_sources_grants_src")) error("Missing required property");
161168 retval.eur_sources_grants_src = json["eur_sources_grants_src"];
169+ if (!intp(json["eur_sources_procurement"])) error("Expected integer");
162170 retval.eur_sources_procurement = json["eur_sources_procurement"];
163171 if (!has_index(json, "eur_sources_procurement_src")) error("Missing required property");
164172 retval.eur_sources_procurement_src = json["eur_sources_procurement_src"];
@@ -168,27 +176,37 @@ Result Result_from_JSON(mixed json) {
168176 retval.no_clients = json["no_clients"];
169177 if (!has_index(json, "other_financial_information")) error("Missing required property");
170178 retval.other_financial_information = json["other_financial_information"];
179+ if (!intp(json["other_sources_contributions"])) error("Expected integer");
171180 if (!has_index(json, "other_sources_contributions")) error("Missing required property");
172181 retval.other_sources_contributions = json["other_sources_contributions"];
182+ if (!intp(json["other_sources_donation"])) error("Expected integer");
173183 if (!has_index(json, "other_sources_donation")) error("Missing required property");
174184 retval.other_sources_donation = json["other_sources_donation"];
185+ if (!intp(json["other_sources_total"])) error("Expected integer");
175186 if (!has_index(json, "other_sources_total")) error("Missing required property");
176187 retval.other_sources_total = json["other_sources_total"];
188+ if (!intp(json["public_financing_infranational"])) error("Expected integer");
177189 if (!has_index(json, "public_financing_infranational")) error("Missing required property");
178190 retval.public_financing_infranational = json["public_financing_infranational"];
191+ if (!intp(json["public_financing_national"])) error("Expected integer");
179192 if (!has_index(json, "public_financing_national")) error("Missing required property");
180193 retval.public_financing_national = json["public_financing_national"];
194+ if (!intp(json["public_financing_total"])) error("Expected integer");
181195 if (!has_index(json, "public_financing_total")) error("Missing required property");
182196 retval.public_financing_total = json["public_financing_total"];
183197 retval.representative = json["representative"];
184198 retval.start_date = json["start_date"];
185199 retval.status = Status_from_JSON(json["status"]);
200+ if (!intp(json["total_budget"])) error("Expected integer");
186201 if (!has_index(json, "total_budget")) error("Missing required property");
187202 retval.total_budget = json["total_budget"];
203+ if (!intp(json["turnover_absolute"])) error("Expected integer");
188204 if (!has_index(json, "turnover_absolute")) error("Missing required property");
189205 retval.turnover_absolute = json["turnover_absolute"];
206+ if (!intp(json["turnover_max"])) error("Expected integer");
190207 if (!has_index(json, "turnover_max")) error("Missing required property");
191208 retval.turnover_max = json["turnover_max"];
209+ if (!intp(json["turnover_min"])) error("Expected integer");
192210 if (!has_index(json, "turnover_min")) error("Missing required property");
193211 retval.turnover_min = json["turnover_min"];
194212 retval.type = ResultType_from_JSON(json["type"]);
@@ -227,6 +245,7 @@ class CustomIncome {
227245 CustomIncome CustomIncome_from_JSON(mixed json) {
228246 CustomIncome retval = CustomIncome();
229247
248+ if (!intp(json["amount"])) error("Expected integer");
230249 retval.amount = json["amount"];
231250 retval.created_at = json["created_at"];
232251 retval.id = json["id"];
Test case

test/inputs/json/misc/34702.json

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3636 Crs_from_JSON(json["crs"]);
3737 retval.crs = json["crs"];
3838 retval.features = json["features"];
39+ if (!intp(json["totalFeatures"])) error("Expected integer");
3940 retval.total_features = json["totalFeatures"];
4041 retval.type = json["type"];
4142
@@ -212,6 +213,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
212213 if (!has_index(json, "no")) error("Missing required property");
213214 retval.no = json["no"];
214215 retval.phone = (float)json["phone"];
216+ if (!intp(json["postcode"])) error("Expected integer");
215217 retval.postcode = json["postcode"];
216218 retval.psa = json["psa"];
217219 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 Results_from_JSON(json["Results"]);
3940 retval.results = json["Results"];
Test case

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

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

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

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -157,12 +157,15 @@ View View_from_JSON(mixed json) {
157157 View retval = View();
158158
159159 retval.attribution = json["attribution"];
160+ if (!intp(json["averageRating"])) error("Expected integer");
160161 retval.average_rating = json["averageRating"];
161162 retval.category = json["category"];
162163 retval.columns = json["columns"];
164+ if (!intp(json["createdAt"])) error("Expected integer");
163165 retval.created_at = json["createdAt"];
164166 retval.description = json["description"];
165167 retval.display_type = json["displayType"];
168+ if (!intp(json["downloadCount"])) error("Expected integer");
166169 retval.download_count = json["downloadCount"];
167170 retval.flags = json["flags"];
168171 retval.grants = json["grants"];
@@ -171,6 +174,7 @@ View View_from_JSON(mixed json) {
171174 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
172175 retval.hide_from_data_json = json["hideFromDataJson"];
173176 retval.id = json["id"];
177+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
174178 retval.index_updated_at = json["indexUpdatedAt"];
175179 License_from_JSON(json["license"]);
176180 retval.license = json["license"];
@@ -181,28 +185,37 @@ View View_from_JSON(mixed json) {
181185 retval.name = json["name"];
182186 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
183187 retval.new_backend = json["newBackend"];
188+ if (!intp(json["numberOfComments"])) error("Expected integer");
184189 retval.number_of_comments = json["numberOfComments"];
190+ if (!intp(json["oid"])) error("Expected integer");
185191 retval.oid = json["oid"];
186192 Owner_from_JSON(json["owner"]);
187193 retval.owner = json["owner"];
188194 retval.provenance = json["provenance"];
189195 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
190196 retval.publication_append_enabled = json["publicationAppendEnabled"];
197+ if (!intp(json["publicationDate"])) error("Expected integer");
191198 retval.publication_date = json["publicationDate"];
199+ if (!intp(json["publicationGroup"])) error("Expected integer");
192200 retval.publication_group = json["publicationGroup"];
193201 retval.publication_stage = json["publicationStage"];
194202 Query_from_JSON(json["query"]);
195203 retval.query = json["query"];
196204 retval.rights = json["rights"];
197205 retval.row_class = json["rowClass"];
206+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
198207 retval.rows_updated_at = json["rowsUpdatedAt"];
199208 retval.rows_updated_by = json["rowsUpdatedBy"];
200209 Owner_from_JSON(json["tableAuthor"]);
201210 retval.table_author = json["tableAuthor"];
211+ if (!intp(json["tableId"])) error("Expected integer");
202212 retval.table_id = json["tableId"];
203213 retval.tags = json["tags"];
214+ if (!intp(json["totalTimesRated"])) error("Expected integer");
204215 retval.total_times_rated = json["totalTimesRated"];
216+ if (!intp(json["viewCount"])) error("Expected integer");
205217 retval.view_count = json["viewCount"];
218+ if (!intp(json["viewLastModified"])) error("Expected integer");
206219 retval.view_last_modified = json["viewLastModified"];
207220 retval.view_type = json["viewType"];
208221
@@ -251,8 +264,10 @@ Column Column_from_JSON(mixed json) {
251264 retval.flags = json["flags"];
252265 Query_from_JSON(json["format"]);
253266 retval.format = json["format"];
267+ if (!intp(json["id"])) error("Expected integer");
254268 retval.id = json["id"];
255269 retval.name = json["name"];
270+ if (!intp(json["position"])) error("Expected integer");
256271 retval.position = json["position"];
257272 retval.render_type_name = json["renderTypeName"];
258273 retval.table_column_id = json["tableColumnId"];
@@ -290,7 +305,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
290305
291306 retval.average = json["average"];
292307 retval.largest = json["largest"];
308+ if (!intp(json["non_null"])) error("Expected integer");
293309 retval.non_null = json["non_null"];
310+ if (!intp(json["null"])) error("Expected integer");
294311 retval.null = json["null"];
295312 retval.smallest = json["smallest"];
296313 retval.sum = json["sum"];
@@ -316,6 +333,7 @@ class Top {
316333 Top Top_from_JSON(mixed json) {
317334 Top retval = Top();
318335
336+ if (!intp(json["count"])) error("Expected integer");
319337 retval.count = json["count"];
320338 retval.item = json["item"];
Test case

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

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -418,6 +419,7 @@ Meta Meta_from_JSON(mixed json) {
418419
419420 retval.msg = json["msg"];
420421 retval.response_id = json["response_id"];
422+ if (!intp(json["status"])) error("Expected integer");
421423 retval.status = json["status"];
422424
423425 return retval;
@@ -442,8 +444,11 @@ class Pagination {
442444 Pagination Pagination_from_JSON(mixed json) {
443445 Pagination retval = Pagination();
444446
447+ if (!intp(json["count"])) error("Expected integer");
445448 retval.count = json["count"];
449+ if (!intp(json["offset"])) error("Expected integer");
446450 retval.offset = json["offset"];
451+ if (!intp(json["total_count"])) error("Expected integer");
447452 retval.total_count = json["total_count"];
448453
449454 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
@@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
8282 ResponseInfo retval = ResponseInfo();
8383
8484 retval.developer_message = json["developerMessage"];
85+ if (!intp(json["status"])) error("Expected integer");
8586 retval.status = json["status"];
8687
8788 return retval;
@@ -106,8 +107,11 @@ class Resultset {
106107 Resultset Resultset_from_JSON(mixed json) {
107108 Resultset retval = Resultset();
108109
110+ if (!intp(json["count"])) error("Expected integer");
109111 retval.count = json["count"];
112+ if (!intp(json["page"])) error("Expected integer");
110113 retval.page = json["page"];
114+ if (!intp(json["pagesize"])) error("Expected integer");
111115 retval.pagesize = json["pagesize"];
112116
113117 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
@@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3636 Crs_from_JSON(json["crs"]);
3737 retval.crs = json["crs"];
3838 retval.features = json["features"];
39+ if (!intp(json["totalFeatures"])) error("Expected integer");
3940 retval.total_features = json["totalFeatures"];
4041 retval.type = json["type"];
Test case

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

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

test/inputs/json/misc/4d6fb.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 = 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");
@@ -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 if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]);
@@ -310,11 +314,14 @@ ChildData ChildData_from_JSON(mixed json) {
310314 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
311315 retval.suggested_sort = json["suggested_sort"];
312316 retval.thumbnail = json["thumbnail"];
317+ if (!intp(json["thumbnail_height"])) error("Expected integer");
313318 if (!has_index(json, "thumbnail_height")) error("Missing required property");
314319 retval.thumbnail_height = json["thumbnail_height"];
320+ if (!intp(json["thumbnail_width"])) error("Expected integer");
315321 if (!has_index(json, "thumbnail_width")) error("Missing required property");
316322 retval.thumbnail_width = json["thumbnail_width"];
317323 retval.title = json["title"];
324+ if (!intp(json["ups"])) error("Expected integer");
318325 retval.ups = json["ups"];
319326 retval.url = json["url"];
320327 retval.user_reports = json["user_reports"];
@@ -390,16 +397,20 @@ Oembed Oembed_from_JSON(mixed json) {
390397
391398 retval.author_name = json["author_name"];
392399 retval.author_url = json["author_url"];
400+ if (!intp(json["height"])) error("Expected integer");
393401 retval.height = json["height"];
394402 retval.html = json["html"];
395403 retval.provider_name = json["provider_name"];
396404 retval.provider_url = json["provider_url"];
405+ if (!intp(json["thumbnail_height"])) error("Expected integer");
397406 retval.thumbnail_height = json["thumbnail_height"];
398407 retval.thumbnail_url = json["thumbnail_url"];
408+ if (!intp(json["thumbnail_width"])) error("Expected integer");
399409 retval.thumbnail_width = json["thumbnail_width"];
400410 retval.title = json["title"];
401411 retval.type = json["type"];
402412 retval.version = json["version"];
413+ if (!intp(json["width"])) error("Expected integer");
403414 retval.width = json["width"];
404415
405416 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/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,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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
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
@@ -154,12 +154,15 @@ View View_from_JSON(mixed json) {
154154
155155 retval.attribution = json["attribution"];
156156 retval.attribution_link = json["attributionLink"];
157+ if (!intp(json["averageRating"])) error("Expected integer");
157158 retval.average_rating = json["averageRating"];
158159 retval.category = json["category"];
159160 retval.columns = json["columns"];
161+ if (!intp(json["createdAt"])) error("Expected integer");
160162 retval.created_at = json["createdAt"];
161163 retval.description = json["description"];
162164 retval.display_type = json["displayType"];
165+ if (!intp(json["downloadCount"])) error("Expected integer");
163166 retval.download_count = json["downloadCount"];
164167 retval.flags = json["flags"];
165168 retval.grants = json["grants"];
@@ -168,6 +171,7 @@ View View_from_JSON(mixed json) {
168171 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
169172 retval.hide_from_data_json = json["hideFromDataJson"];
170173 retval.id = json["id"];
174+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
171175 retval.index_updated_at = json["indexUpdatedAt"];
172176 retval.locale = json["locale"];
173177 Metadata_from_JSON(json["metadata"]);
@@ -175,27 +179,36 @@ View View_from_JSON(mixed json) {
175179 retval.name = json["name"];
176180 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
177181 retval.new_backend = json["newBackend"];
182+ if (!intp(json["numberOfComments"])) error("Expected integer");
178183 retval.number_of_comments = json["numberOfComments"];
184+ if (!intp(json["oid"])) error("Expected integer");
179185 retval.oid = json["oid"];
180186 Owner_from_JSON(json["owner"]);
181187 retval.owner = json["owner"];
182188 retval.provenance = json["provenance"];
183189 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
184190 retval.publication_append_enabled = json["publicationAppendEnabled"];
191+ if (!intp(json["publicationDate"])) error("Expected integer");
185192 retval.publication_date = json["publicationDate"];
193+ if (!intp(json["publicationGroup"])) error("Expected integer");
186194 retval.publication_group = json["publicationGroup"];
187195 retval.publication_stage = json["publicationStage"];
188196 Query_from_JSON(json["query"]);
189197 retval.query = json["query"];
190198 retval.rights = json["rights"];
199+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
191200 retval.rows_updated_at = json["rowsUpdatedAt"];
192201 retval.rows_updated_by = json["rowsUpdatedBy"];
193202 Owner_from_JSON(json["tableAuthor"]);
194203 retval.table_author = 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
@@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) {
244257 retval.flags = json["flags"];
245258 Format_from_JSON(json["format"]);
246259 retval.format = json["format"];
260+ if (!intp(json["id"])) error("Expected integer");
247261 retval.id = json["id"];
248262 retval.name = json["name"];
263+ if (!intp(json["position"])) error("Expected integer");
249264 retval.position = json["position"];
250265 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
251266 retval.table_column_id = json["tableColumnId"];
@@ -278,7 +293,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
278293 CachedContents retval = CachedContents();
279294
280295 retval.largest = json["largest"];
296+ if (!intp(json["non_null"])) error("Expected integer");
281297 retval.non_null = json["non_null"];
298+ if (!intp(json["null"])) error("Expected integer");
282299 retval.null = json["null"];
283300 retval.smallest = json["smallest"];
284301 retval.top = json["top"];
@@ -303,6 +320,7 @@ class Top {
303320 Top Top_from_JSON(mixed json) {
304321 Top retval = Top();
305322
323+ if (!intp(json["count"])) error("Expected integer");
306324 retval.count = json["count"];
307325 retval.item = json["item"];
308326
@@ -795,6 +813,7 @@ class Expression {
795813 Expression Expression_from_JSON(mixed json) {
796814 Expression retval = Expression();
797815
816+ if (!intp(json["columnId"])) error("Expected integer");
798817 retval.column_id = json["columnId"];
799818 retval.type = json["type"];
Test case

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

1 generated file · +19 −0
Mpikedefault / TopLevel.pmod+19 −0
@@ -154,12 +154,15 @@ View View_from_JSON(mixed json) {
154154
155155 retval.attribution = json["attribution"];
156156 retval.attribution_link = json["attributionLink"];
157+ if (!intp(json["averageRating"])) error("Expected integer");
157158 retval.average_rating = json["averageRating"];
158159 retval.category = json["category"];
159160 retval.columns = json["columns"];
161+ if (!intp(json["createdAt"])) error("Expected integer");
160162 retval.created_at = json["createdAt"];
161163 retval.description = json["description"];
162164 retval.display_type = json["displayType"];
165+ if (!intp(json["downloadCount"])) error("Expected integer");
163166 retval.download_count = json["downloadCount"];
164167 retval.flags = json["flags"];
165168 retval.grants = json["grants"];
@@ -168,6 +171,7 @@ View View_from_JSON(mixed json) {
168171 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
169172 retval.hide_from_data_json = json["hideFromDataJson"];
170173 retval.id = json["id"];
174+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
171175 retval.index_updated_at = json["indexUpdatedAt"];
172176 retval.locale = json["locale"];
173177 Metadata_from_JSON(json["metadata"]);
@@ -175,27 +179,36 @@ View View_from_JSON(mixed json) {
175179 retval.name = json["name"];
176180 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
177181 retval.new_backend = json["newBackend"];
182+ if (!intp(json["numberOfComments"])) error("Expected integer");
178183 retval.number_of_comments = json["numberOfComments"];
184+ if (!intp(json["oid"])) error("Expected integer");
179185 retval.oid = json["oid"];
180186 Owner_from_JSON(json["owner"]);
181187 retval.owner = json["owner"];
182188 retval.provenance = json["provenance"];
183189 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
184190 retval.publication_append_enabled = json["publicationAppendEnabled"];
191+ if (!intp(json["publicationDate"])) error("Expected integer");
185192 retval.publication_date = json["publicationDate"];
193+ if (!intp(json["publicationGroup"])) error("Expected integer");
186194 retval.publication_group = json["publicationGroup"];
187195 retval.publication_stage = json["publicationStage"];
188196 Query_from_JSON(json["query"]);
189197 retval.query = json["query"];
190198 retval.rights = json["rights"];
199+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
191200 retval.rows_updated_at = json["rowsUpdatedAt"];
192201 retval.rows_updated_by = json["rowsUpdatedBy"];
193202 Owner_from_JSON(json["tableAuthor"]);
194203 retval.table_author = 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
@@ -247,8 +260,10 @@ Column Column_from_JSON(mixed json) {
247260 retval.flags = json["flags"];
248261 Format_from_JSON(json["format"]);
249262 retval.format = json["format"];
263+ if (!intp(json["id"])) error("Expected integer");
250264 retval.id = json["id"];
251265 retval.name = json["name"];
266+ if (!intp(json["position"])) error("Expected integer");
252267 retval.position = json["position"];
253268 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
254269 retval.table_column_id = json["tableColumnId"];
@@ -281,7 +296,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
281296 CachedContents retval = CachedContents();
282297
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.top = json["top"];
@@ -306,6 +323,7 @@ class Top {
306323 Top Top_from_JSON(mixed json) {
307324 Top retval = Top();
308325
326+ if (!intp(json["count"])) error("Expected integer");
309327 retval.count = json["count"];
310328 retval.item = json["item"];
311329
@@ -792,6 +810,7 @@ class Expression {
792810 Expression Expression_from_JSON(mixed json) {
793811 Expression retval = Expression();
794812
813+ if (!intp(json["columnId"])) error("Expected integer");
795814 retval.column_id = json["columnId"];
796815 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
@@ -34,6 +34,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3434 IssPosition_from_JSON(json["iss_position"]);
3535 retval.iss_position = json["iss_position"];
3636 retval.message = json["message"];
37+ if (!intp(json["timestamp"])) error("Expected integer");
3738 retval.timestamp = json["timestamp"];
3839
3940 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;
@@ -108,6 +115,7 @@ Input Input_from_JSON(mixed json) {
108115 Out_from_JSON(json["prev_out"]);
109116 retval.prev_out = json["prev_out"];
110117 retval.script = json["script"];
118+ if (!intp(json["sequence"])) error("Expected integer");
111119 retval.sequence = json["sequence"];
112120
113121 return retval;
@@ -141,12 +149,16 @@ Out Out_from_JSON(mixed json) {
141149 Out retval = Out();
142150
143151 retval.addr = json["addr"];
152+ if (!intp(json["n"])) error("Expected integer");
144153 retval.n = json["n"];
145154 retval.script = json["script"];
146155 if (json["spent"] != Standards.JSON.true && json["spent"] != Standards.JSON.false) error("Expected bool");
147156 retval.spent = json["spent"];
157+ if (!intp(json["tx_index"])) error("Expected integer");
148158 retval.tx_index = json["tx_index"];
159+ if (!intp(json["type"])) error("Expected integer");
149160 retval.type = json["type"];
161+ if (!intp(json["value"])) error("Expected integer");
150162 retval.value = json["value"];
151163
152164 return retval;
Test case

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

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
8282 ResponseInfo retval = ResponseInfo();
8383
8484 retval.developer_message = json["developerMessage"];
85+ if (!intp(json["status"])) error("Expected integer");
8586 retval.status = json["status"];
8687
8788 return retval;
@@ -106,8 +107,11 @@ class Resultset {
106107 Resultset Resultset_from_JSON(mixed json) {
107108 Resultset retval = Resultset();
108109
110+ if (!intp(json["count"])) error("Expected integer");
109111 retval.count = json["count"];
112+ if (!intp(json["page"])) error("Expected integer");
110113 retval.page = json["page"];
114+ if (!intp(json["pagesize"])) error("Expected integer");
111115 retval.pagesize = json["pagesize"];
112116
113117 return retval;
Test case

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

1 generated file · +13 −0
Mpikedefault / TopLevel.pmod+13 −0
@@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) {
255255 retval.created_utc = (float)json["created_utc"];
256256 retval.distinguished = json["distinguished"];
257257 retval.domain = json["domain"];
258+ if (!intp(json["downs"])) error("Expected integer");
258259 retval.downs = json["downs"];
259260 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
260261 retval.edited = json["edited"];
262+ if (!intp(json["gilded"])) error("Expected integer");
261263 retval.gilded = json["gilded"];
262264 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
263265 retval.hidden = json["hidden"];
@@ -282,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) {
282284 retval.media_embed = json["media_embed"];
283285 retval.mod_reports = json["mod_reports"];
284286 retval.name = json["name"];
287+ if (!intp(json["num_comments"])) error("Expected integer");
285288 retval.num_comments = json["num_comments"];
286289 retval.num_reports = json["num_reports"];
287290 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -296,6 +299,7 @@ ChildData ChildData_from_JSON(mixed json) {
296299 retval.report_reasons = json["report_reasons"];
297300 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
298301 retval.saved = json["saved"];
302+ if (!intp(json["score"])) error("Expected integer");
299303 retval.score = json["score"];
300304 if (!has_index(json, "secure_media")) error("Missing required property");
301305 if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]);
@@ -316,11 +320,14 @@ ChildData ChildData_from_JSON(mixed json) {
316320 if (!has_index(json, "suggested_sort")) error("Missing required property");
317321 retval.suggested_sort = json["suggested_sort"];
318322 retval.thumbnail = json["thumbnail"];
323+ if (!intp(json["thumbnail_height"])) error("Expected integer");
319324 if (!has_index(json, "thumbnail_height")) error("Missing required property");
320325 retval.thumbnail_height = json["thumbnail_height"];
326+ if (!intp(json["thumbnail_width"])) error("Expected integer");
321327 if (!has_index(json, "thumbnail_width")) error("Missing required property");
322328 retval.thumbnail_width = json["thumbnail_width"];
323329 retval.title = json["title"];
330+ if (!intp(json["ups"])) error("Expected integer");
324331 retval.ups = json["ups"];
325332 retval.url = json["url"];
326333 retval.user_reports = json["user_reports"];
@@ -393,16 +400,20 @@ Oembed Oembed_from_JSON(mixed json) {
393400 Oembed retval = Oembed();
394401
395402 retval.description = json["description"];
403+ if (!intp(json["height"])) error("Expected integer");
396404 retval.height = json["height"];
397405 retval.html = json["html"];
398406 retval.provider_name = json["provider_name"];
399407 retval.provider_url = json["provider_url"];
408+ if (!intp(json["thumbnail_height"])) error("Expected integer");
400409 retval.thumbnail_height = json["thumbnail_height"];
401410 retval.thumbnail_url = json["thumbnail_url"];
411+ if (!intp(json["thumbnail_width"])) error("Expected integer");
402412 retval.thumbnail_width = json["thumbnail_width"];
403413 retval.title = json["title"];
404414 retval.type = json["type"];
405415 retval.version = json["version"];
416+ if (!intp(json["width"])) error("Expected integer");
406417 retval.width = json["width"];
407418
408419 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/6dec6.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 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,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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
@@ -217,6 +220,7 @@ Result Result_from_JSON(mixed json) {
217220 retval.be_office_street = json["be_office_street"];
218221 retval.be_office_town = json["be_office_town"];
219222 retval.code_of_conduct = json["code_of_conduct"];
223+ if (!intp(json["contact_country"])) error("Expected integer");
220224 retval.contact_country = json["contact_country"];
221225 retval.created_at = json["created_at"];
222226 retval.entity = json["entity"];
@@ -240,15 +244,21 @@ Result Result_from_JSON(mixed json) {
240244 retval.last_update_date = json["last_update_date"];
241245 retval.legal = json["legal"];
242246 retval.legal_status = json["legal_status"];
247+ if (!intp(json["main_category"])) error("Expected integer");
243248 retval.main_category = json["main_category"];
244249 retval.main_category_title = json["main_category_title"];
250+ if (!intp(json["members"])) error("Expected integer");
245251 retval.members = json["members"];
252+ if (!intp(json["members_100"])) error("Expected integer");
246253 if (!has_index(json, "members_100")) error("Missing required property");
247254 retval.members_100 = json["members_100"];
255+ if (!intp(json["members_25"])) error("Expected integer");
248256 if (!has_index(json, "members_25")) error("Missing required property");
249257 retval.members_25 = json["members_25"];
258+ if (!intp(json["members_50"])) error("Expected integer");
250259 if (!has_index(json, "members_50")) error("Missing required property");
251260 retval.members_50 = json["members_50"];
261+ if (!intp(json["members_75"])) error("Expected integer");
252262 if (!has_index(json, "members_75")) error("Missing required property");
253263 retval.members_75 = json["members_75"];
254264 retval.members_fte = (float)json["members_fte"];
@@ -256,6 +266,7 @@ Result Result_from_JSON(mixed json) {
256266 retval.native_name = json["native_name"];
257267 if (!has_index(json, "networking")) error("Missing required property");
258268 retval.networking = json["networking"];
269+ if (!intp(json["number_of_natural_persons"])) error("Expected integer");
259270 if (!has_index(json, "number_of_natural_persons")) error("Missing required property");
260271 retval.number_of_natural_persons = json["number_of_natural_persons"];
261272 if (!has_index(json, "other_code_of_conduct")) error("Missing required property");
@@ -263,6 +274,7 @@ Result Result_from_JSON(mixed json) {
263274 retval.registration_date = json["registration_date"];
264275 retval.status = Status_from_JSON(json["status"]);
265276 retval.structure_members = json["structure_members"];
277+ if (!intp(json["sub_category"])) error("Expected integer");
266278 retval.sub_category = json["sub_category"];
267279 retval.sub_category_title = json["sub_category_title"];
268280 retval.updated_at = json["updated_at"];
Test case

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

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -435,6 +436,7 @@ Meta Meta_from_JSON(mixed json) {
435436
436437 retval.msg = json["msg"];
437438 retval.response_id = json["response_id"];
439+ if (!intp(json["status"])) error("Expected integer");
438440 retval.status = json["status"];
439441
440442 return retval;
@@ -459,8 +461,11 @@ class Pagination {
459461 Pagination Pagination_from_JSON(mixed json) {
460462 Pagination retval = Pagination();
461463
464+ if (!intp(json["count"])) error("Expected integer");
462465 retval.count = json["count"];
466+ if (!intp(json["offset"])) error("Expected integer");
463467 retval.offset = json["offset"];
468+ if (!intp(json["total_count"])) error("Expected integer");
464469 retval.total_count = json["total_count"];
465470
466471 return retval;
Test case

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

1 generated file · +2 −0
Mpikedefault / TopLevel.pmod+2 −0
@@ -68,8 +68,10 @@ class Pc {
6868 Pc Pc_from_JSON(mixed json) {
6969 Pc retval = Pc();
7070
71+ if (!intp(json["count"])) error("Expected integer");
7172 retval.count = json["count"];
7273 retval.label = json["label"];
74+ if (!intp(json["peak24"])) error("Expected integer");
7375 retval.peak24 = json["peak24"];
7476
7577 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"];
@@ -89,12 +90,16 @@ Result Result_from_JSON(mixed json) {
8990 Group_from_JSON(json["group"]);
9091 retval.group = json["group"];
9192 retval.location = Location_from_JSON(json["location"]);
93+ if (!intp(json["min_screens"])) error("Expected integer");
9294 retval.min_screens = json["min_screens"];
95+ if (!intp(json["num_views"])) error("Expected integer");
9396 retval.num_views = json["num_views"];
9497 retval.showtimes = json["showtimes"];
98+ if (!intp(json["stars"])) error("Expected integer");
9599 retval.stars = json["stars"];
96100 retval.tel = Tel_from_JSON(json["tel"]);
97101 retval.thai = json["thai"];
102+ if (!intp(json["today_screens"])) error("Expected integer");
98103 retval.today_screens = json["today_screens"];
99104 retval.url = json["url"];
100105 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
@@ -120,9 +120,12 @@ class FluffyTopLevel {
120120 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
121121 FluffyTopLevel retval = FluffyTopLevel();
122122
123+ if (!intp(json["page"])) error("Expected integer");
123124 retval.page = json["page"];
125+ if (!intp(json["pages"])) error("Expected integer");
124126 retval.pages = json["pages"];
125127 retval.per_page = json["per_page"];
128+ if (!intp(json["total"])) error("Expected integer");
126129 retval.total = json["total"];
127130
128131 return retval;
Test case

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

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -39,12 +39,15 @@ 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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
4648 if (json["next"] != Standards.JSON.true && json["next"] != Standards.JSON.false) error("Expected bool");
4749 retval.next = json["next"];
50+ if (!intp(json["offset"])) error("Expected integer");
4851 retval.offset = json["offset"];
4952 if (json["previous"] != Standards.JSON.true && json["previous"] != Standards.JSON.false) error("Expected bool");
5053 retval.previous = json["previous"];
@@ -97,9 +100,12 @@ Result Result_from_JSON(mixed json) {
97100 Result retval = Result();
98101
99102 retval.created_at = json["created_at"];
103+ if (!intp(json["id"])) error("Expected integer");
100104 retval.id = json["id"];
105+ if (!intp(json["items"])) error("Expected integer");
101106 retval.items = json["items"];
102107 retval.name = json["name"];
108+ if (!intp(json["parent"])) error("Expected integer");
103109 if (!has_index(json, "parent")) error("Missing required property");
104110 retval.parent = json["parent"];
105111 retval.updated_at = json["updated_at"];
Test case

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

1 generated file · +9 −0
Mpikedefault / TopLevel.pmod+9 −0
@@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) {
255255 retval.created_utc = (float)json["created_utc"];
256256 retval.distinguished = json["distinguished"];
257257 retval.domain = json["domain"];
258+ if (!intp(json["downs"])) error("Expected integer");
258259 retval.downs = json["downs"];
259260 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
260261 retval.edited = json["edited"];
262+ if (!intp(json["gilded"])) error("Expected integer");
261263 retval.gilded = json["gilded"];
262264 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
263265 retval.hidden = json["hidden"];
@@ -278,6 +280,7 @@ ChildData ChildData_from_JSON(mixed json) {
278280 retval.media_embed = 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");
@@ -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 retval.secure_media = json["secure_media"];
297301 MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -309,11 +313,14 @@ ChildData ChildData_from_JSON(mixed json) {
309313 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
310314 retval.suggested_sort = SuggestedSort_from_JSON(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"];
@@ -422,8 +429,10 @@ class Source {
422429 Source Source_from_JSON(mixed json) {
423430 Source retval = Source();
424431
432+ if (!intp(json["height"])) error("Expected integer");
425433 retval.height = json["height"];
426434 retval.url = json["url"];
435+ if (!intp(json["width"])) error("Expected integer");
427436 retval.width = json["width"];
428437
429438 return retval;
Test case

test/inputs/json/misc/88130.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 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
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 retval.lang = json["lang"];
Test case

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

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
Test case

test/inputs/json/misc/a0496.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -68,6 +68,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
6868 retval.errors = json["errors"];
6969 retval.frequency = json["frequency"];
7070 retval.from_date = json["from_date"];
71+ if (!intp(json["id"])) error("Expected integer");
7172 retval.id = json["id"];
7273 retval.name = json["name"];
7374 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
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 retval.lang = json["lang"];
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -150,11 +150,14 @@ class View {
150150 View View_from_JSON(mixed json) {
151151 View retval = View();
152152
153+ if (!intp(json["averageRating"])) error("Expected integer");
153154 retval.average_rating = json["averageRating"];
154155 retval.category = json["category"];
155156 retval.columns = json["columns"];
157+ if (!intp(json["createdAt"])) error("Expected integer");
156158 retval.created_at = json["createdAt"];
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,6 +166,7 @@ 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 License_from_JSON(json["license"]);
168172 retval.license = json["license"];
@@ -173,27 +177,36 @@ View View_from_JSON(mixed json) {
173177 retval.name = json["name"];
174178 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
175179 retval.new_backend = json["newBackend"];
180+ if (!intp(json["numberOfComments"])) error("Expected integer");
176181 retval.number_of_comments = json["numberOfComments"];
182+ if (!intp(json["oid"])) error("Expected integer");
177183 retval.oid = json["oid"];
178184 Owner_from_JSON(json["owner"]);
179185 retval.owner = json["owner"];
180186 retval.provenance = json["provenance"];
181187 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
182188 retval.publication_append_enabled = json["publicationAppendEnabled"];
189+ if (!intp(json["publicationDate"])) error("Expected integer");
183190 retval.publication_date = json["publicationDate"];
191+ if (!intp(json["publicationGroup"])) error("Expected integer");
184192 retval.publication_group = json["publicationGroup"];
185193 retval.publication_stage = json["publicationStage"];
186194 Query_from_JSON(json["query"]);
187195 retval.query = json["query"];
188196 retval.rights = json["rights"];
189197 retval.row_class = json["rowClass"];
198+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
190199 retval.rows_updated_at = json["rowsUpdatedAt"];
191200 retval.rows_updated_by = json["rowsUpdatedBy"];
192201 Owner_from_JSON(json["tableAuthor"]);
193202 retval.table_author = json["tableAuthor"];
203+ if (!intp(json["tableId"])) error("Expected integer");
194204 retval.table_id = json["tableId"];
205+ if (!intp(json["totalTimesRated"])) error("Expected integer");
195206 retval.total_times_rated = json["totalTimesRated"];
207+ if (!intp(json["viewCount"])) error("Expected integer");
196208 retval.view_count = json["viewCount"];
209+ if (!intp(json["viewLastModified"])) error("Expected integer");
197210 retval.view_last_modified = json["viewLastModified"];
198211 retval.view_type = json["viewType"];
199212
@@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) {
242255 retval.flags = json["flags"];
243256 Query_from_JSON(json["format"]);
244257 retval.format = 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 = TypeName_from_JSON(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/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
@@ -245,9 +245,11 @@ ChildData ChildData_from_JSON(mixed json) {
245245 retval.created_utc = (float)json["created_utc"];
246246 retval.distinguished = json["distinguished"];
247247 retval.domain = Domain_from_JSON(json["domain"]);
248+ if (!intp(json["downs"])) error("Expected integer");
248249 retval.downs = json["downs"];
249250 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
250251 retval.edited = json["edited"];
252+ if (!intp(json["gilded"])) error("Expected integer");
251253 retval.gilded = json["gilded"];
252254 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
253255 retval.hidden = json["hidden"];
@@ -270,6 +272,7 @@ ChildData ChildData_from_JSON(mixed json) {
270272 retval.media_embed = json["media_embed"];
271273 retval.mod_reports = json["mod_reports"];
272274 retval.name = json["name"];
275+ if (!intp(json["num_comments"])) error("Expected integer");
273276 retval.num_comments = json["num_comments"];
274277 retval.num_reports = json["num_reports"];
275278 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -281,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) {
281284 retval.report_reasons = json["report_reasons"];
282285 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
283286 retval.saved = json["saved"];
287+ if (!intp(json["score"])) error("Expected integer");
284288 retval.score = json["score"];
285289 retval.secure_media = json["secure_media"];
286290 MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -298,6 +302,7 @@ ChildData ChildData_from_JSON(mixed json) {
298302 retval.suggested_sort = json["suggested_sort"];
299303 retval.thumbnail = json["thumbnail"];
300304 retval.title = json["title"];
305+ if (!intp(json["ups"])) error("Expected integer");
301306 retval.ups = json["ups"];
302307 retval.url = json["url"];
303308 retval.user_reports = json["user_reports"];
Test case

test/inputs/json/misc/af2d1.json

1 generated file · +6 −0
Mpikedefault / TopLevel.pmod+6 −0
@@ -36,6 +36,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3636 Crs_from_JSON(json["crs"]);
3737 retval.crs = json["crs"];
3838 retval.features = json["features"];
39+ if (!intp(json["totalFeatures"])) error("Expected integer");
3940 retval.total_features = json["totalFeatures"];
4041 retval.type = json["type"];
4142
@@ -254,6 +255,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
254255 retval.asset_numb = json["asset_numb"];
255256 if (!has_index(json, "comments")) error("Missing required property");
256257 retval.comments = json["comments"];
258+ if (!intp(json["condition"])) error("Expected integer");
257259 retval.condition = json["condition"];
258260 if (!has_index(json, "constructi")) error("Missing required property");
259261 retval.constructi = json["constructi"];
@@ -269,6 +271,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
269271 retval.folder_num = json["folder_num"];
270272 if (!has_index(json, "funding_ba")) error("Missing required property");
271273 retval.funding_ba = FundingBa_from_JSON(json["funding_ba"]);
274+ if (!intp(json["historic_c"])) error("Expected integer");
272275 retval.historic_c = json["historic_c"];
273276 retval.inspection = json["inspection"];
274277 retval.inspectors = json["inspectors"];
@@ -276,8 +279,10 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
276279 if (!has_index(json, "level_accu")) error("Missing required property");
277280 retval.level_accu = LevelAccu_from_JSON(json["level_accu"]);
278281 retval.material = Material_from_JSON(json["material"]);
282+ if (!intp(json["mi_prinx"])) error("Expected integer");
279283 retval.mi_prinx = json["mi_prinx"];
280284 retval.mi_symbolo = MiSymbolo_from_JSON(json["mi_symbolo"]);
285+ if (!intp(json["number_lan"])) error("Expected integer");
281286 retval.number_lan = json["number_lan"];
282287 if (!has_index(json, "owner")) error("Missing required property");
283288 retval.owner = json["owner"];
@@ -285,6 +290,7 @@ FeatureProperties FeatureProperties_from_JSON(mixed json) {
285290 retval.positional = LevelAccu_from_JSON(json["positional"]);
286291 if (!has_index(json, "project_nu")) error("Missing required property");
287292 retval.project_nu = json["project_nu"];
293+ if (!intp(json["rec_id"])) error("Expected integer");
288294 retval.rec_id = json["rec_id"];
289295 if (!has_index(json, "record_cre")) error("Missing required property");
290296 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
@@ -255,9 +255,11 @@ ChildData ChildData_from_JSON(mixed json) {
255255 if (!has_index(json, "distinguished")) error("Missing required property");
256256 retval.distinguished = json["distinguished"];
257257 retval.domain = Domain_from_JSON(json["domain"]);
258+ if (!intp(json["downs"])) error("Expected integer");
258259 retval.downs = json["downs"];
259260 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
260261 retval.edited = json["edited"];
262+ if (!intp(json["gilded"])) error("Expected integer");
261263 retval.gilded = json["gilded"];
262264 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
263265 retval.hidden = json["hidden"];
@@ -280,6 +282,7 @@ ChildData ChildData_from_JSON(mixed json) {
280282 retval.media_embed = json["media_embed"];
281283 retval.mod_reports = json["mod_reports"];
282284 retval.name = json["name"];
285+ if (!intp(json["num_comments"])) error("Expected integer");
283286 retval.num_comments = json["num_comments"];
284287 retval.num_reports = json["num_reports"];
285288 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -294,6 +297,7 @@ ChildData ChildData_from_JSON(mixed json) {
294297 retval.report_reasons = json["report_reasons"];
295298 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
296299 retval.saved = json["saved"];
300+ if (!intp(json["score"])) error("Expected integer");
297301 retval.score = json["score"];
298302 if (!has_index(json, "secure_media")) error("Missing required property");
299303 if (has_index(json, "secure_media") && json["secure_media"] != Val.null) Media_from_JSON(json["secure_media"]);
@@ -312,9 +316,12 @@ ChildData ChildData_from_JSON(mixed json) {
312316 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
313317 retval.suggested_sort = json["suggested_sort"];
314318 retval.thumbnail = json["thumbnail"];
319+ if (!intp(json["thumbnail_height"])) error("Expected integer");
315320 retval.thumbnail_height = json["thumbnail_height"];
321+ if (!intp(json["thumbnail_width"])) error("Expected integer");
316322 retval.thumbnail_width = json["thumbnail_width"];
317323 retval.title = json["title"];
324+ if (!intp(json["ups"])) error("Expected integer");
318325 retval.ups = json["ups"];
319326 retval.url = json["url"];
320327 retval.user_reports = json["user_reports"];
@@ -399,16 +406,20 @@ Oembed Oembed_from_JSON(mixed json) {
399406 Oembed retval = Oembed();
400407
401408 retval.description = json["description"];
409+ if (!intp(json["height"])) error("Expected integer");
402410 retval.height = json["height"];
403411 retval.html = json["html"];
404412 retval.provider_name = json["provider_name"];
405413 retval.provider_url = json["provider_url"];
414+ if (!intp(json["thumbnail_height"])) error("Expected integer");
406415 retval.thumbnail_height = json["thumbnail_height"];
407416 retval.thumbnail_url = json["thumbnail_url"];
417+ if (!intp(json["thumbnail_width"])) error("Expected integer");
408418 retval.thumbnail_width = json["thumbnail_width"];
409419 retval.title = json["title"];
410420 retval.type = json["type"];
411421 retval.version = json["version"];
422+ if (!intp(json["width"])) error("Expected integer");
412423 retval.width = json["width"];
413424
414425 return retval;
@@ -527,8 +538,10 @@ class Source {
527538 Source Source_from_JSON(mixed json) {
528539 Source retval = Source();
529540
541+ if (!intp(json["height"])) error("Expected integer");
530542 retval.height = json["height"];
531543 retval.url = json["url"];
544+ if (!intp(json["width"])) error("Expected integer");
532545 retval.width = json["width"];
533546
534547 return retval;
Test case

test/inputs/json/misc/c0356.json

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

test/inputs/json/misc/c3303.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -430,6 +431,7 @@ Meta Meta_from_JSON(mixed json) {
430431
431432 retval.msg = json["msg"];
432433 retval.response_id = json["response_id"];
434+ if (!intp(json["status"])) error("Expected integer");
433435 retval.status = json["status"];
434436
435437 return retval;
@@ -454,8 +456,11 @@ class Pagination {
454456 Pagination Pagination_from_JSON(mixed json) {
455457 Pagination retval = Pagination();
456458
459+ if (!intp(json["count"])) error("Expected integer");
457460 retval.count = json["count"];
461+ if (!intp(json["offset"])) error("Expected integer");
458462 retval.offset = json["offset"];
463+ if (!intp(json["total_count"])) error("Expected integer");
459464 retval.total_count = json["total_count"];
460465
461466 return retval;
Test case

test/inputs/json/misc/c8c7e.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -120,9 +120,12 @@ class FluffyTopLevel {
120120 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
121121 FluffyTopLevel retval = FluffyTopLevel();
122122
123+ if (!intp(json["page"])) error("Expected integer");
123124 retval.page = json["page"];
125+ if (!intp(json["pages"])) error("Expected integer");
124126 retval.pages = json["pages"];
125127 retval.per_page = json["per_page"];
128+ if (!intp(json["total"])) error("Expected integer");
126129 retval.total = json["total"];
127130
128131 return retval;
Test case

test/inputs/json/misc/cda6c.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -120,9 +120,12 @@ class FluffyTopLevel {
120120 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
121121 FluffyTopLevel retval = FluffyTopLevel();
122122
123+ if (!intp(json["page"])) error("Expected integer");
123124 retval.page = json["page"];
125+ if (!intp(json["pages"])) error("Expected integer");
124126 retval.pages = json["pages"];
125127 retval.per_page = json["per_page"];
128+ if (!intp(json["total"])) error("Expected integer");
126129 retval.total = json["total"];
127130
128131 return retval;
Test case

test/inputs/json/misc/cf0d8.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 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,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 Facets_from_JSON(json["facets"]);
4445 retval.facets = json["facets"];
46+ if (!intp(json["limit"])) error("Expected integer");
4547 retval.limit = json["limit"];
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"];
Test case

test/inputs/json/misc/dbfb3.json

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -54,6 +54,7 @@ class Query {
5454 Query Query_from_JSON(mixed json) {
5555 Query retval = Query();
5656
57+ if (!intp(json["count"])) error("Expected integer");
5758 retval.count = json["count"];
5859 retval.created = json["created"];
5960 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
@@ -82,6 +82,7 @@ ResponseInfo ResponseInfo_from_JSON(mixed json) {
8282 ResponseInfo retval = ResponseInfo();
8383
8484 retval.developer_message = json["developerMessage"];
85+ if (!intp(json["status"])) error("Expected integer");
8586 retval.status = json["status"];
8687
8788 return retval;
@@ -106,8 +107,11 @@ class Resultset {
106107 Resultset Resultset_from_JSON(mixed json) {
107108 Resultset retval = Resultset();
108109
110+ if (!intp(json["count"])) error("Expected integer");
109111 retval.count = json["count"];
112+ if (!intp(json["page"])) error("Expected integer");
110113 retval.page = json["page"];
114+ if (!intp(json["pagesize"])) error("Expected integer");
111115 retval.pagesize = json["pagesize"];
112116
113117 return retval;
Test case

test/inputs/json/misc/df957.json

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

test/inputs/json/misc/e0ac7.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -424,6 +425,7 @@ Meta Meta_from_JSON(mixed json) {
424425
425426 retval.msg = json["msg"];
426427 retval.response_id = json["response_id"];
428+ if (!intp(json["status"])) error("Expected integer");
427429 retval.status = json["status"];
428430
429431 return retval;
@@ -448,8 +450,11 @@ class Pagination {
448450 Pagination Pagination_from_JSON(mixed json) {
449451 Pagination retval = Pagination();
450452
453+ if (!intp(json["count"])) error("Expected integer");
451454 retval.count = json["count"];
455+ if (!intp(json["offset"])) error("Expected integer");
452456 retval.offset = json["offset"];
457+ if (!intp(json["total_count"])) error("Expected integer");
453458 retval.total_count = json["total_count"];
454459
455460 return retval;
Test case

test/inputs/json/misc/e2915.json

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

test/inputs/json/misc/e53b5.json

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -120,9 +120,12 @@ class FluffyTopLevel {
120120 FluffyTopLevel FluffyTopLevel_from_JSON(mixed json) {
121121 FluffyTopLevel retval = FluffyTopLevel();
122122
123+ if (!intp(json["page"])) error("Expected integer");
123124 retval.page = json["page"];
125+ if (!intp(json["pages"])) error("Expected integer");
124126 retval.pages = json["pages"];
125127 retval.per_page = json["per_page"];
128+ if (!intp(json["total"])) error("Expected integer");
126129 retval.total = json["total"];
127130
128131 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"];
@@ -133,7 +136,9 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
133136 retval.name = json["name"];
134137 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
135138 retval.new_backend = json["newBackend"];
139+ if (!intp(json["numberOfComments"])) error("Expected integer");
136140 retval.number_of_comments = json["numberOfComments"];
141+ if (!intp(json["oid"])) error("Expected integer");
137142 retval.oid = json["oid"];
138143 Owner_from_JSON(json["owner"]);
139144 retval.owner = json["owner"];
@@ -141,6 +146,7 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
141146 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
142147 retval.publication_append_enabled = json["publicationAppendEnabled"];
143148 retval.publication_date = json["publicationDate"];
149+ if (!intp(json["publicationGroup"])) error("Expected integer");
144150 retval.publication_group = json["publicationGroup"];
145151 retval.publication_stage = PublicationStage_from_JSON(json["publicationStage"]);
146152 if (has_index(json, "ratings") && json["ratings"] != Val.null) Ratings_from_JSON(json["ratings"]);
@@ -153,10 +159,14 @@ TopLevelElement TopLevelElement_from_JSON(mixed json) {
153159 retval.rows_updated_by = RowsUpdatedBy_from_JSON(json["rowsUpdatedBy"]);
154160 TableAuthor_from_JSON(json["tableAuthor"]);
155161 retval.table_author = json["tableAuthor"];
162+ if (!intp(json["tableId"])) error("Expected integer");
156163 retval.table_id = json["tableId"];
157164 retval.tags = json["tags"];
165+ if (!intp(json["totalTimesRated"])) error("Expected integer");
158166 retval.total_times_rated = json["totalTimesRated"];
167+ if (!intp(json["viewCount"])) error("Expected integer");
159168 retval.view_count = json["viewCount"];
169+ if (!intp(json["viewLastModified"])) error("Expected integer");
160170 retval.view_last_modified = json["viewLastModified"];
161171 retval.view_type = ViewType_from_JSON(json["viewType"]);
162172
@@ -561,6 +571,7 @@ class TableColumnId {
561571 TableColumnId TableColumnId_from_JSON(mixed json) {
562572 TableColumnId retval = TableColumnId();
563573
574+ if (!intp(json["2819740"])) error("Expected integer");
564575 retval.the_2819740 = json["2819740"];
565576
566577 return retval;
@@ -730,6 +741,7 @@ class Field {
730741 Field Field_from_JSON(mixed json) {
731742 Field retval = Field();
732743
744+ if (!intp(json["tableColumnId"])) error("Expected integer");
733745 retval.table_column_id = json["tableColumnId"];
734746 retval.type = FieldType_from_JSON(json["type"]);
735747
@@ -961,6 +973,7 @@ class Ratings {
961973 Ratings Ratings_from_JSON(mixed json) {
962974 Ratings retval = Ratings();
963975
976+ if (!intp(json["rating"])) error("Expected integer");
964977 retval.rating = json["rating"];
965978
966979 return retval;
Test case

test/inputs/json/misc/f22f5.json

1 generated file · +5 −0
Mpikedefault / TopLevel.pmod+5 −0
@@ -245,9 +245,11 @@ ChildData ChildData_from_JSON(mixed json) {
245245 retval.created_utc = (float)json["created_utc"];
246246 retval.distinguished = json["distinguished"];
247247 retval.domain = json["domain"];
248+ if (!intp(json["downs"])) error("Expected integer");
248249 retval.downs = json["downs"];
249250 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
250251 retval.edited = json["edited"];
252+ if (!intp(json["gilded"])) error("Expected integer");
251253 retval.gilded = json["gilded"];
252254 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
253255 retval.hidden = json["hidden"];
@@ -270,6 +272,7 @@ ChildData ChildData_from_JSON(mixed json) {
270272 retval.media_embed = json["media_embed"];
271273 retval.mod_reports = json["mod_reports"];
272274 retval.name = json["name"];
275+ if (!intp(json["num_comments"])) error("Expected integer");
273276 retval.num_comments = json["num_comments"];
274277 retval.num_reports = json["num_reports"];
275278 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -281,6 +284,7 @@ ChildData ChildData_from_JSON(mixed json) {
281284 retval.report_reasons = json["report_reasons"];
282285 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
283286 retval.saved = json["saved"];
287+ if (!intp(json["score"])) error("Expected integer");
284288 retval.score = json["score"];
285289 retval.secure_media = json["secure_media"];
286290 MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -298,6 +302,7 @@ ChildData ChildData_from_JSON(mixed json) {
298302 retval.suggested_sort = json["suggested_sort"];
299303 retval.thumbnail = json["thumbnail"];
300304 retval.title = json["title"];
305+ if (!intp(json["ups"])) error("Expected integer");
301306 retval.ups = json["ups"];
302307 retval.url = json["url"];
303308 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
@@ -97,6 +97,7 @@ Datum Datum_from_JSON(mixed json) {
9797 Images_from_JSON(json["images"]);
9898 retval.images = json["images"];
9999 retval.import_datetime = json["import_datetime"];
100+ if (!intp(json["is_indexable"])) error("Expected integer");
100101 retval.is_indexable = json["is_indexable"];
101102 retval.rating = Rating_from_JSON(json["rating"]);
102103 retval.slug = json["slug"];
@@ -436,6 +437,7 @@ Meta Meta_from_JSON(mixed json) {
436437
437438 retval.msg = json["msg"];
438439 retval.response_id = json["response_id"];
440+ if (!intp(json["status"])) error("Expected integer");
439441 retval.status = json["status"];
440442
441443 return retval;
@@ -460,8 +462,11 @@ class Pagination {
460462 Pagination Pagination_from_JSON(mixed json) {
461463 Pagination retval = Pagination();
462464
465+ if (!intp(json["count"])) error("Expected integer");
463466 retval.count = json["count"];
467+ if (!intp(json["offset"])) error("Expected integer");
464468 retval.offset = json["offset"];
469+ if (!intp(json["total_count"])) error("Expected integer");
465470 retval.total_count = json["total_count"];
466471
467472 return retval;
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +18 −0
Mpikedefault / TopLevel.pmod+18 −0
@@ -150,11 +150,14 @@ class View {
150150 View View_from_JSON(mixed json) {
151151 View retval = View();
152152
153+ if (!intp(json["averageRating"])) error("Expected integer");
153154 retval.average_rating = json["averageRating"];
154155 retval.category = json["category"];
155156 retval.columns = json["columns"];
157+ if (!intp(json["createdAt"])) error("Expected integer");
156158 retval.created_at = json["createdAt"];
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,6 +166,7 @@ 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 License_from_JSON(json["license"]);
168172 retval.license = json["license"];
@@ -173,27 +177,36 @@ View View_from_JSON(mixed json) {
173177 retval.name = json["name"];
174178 if (json["newBackend"] != Standards.JSON.true && json["newBackend"] != Standards.JSON.false) error("Expected bool");
175179 retval.new_backend = json["newBackend"];
180+ if (!intp(json["numberOfComments"])) error("Expected integer");
176181 retval.number_of_comments = json["numberOfComments"];
182+ if (!intp(json["oid"])) error("Expected integer");
177183 retval.oid = json["oid"];
178184 Owner_from_JSON(json["owner"]);
179185 retval.owner = json["owner"];
180186 retval.provenance = json["provenance"];
181187 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
182188 retval.publication_append_enabled = json["publicationAppendEnabled"];
189+ if (!intp(json["publicationDate"])) error("Expected integer");
183190 retval.publication_date = json["publicationDate"];
191+ if (!intp(json["publicationGroup"])) error("Expected integer");
184192 retval.publication_group = json["publicationGroup"];
185193 retval.publication_stage = json["publicationStage"];
186194 Query_from_JSON(json["query"]);
187195 retval.query = json["query"];
188196 retval.rights = json["rights"];
189197 retval.row_class = json["rowClass"];
198+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
190199 retval.rows_updated_at = json["rowsUpdatedAt"];
191200 retval.rows_updated_by = json["rowsUpdatedBy"];
192201 Owner_from_JSON(json["tableAuthor"]);
193202 retval.table_author = json["tableAuthor"];
203+ if (!intp(json["tableId"])) error("Expected integer");
194204 retval.table_id = json["tableId"];
205+ if (!intp(json["totalTimesRated"])) error("Expected integer");
195206 retval.total_times_rated = json["totalTimesRated"];
207+ if (!intp(json["viewCount"])) error("Expected integer");
196208 retval.view_count = json["viewCount"];
209+ if (!intp(json["viewLastModified"])) error("Expected integer");
197210 retval.view_last_modified = json["viewLastModified"];
198211 retval.view_type = json["viewType"];
199212
@@ -242,8 +255,10 @@ Column Column_from_JSON(mixed json) {
242255 retval.flags = json["flags"];
243256 Query_from_JSON(json["format"]);
244257 retval.format = 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 = TypeName_from_JSON(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/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
@@ -50,7 +50,9 @@ class Response {
5050 Response Response_from_JSON(mixed json) {
5151 Response retval = Response();
5252
53+ if (!intp(json["player_count"])) error("Expected integer");
5354 retval.player_count = json["player_count"];
55+ if (!intp(json["result"])) error("Expected integer");
5456 retval.result = json["result"];
5557
5658 return retval;
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +21 −0
Mpikedefault / TopLevel.pmod+21 −0
@@ -151,12 +151,15 @@ View View_from_JSON(mixed json) {
151151 View retval = View();
152152
153153 retval.attribution = json["attribution"];
154+ if (!intp(json["averageRating"])) error("Expected integer");
154155 retval.average_rating = json["averageRating"];
155156 retval.category = json["category"];
156157 retval.columns = json["columns"];
158+ if (!intp(json["createdAt"])) error("Expected integer");
157159 retval.created_at = json["createdAt"];
158160 retval.description = json["description"];
159161 retval.display_type = json["displayType"];
162+ if (!intp(json["downloadCount"])) error("Expected integer");
160163 retval.download_count = json["downloadCount"];
161164 retval.flags = json["flags"];
162165 retval.grants = json["grants"];
@@ -165,6 +168,7 @@ View View_from_JSON(mixed json) {
165168 if (json["hideFromDataJson"] != Standards.JSON.true && json["hideFromDataJson"] != Standards.JSON.false) error("Expected bool");
166169 retval.hide_from_data_json = json["hideFromDataJson"];
167170 retval.id = json["id"];
171+ if (!intp(json["indexUpdatedAt"])) error("Expected integer");
168172 retval.index_updated_at = json["indexUpdatedAt"];
169173 retval.locale = json["locale"];
170174 ViewMetadata_from_JSON(json["metadata"]);
@@ -172,27 +176,36 @@ View View_from_JSON(mixed json) {
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 Owner_from_JSON(json["owner"]);
178184 retval.owner = json["owner"];
179185 retval.provenance = json["provenance"];
180186 if (json["publicationAppendEnabled"] != Standards.JSON.true && json["publicationAppendEnabled"] != Standards.JSON.false) error("Expected bool");
181187 retval.publication_append_enabled = json["publicationAppendEnabled"];
188+ if (!intp(json["publicationDate"])) error("Expected integer");
182189 retval.publication_date = json["publicationDate"];
190+ if (!intp(json["publicationGroup"])) error("Expected integer");
183191 retval.publication_group = json["publicationGroup"];
184192 retval.publication_stage = json["publicationStage"];
185193 Query_from_JSON(json["query"]);
186194 retval.query = json["query"];
187195 retval.rights = json["rights"];
196+ if (!intp(json["rowsUpdatedAt"])) error("Expected integer");
188197 retval.rows_updated_at = json["rowsUpdatedAt"];
189198 retval.rows_updated_by = json["rowsUpdatedBy"];
190199 Owner_from_JSON(json["tableAuthor"]);
191200 retval.table_author = json["tableAuthor"];
201+ if (!intp(json["tableId"])) error("Expected integer");
192202 retval.table_id = json["tableId"];
193203 retval.tags = json["tags"];
204+ if (!intp(json["totalTimesRated"])) error("Expected integer");
194205 retval.total_times_rated = json["totalTimesRated"];
206+ if (!intp(json["viewCount"])) error("Expected integer");
195207 retval.view_count = json["viewCount"];
208+ if (!intp(json["viewLastModified"])) error("Expected integer");
196209 retval.view_last_modified = json["viewLastModified"];
197210 retval.view_type = json["viewType"];
198211
@@ -244,8 +257,10 @@ Column Column_from_JSON(mixed json) {
244257 retval.flags = json["flags"];
245258 Format_from_JSON(json["format"]);
246259 retval.format = json["format"];
260+ if (!intp(json["id"])) error("Expected integer");
247261 retval.id = json["id"];
248262 retval.name = json["name"];
263+ if (!intp(json["position"])) error("Expected integer");
249264 retval.position = json["position"];
250265 retval.render_type_name = TypeName_from_JSON(json["renderTypeName"]);
251266 retval.table_column_id = json["tableColumnId"];
@@ -283,7 +298,9 @@ CachedContents CachedContents_from_JSON(mixed json) {
283298
284299 retval.average = json["average"];
285300 retval.largest = json["largest"];
301+ if (!intp(json["non_null"])) error("Expected integer");
286302 retval.non_null = json["non_null"];
303+ if (!intp(json["null"])) error("Expected integer");
287304 retval.null = json["null"];
288305 retval.smallest = json["smallest"];
289306 retval.sum = json["sum"];
@@ -309,6 +326,7 @@ class Top {
309326 Top Top_from_JSON(mixed json) {
310327 Top retval = Top();
311328
329+ if (!intp(json["count"])) error("Expected integer");
312330 retval.count = json["count"];
313331 retval.item = json["item"];
314332
@@ -688,6 +706,7 @@ class TableColumnId {
688706 TableColumnId TableColumnId_from_JSON(mixed json) {
689707 TableColumnId retval = TableColumnId();
690708
709+ if (!intp(json["703610"])) error("Expected integer");
691710 retval.the_703610 = json["703610"];
692711
693712 return retval;
@@ -712,6 +731,7 @@ FilterConditionMetadata FilterConditionMetadata_from_JSON(mixed json) {
712731
713732 if (json["advanced"] != Standards.JSON.true && json["advanced"] != Standards.JSON.false) error("Expected bool");
714733 retval.advanced = json["advanced"];
734+ if (!intp(json["unifiedVersion"])) error("Expected integer");
715735 retval.unified_version = json["unifiedVersion"];
716736
717737 return retval;
@@ -906,6 +926,7 @@ class Expression {
906926 Expression Expression_from_JSON(mixed json) {
907927 Expression retval = Expression();
908928
929+ if (!intp(json["columnId"])) error("Expected integer");
909930 retval.column_id = json["columnId"];
910931 retval.type = json["type"];
Test case

test/inputs/json/misc/fd329.json

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

test/inputs/json/priority/bug427.json

1 generated file · +55 −0
Mpikedefault / TopLevel.pmod+55 −0
@@ -41,7 +41,9 @@ TopLevel TopLevel_from_JSON(mixed json) {
4141 GetSignatureFlags_from_JSON(json["flags"]);
4242 retval.flags = json["flags"];
4343 retval.groups = json["groups"];
44+ if (!intp(json["id"])) error("Expected integer");
4445 retval.id = json["id"];
46+ if (!intp(json["kind"])) error("Expected integer");
4547 retval.kind = json["kind"];
4648 retval.name = json["name"];
4749
@@ -87,7 +89,9 @@ TopLevelChild TopLevelChild_from_JSON(mixed json) {
8789 PurpleFlags_from_JSON(json["flags"]);
8890 retval.flags = json["flags"];
8991 retval.groups = json["groups"];
92+ if (!intp(json["id"])) error("Expected integer");
9093 retval.id = json["id"];
94+ if (!intp(json["kind"])) error("Expected integer");
9195 retval.kind = json["kind"];
9296 retval.kind_string = TentacledKindString_from_JSON(json["kindString"]);
9397 retval.name = json["name"];
@@ -153,9 +157,11 @@ PurpleChild PurpleChild_from_JSON(mixed json) {
153157 IndecentFlags_from_JSON(json["flags"]);
154158 retval.flags = json["flags"];
155159 retval.groups = json["groups"];
160+ if (!intp(json["id"])) error("Expected integer");
156161 retval.id = json["id"];
157162 retval.implemented_by = json["implementedBy"];
158163 retval.implemented_types = json["implementedTypes"];
164+ if (!intp(json["kind"])) error("Expected integer");
159165 retval.kind = json["kind"];
160166 retval.kind_string = FluffyKindString_from_JSON(json["kindString"]);
161167 retval.name = json["name"];
@@ -224,11 +230,13 @@ FluffyChild FluffyChild_from_JSON(mixed json) {
224230 if (has_index(json, "getSignature") && json["getSignature"] != Val.null) GetSignature_from_JSON(json["getSignature"]);
225231 retval.get_signature = json["getSignature"];
226232 retval.groups = json["groups"];
233+ if (!intp(json["id"])) error("Expected integer");
227234 retval.id = json["id"];
228235 if (has_index(json, "implementationOf") && json["implementationOf"] != Val.null) ExtendedBy_from_JSON(json["implementationOf"]);
229236 retval.implementation_of = json["implementationOf"];
230237 if (has_index(json, "inheritedFrom") && json["inheritedFrom"] != Val.null) ExtendedBy_from_JSON(json["inheritedFrom"]);
231238 retval.inherited_from = json["inheritedFrom"];
239+ if (!intp(json["kind"])) error("Expected integer");
232240 retval.kind = json["kind"];
233241 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
234242 retval.name = json["name"];
@@ -282,7 +290,9 @@ TentacledChild TentacledChild_from_JSON(mixed json) {
282290 retval.default_value = json["defaultValue"];
283291 PurpleFlags_from_JSON(json["flags"]);
284292 retval.flags = json["flags"];
293+ if (!intp(json["id"])) error("Expected integer");
285294 retval.id = json["id"];
295+ if (!intp(json["kind"])) error("Expected integer");
286296 retval.kind = json["kind"];
287297 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
288298 retval.name = json["name"];
@@ -383,7 +393,9 @@ PurpleSignature PurpleSignature_from_JSON(mixed json) {
383393 retval.comment = json["comment"];
384394 GetSignatureFlags_from_JSON(json["flags"]);
385395 retval.flags = json["flags"];
396+ if (!intp(json["id"])) error("Expected integer");
386397 retval.id = json["id"];
398+ if (!intp(json["kind"])) error("Expected integer");
387399 retval.kind = json["kind"];
388400 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
389401 retval.name = json["name"];
@@ -479,7 +491,9 @@ IndexSignatureElement IndexSignatureElement_from_JSON(mixed json) {
479491
480492 GetSignatureFlags_from_JSON(json["flags"]);
481493 retval.flags = json["flags"];
494+ if (!intp(json["id"])) error("Expected integer");
482495 retval.id = json["id"];
496+ if (!intp(json["kind"])) error("Expected integer");
483497 retval.kind = json["kind"];
484498 retval.kind_string = json["kindString"];
485499 retval.name = json["name"];
@@ -550,7 +564,9 @@ GetSignatureChild GetSignatureChild_from_JSON(mixed json) {
550564 retval.comment = json["comment"];
551565 FluffyFlags_from_JSON(json["flags"]);
552566 retval.flags = json["flags"];
567+ if (!intp(json["id"])) error("Expected integer");
553568 retval.id = json["id"];
569+ if (!intp(json["kind"])) error("Expected integer");
554570 retval.kind = json["kind"];
555571 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
556572 retval.name = json["name"];
@@ -609,7 +625,9 @@ GetSignature GetSignature_from_JSON(mixed json) {
609625 GetSignatureFlags_from_JSON(json["flags"]);
610626 retval.flags = json["flags"];
611627 retval.groups = json["groups"];
628+ if (!intp(json["id"])) error("Expected integer");
612629 retval.id = json["id"];
630+ if (!intp(json["kind"])) error("Expected integer");
613631 retval.kind = json["kind"];
614632 retval.kind_string = json["kindString"];
615633 retval.name = json["name"];
@@ -736,8 +754,10 @@ class Source {
736754 Source Source_from_JSON(mixed json) {
737755 Source retval = Source();
738756
757+ if (!intp(json["character"])) error("Expected integer");
739758 retval.character = json["character"];
740759 retval.file_name = FileName_from_JSON(json["fileName"]);
760+ if (!intp(json["line"])) error("Expected integer");
741761 retval.line = json["line"];
742762
743763 return retval;
@@ -809,6 +829,7 @@ Group Group_from_JSON(mixed json) {
809829 Group retval = Group();
810830
811831 retval.children = json["children"];
832+ if (!intp(json["kind"])) error("Expected integer");
812833 retval.kind = json["kind"];
813834 retval.title = json["title"];
814835
@@ -846,7 +867,9 @@ GetSignatureParameter GetSignatureParameter_from_JSON(mixed json) {
846867 retval.comment = json["comment"];
847868 TentacledFlags_from_JSON(json["flags"]);
848869 retval.flags = json["flags"];
870+ if (!intp(json["id"])) error("Expected integer");
849871 retval.id = json["id"];
872+ if (!intp(json["kind"])) error("Expected integer");
850873 retval.kind = json["kind"];
851874 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
852875 retval.name = json["name"];
@@ -998,7 +1021,9 @@ PurpleDeclaration PurpleDeclaration_from_JSON(mixed json) {
9981021 GetSignatureFlags_from_JSON(json["flags"]);
9991022 retval.flags = json["flags"];
10001023 retval.groups = json["groups"];
1024+ if (!intp(json["id"])) error("Expected integer");
10011025 retval.id = json["id"];
1026+ if (!intp(json["kind"])) error("Expected integer");
10021027 retval.kind = json["kind"];
10031028 retval.kind_string = json["kindString"];
10041029 retval.name = json["name"];
@@ -1204,11 +1229,13 @@ FluffySignature FluffySignature_from_JSON(mixed json) {
12041229 retval.comment = json["comment"];
12051230 IndigoFlags_from_JSON(json["flags"]);
12061231 retval.flags = json["flags"];
1232+ if (!intp(json["id"])) error("Expected integer");
12071233 retval.id = json["id"];
12081234 if (has_index(json, "implementationOf") && json["implementationOf"] != Val.null) ExtendedBy_from_JSON(json["implementationOf"]);
12091235 retval.implementation_of = json["implementationOf"];
12101236 if (has_index(json, "inheritedFrom") && json["inheritedFrom"] != Val.null) ExtendedBy_from_JSON(json["inheritedFrom"]);
12111237 retval.inherited_from = json["inheritedFrom"];
1238+ if (!intp(json["kind"])) error("Expected integer");
12121239 retval.kind = json["kind"];
12131240 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
12141241 retval.name = json["name"];
@@ -1276,7 +1303,9 @@ PurpleParameter PurpleParameter_from_JSON(mixed json) {
12761303 retval.comment = json["comment"];
12771304 GetSignatureFlags_from_JSON(json["flags"]);
12781305 retval.flags = json["flags"];
1306+ if (!intp(json["id"])) error("Expected integer");
12791307 retval.id = json["id"];
1308+ if (!intp(json["kind"])) error("Expected integer");
12801309 retval.kind = json["kind"];
12811310 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
12821311 retval.name = json["name"];
@@ -1414,9 +1443,11 @@ FluffyDeclaration FluffyDeclaration_from_JSON(mixed json) {
14141443 GetSignatureFlags_from_JSON(json["flags"]);
14151444 retval.flags = json["flags"];
14161445 retval.groups = json["groups"];
1446+ if (!intp(json["id"])) error("Expected integer");
14171447 retval.id = json["id"];
14181448 if (has_index(json, "indexSignature") && json["indexSignature"] != Val.null) IndexSignature_from_JSON(json["indexSignature"]);
14191449 retval.index_signature = json["indexSignature"];
1450+ if (!intp(json["kind"])) error("Expected integer");
14201451 retval.kind = json["kind"];
14211452 retval.kind_string = json["kindString"];
14221453 retval.name = json["name"];
@@ -1459,7 +1490,9 @@ StickyChild StickyChild_from_JSON(mixed json) {
14591490 retval.comment = json["comment"];
14601491 FluffyFlags_from_JSON(json["flags"]);
14611492 retval.flags = json["flags"];
1493+ if (!intp(json["id"])) error("Expected integer");
14621494 retval.id = json["id"];
1495+ if (!intp(json["kind"])) error("Expected integer");
14631496 retval.kind = json["kind"];
14641497 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
14651498 retval.name = json["name"];
@@ -1529,7 +1562,9 @@ IndexSignature IndexSignature_from_JSON(mixed json) {
15291562
15301563 GetSignatureFlags_from_JSON(json["flags"]);
15311564 retval.flags = json["flags"];
1565+ if (!intp(json["id"])) error("Expected integer");
15321566 retval.id = json["id"];
1567+ if (!intp(json["kind"])) error("Expected integer");
15331568 retval.kind = json["kind"];
15341569 retval.kind_string = json["kindString"];
15351570 retval.name = json["name"];
@@ -1597,7 +1632,9 @@ TentacledSignature TentacledSignature_from_JSON(mixed json) {
15971632 retval.comment = json["comment"];
15981633 GetSignatureFlags_from_JSON(json["flags"]);
15991634 retval.flags = json["flags"];
1635+ if (!intp(json["id"])) error("Expected integer");
16001636 retval.id = json["id"];
1637+ if (!intp(json["kind"])) error("Expected integer");
16011638 retval.kind = json["kind"];
16021639 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
16031640 retval.name = json["name"];
@@ -1664,7 +1701,9 @@ FluffyParameter FluffyParameter_from_JSON(mixed json) {
16641701 retval.comment = json["comment"];
16651702 FluffyFlags_from_JSON(json["flags"]);
16661703 retval.flags = json["flags"];
1704+ if (!intp(json["id"])) error("Expected integer");
16671705 retval.id = json["id"];
1706+ if (!intp(json["kind"])) error("Expected integer");
16681707 retval.kind = json["kind"];
16691708 retval.kind_string = json["kindString"];
16701709 retval.name = json["name"];
@@ -1790,7 +1829,9 @@ StickySignature StickySignature_from_JSON(mixed json) {
17901829 retval.comment = json["comment"];
17911830 IndigoFlags_from_JSON(json["flags"]);
17921831 retval.flags = json["flags"];
1832+ if (!intp(json["id"])) error("Expected integer");
17931833 retval.id = json["id"];
1834+ if (!intp(json["kind"])) error("Expected integer");
17941835 retval.kind = json["kind"];
17951836 retval.kind_string = SignatureKindString_from_JSON(json["kindString"]);
17961837 retval.name = json["name"];
@@ -1838,7 +1879,9 @@ TentacledParameter TentacledParameter_from_JSON(mixed json) {
18381879 retval.default_value = json["defaultValue"];
18391880 TentacledFlags_from_JSON(json["flags"]);
18401881 retval.flags = json["flags"];
1882+ if (!intp(json["id"])) error("Expected integer");
18411883 retval.id = json["id"];
1884+ if (!intp(json["kind"])) error("Expected integer");
18421885 retval.kind = json["kind"];
18431886 retval.kind_string = ParameterKindString_from_JSON(json["kindString"]);
18441887 retval.name = json["name"];
@@ -1923,9 +1966,11 @@ TentacledDeclaration TentacledDeclaration_from_JSON(mixed json) {
19231966 GetSignatureFlags_from_JSON(json["flags"]);
19241967 retval.flags = json["flags"];
19251968 retval.groups = json["groups"];
1969+ if (!intp(json["id"])) error("Expected integer");
19261970 retval.id = json["id"];
19271971 if (has_index(json, "indexSignature") && json["indexSignature"] != Val.null) IndexSignatureElement_from_JSON(json["indexSignature"]);
19281972 retval.index_signature = json["indexSignature"];
1973+ if (!intp(json["kind"])) error("Expected integer");
19291974 retval.kind = json["kind"];
19301975 retval.kind_string = json["kindString"];
19311976 retval.name = json["name"];
@@ -1971,7 +2016,9 @@ IndigoChild IndigoChild_from_JSON(mixed json) {
19712016 retval.default_value = json["defaultValue"];
19722017 FluffyFlags_from_JSON(json["flags"]);
19732018 retval.flags = json["flags"];
2019+ if (!intp(json["id"])) error("Expected integer");
19742020 retval.id = json["id"];
2021+ if (!intp(json["kind"])) error("Expected integer");
19752022 retval.kind = json["kind"];
19762023 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
19772024 retval.name = json["name"];
@@ -2096,7 +2143,9 @@ StickyDeclaration StickyDeclaration_from_JSON(mixed json) {
20962143 GetSignatureFlags_from_JSON(json["flags"]);
20972144 retval.flags = json["flags"];
20982145 retval.groups = json["groups"];
2146+ if (!intp(json["id"])) error("Expected integer");
20992147 retval.id = json["id"];
2148+ if (!intp(json["kind"])) error("Expected integer");
21002149 retval.kind = json["kind"];
21012150 retval.kind_string = json["kindString"];
21022151 retval.name = json["name"];
@@ -2135,7 +2184,9 @@ IndecentChild IndecentChild_from_JSON(mixed json) {
21352184
21362185 FluffyFlags_from_JSON(json["flags"]);
21372186 retval.flags = json["flags"];
2187+ if (!intp(json["id"])) error("Expected integer");
21382188 retval.id = json["id"];
2189+ if (!intp(json["kind"])) error("Expected integer");
21392190 retval.kind = json["kind"];
21402191 retval.kind_string = PurpleKindString_from_JSON(json["kindString"]);
21412192 retval.name = json["name"];
@@ -2208,7 +2259,9 @@ IndigoDeclaration IndigoDeclaration_from_JSON(mixed json) {
22082259 GetSignatureFlags_from_JSON(json["flags"]);
22092260 retval.flags = json["flags"];
22102261 retval.groups = json["groups"];
2262+ if (!intp(json["id"])) error("Expected integer");
22112263 retval.id = json["id"];
2264+ if (!intp(json["kind"])) error("Expected integer");
22122265 retval.kind = json["kind"];
22132266 retval.kind_string = json["kindString"];
22142267 retval.name = json["name"];
@@ -2272,7 +2325,9 @@ TypeParameter TypeParameter_from_JSON(mixed json) {
22722325 retval.comment = json["comment"];
22732326 GetSignatureFlags_from_JSON(json["flags"]);
22742327 retval.flags = json["flags"];
2328+ if (!intp(json["id"])) error("Expected integer");
22752329 retval.id = json["id"];
2330+ if (!intp(json["kind"])) error("Expected integer");
22762331 retval.kind = json["kind"];
22772332 retval.kind_string = json["kindString"];
22782333 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"];
@@ -371,6 +372,7 @@ CimeliaClass CimeliaClass_from_JSON(mixed json) {
371372 CimeliaClass retval = CimeliaClass();
372373
373374 retval.catharticalness = (float)json["catharticalness"];
375+ if (!intp(json["Chirotherium"])) error("Expected integer");
374376 retval.chirotherium = json["Chirotherium"];
375377 retval.disdiapason = json["disdiapason"];
376378 if (json["homocerc"] != Standards.JSON.true && json["homocerc"] != Standards.JSON.false) error("Expected bool");
@@ -1304,6 +1306,7 @@ Interacinar Interacinar_from_JSON(mixed json) {
13041306 if (json["benefactorship"] != Standards.JSON.true && json["benefactorship"] != Standards.JSON.false) error("Expected bool");
13051307 retval.benefactorship = json["benefactorship"];
13061308 retval.triseriatim = json["triseriatim"];
1309+ if (!intp(json["tubbing"])) error("Expected integer");
13071310 retval.tubbing = json["tubbing"];
13081311 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
@@ -388,6 +388,7 @@ QuebrachineClass QuebrachineClass_from_JSON(mixed json) {
388388 QuebrachineClass retval = QuebrachineClass();
389389
390390 retval.catharticalness = (float)json["catharticalness"];
391+ if (!intp(json["Chirotherium"])) error("Expected integer");
391392 retval.chirotherium = json["Chirotherium"];
392393 retval.disdiapason = json["disdiapason"];
393394 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
@@ -39,6 +39,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
3939 retval.also = json["also"];
4040 if (json["bar"] != Standards.JSON.true && json["bar"] != Standards.JSON.false) error("Expected bool");
4141 retval.bar = json["bar"];
42+ if (!intp(json["foo"])) error("Expected integer");
4243 retval.foo = json["foo"];
4344 retval.moo = (float)json["moo"];
4445 retval.quux = json["quux"];
Test case

test/inputs/json/priority/identifiers.json

1 generated file · +8 −0
Mpikedefault / TopLevel.pmod+8 −0
@@ -45,6 +45,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
4545 retval.foo = json["foo"];
4646 ThisIsAToughOne_from_JSON(json["ThisIsA\U0001f61cTough\"\n\nOne"]);
4747 retval.this_is_a_tough_one = json["ThisIsA\U0001f61cTough\"\n\nOne"];
48+ if (!intp(json["!"])) error("Expected integer");
4849 retval.top_level = json["!"];
4950 EmptyClass_from_JSON(json["Empty"]);
5051 retval.top_level_empty = json["Empty"];
@@ -67,6 +68,7 @@ class TopLevelBla {
6768 TopLevelBla TopLevelBla_from_JSON(mixed json) {
6869 TopLevelBla retval = TopLevelBla();
6970
71+ if (!intp(json["bar"])) error("Expected integer");
7072 retval.bar = json["bar"];
7173
7274 return retval;
@@ -87,6 +89,7 @@ class Empty {
8789 Empty Empty_from_JSON(mixed json) {
8890 Empty retval = Empty();
8991
92+ if (!intp(json["x"])) error("Expected integer");
9093 retval.x = json["x"];
9194
9295 return retval;
@@ -113,7 +116,9 @@ Foo Foo_from_JSON(mixed json) {
113116
114117 FooBla_from_JSON(json["bla"]);
115118 retval.bla = json["bla"];
119+ if (!intp(json["_"])) error("Expected integer");
116120 retval.empty = json["_"];
121+ if (!intp(json["__"])) error("Expected integer");
117122 retval.foo = json["__"];
118123
119124 return retval;
@@ -152,7 +157,9 @@ class ThisIsAToughOne {
152157 ThisIsAToughOne ThisIsAToughOne_from_JSON(mixed json) {
153158 ThisIsAToughOne retval = ThisIsAToughOne();
154159
160+ if (!intp(json["\n\n\n"])) error("Expected integer");
155161 retval.empty = json["\n\n\n"];
162+ if (!intp(json["\""])) error("Expected integer");
156163 retval.this_is_a_tough_one = json["\""];
157164
158165 return retval;
@@ -173,6 +180,7 @@ class EmptyClass {
173180 EmptyClass EmptyClass_from_JSON(mixed json) {
174181 EmptyClass retval = EmptyClass();
175182
183+ if (!intp(json["y"])) error("Expected integer");
176184 retval.y = json["y"];
177185
178186 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 Obj1_from_JSON(json["obj1"]);
4243 retval.obj1 = json["obj1"];
@@ -299,6 +300,7 @@ Obj1 Obj1_from_JSON(mixed json) {
299300 retval.decltype = json["decltype"];
300301 DecodeString_from_JSON(json["decode_string"]);
301302 retval.decode_string = json["decode_string"];
303+ if (!intp(json["dummy"])) error("Expected integer");
302304 retval.dummy = json["dummy"];
303305 Empty_from_JSON(json["_"]);
304306 retval.empty = json["_"];
@@ -347,6 +349,7 @@ class Abstract {
347349 Abstract Abstract_from_JSON(mixed json) {
348350 Abstract retval = Abstract();
349351
352+ if (!intp(json["abstract"])) error("Expected integer");
350353 retval.abstract = json["abstract"];
351354
352355 return retval;
@@ -367,6 +370,7 @@ class Alignas {
367370 Alignas Alignas_from_JSON(mixed json) {
368371 Alignas retval = Alignas();
369372
373+ if (!intp(json["alignas"])) error("Expected integer");
370374 retval.alignas = json["alignas"];
371375
372376 return retval;
@@ -387,6 +391,7 @@ class Alignof {
387391 Alignof Alignof_from_JSON(mixed json) {
388392 Alignof retval = Alignof();
389393
394+ if (!intp(json["alignof"])) error("Expected integer");
390395 retval.alignof = json["alignof"];
391396
392397 return retval;
@@ -407,6 +412,7 @@ class And {
407412 And And_from_JSON(mixed json) {
408413 And retval = And();
409414
415+ if (!intp(json["and"])) error("Expected integer");
410416 retval.and = json["and"];
411417
412418 return retval;
@@ -427,6 +433,7 @@ class AndEq {
427433 AndEq AndEq_from_JSON(mixed json) {
428434 AndEq retval = AndEq();
429435
436+ if (!intp(json["and_eq"])) error("Expected integer");
430437 retval.and_eq = json["and_eq"];
431438
432439 return retval;
@@ -447,6 +454,7 @@ class Any {
447454 Any Any_from_JSON(mixed json) {
448455 Any retval = Any();
449456
457+ if (!intp(json["Any"])) error("Expected integer");
450458 retval.any = json["Any"];
451459
452460 return retval;
@@ -467,6 +475,7 @@ class As {
467475 As As_from_JSON(mixed json) {
468476 As retval = As();
469477
478+ if (!intp(json["as"])) error("Expected integer");
470479 retval.as = json["as"];
471480
472481 return retval;
@@ -487,6 +496,7 @@ class Asm {
487496 Asm Asm_from_JSON(mixed json) {
488497 Asm retval = Asm();
489498
499+ if (!intp(json["asm"])) error("Expected integer");
490500 retval.asm = json["asm"];
491501
492502 return retval;
@@ -507,6 +517,7 @@ class Assert {
507517 Assert Assert_from_JSON(mixed json) {
508518 Assert retval = Assert();
509519
520+ if (!intp(json["assert"])) error("Expected integer");
510521 retval.assert = json["assert"];
511522
512523 return retval;
@@ -527,6 +538,7 @@ class Associatedtype {
527538 Associatedtype Associatedtype_from_JSON(mixed json) {
528539 Associatedtype retval = Associatedtype();
529540
541+ if (!intp(json["associatedtype"])) error("Expected integer");
530542 retval.associatedtype = json["associatedtype"];
531543
532544 return retval;
@@ -547,6 +559,7 @@ class Associativity {
547559 Associativity Associativity_from_JSON(mixed json) {
548560 Associativity retval = Associativity();
549561
562+ if (!intp(json["associativity"])) error("Expected integer");
550563 retval.associativity = json["associativity"];
551564
552565 return retval;
@@ -567,6 +580,7 @@ class Async {
567580 Async Async_from_JSON(mixed json) {
568581 Async retval = Async();
569582
583+ if (!intp(json["async"])) error("Expected integer");
570584 retval.async = json["async"];
571585
572586 return retval;
@@ -587,6 +601,7 @@ class Atomic {
587601 Atomic Atomic_from_JSON(mixed json) {
588602 Atomic retval = Atomic();
589603
604+ if (!intp(json["atomic"])) error("Expected integer");
590605 retval.atomic = json["atomic"];
591606
592607 return retval;
@@ -607,6 +622,7 @@ class AtomicCancel {
607622 AtomicCancel AtomicCancel_from_JSON(mixed json) {
608623 AtomicCancel retval = AtomicCancel();
609624
625+ if (!intp(json["atomic_cancel"])) error("Expected integer");
610626 retval.atomic_cancel = json["atomic_cancel"];
611627
612628 return retval;
@@ -627,6 +643,7 @@ class AtomicCommit {
627643 AtomicCommit AtomicCommit_from_JSON(mixed json) {
628644 AtomicCommit retval = AtomicCommit();
629645
646+ if (!intp(json["atomic_commit"])) error("Expected integer");
630647 retval.atomic_commit = json["atomic_commit"];
631648
632649 return retval;
@@ -647,6 +664,7 @@ class AtomicNoexcept {
647664 AtomicNoexcept AtomicNoexcept_from_JSON(mixed json) {
648665 AtomicNoexcept retval = AtomicNoexcept();
649666
667+ if (!intp(json["atomic_noexcept"])) error("Expected integer");
650668 retval.atomic_noexcept = json["atomic_noexcept"];
651669
652670 return retval;
@@ -667,6 +685,7 @@ class Await {
667685 Await Await_from_JSON(mixed json) {
668686 Await retval = Await();
669687
688+ if (!intp(json["await"])) error("Expected integer");
670689 retval.await = json["await"];
671690
672691 return retval;
@@ -687,6 +706,7 @@ class Base {
687706 Base Base_from_JSON(mixed json) {
688707 Base retval = Base();
689708
709+ if (!intp(json["base"])) error("Expected integer");
690710 retval.base = json["base"];
691711
692712 return retval;
@@ -707,6 +727,7 @@ class Bitand {
707727 Bitand Bitand_from_JSON(mixed json) {
708728 Bitand retval = Bitand();
709729
730+ if (!intp(json["bitand"])) error("Expected integer");
710731 retval.bitand = json["bitand"];
711732
712733 return retval;
@@ -727,6 +748,7 @@ class Bitor {
727748 Bitor Bitor_from_JSON(mixed json) {
728749 Bitor retval = Bitor();
729750
751+ if (!intp(json["bitor"])) error("Expected integer");
730752 retval.bitor = json["bitor"];
731753
732754 return retval;
@@ -747,6 +769,7 @@ class Bool {
747769 Bool Bool_from_JSON(mixed json) {
748770 Bool retval = Bool();
749771
772+ if (!intp(json["BOOL"])) error("Expected integer");
750773 retval.bool = json["BOOL"];
751774
752775 return retval;
@@ -767,6 +790,7 @@ class Boolean {
767790 Boolean Boolean_from_JSON(mixed json) {
768791 Boolean retval = Boolean();
769792
793+ if (!intp(json["boolean"])) error("Expected integer");
770794 retval.boolean = json["boolean"];
771795
772796 return retval;
@@ -787,6 +811,7 @@ class Bycopy {
787811 Bycopy Bycopy_from_JSON(mixed json) {
788812 Bycopy retval = Bycopy();
789813
814+ if (!intp(json["bycopy"])) error("Expected integer");
790815 retval.bycopy = json["bycopy"];
791816
792817 return retval;
@@ -807,6 +832,7 @@ class Byref {
807832 Byref Byref_from_JSON(mixed json) {
808833 Byref retval = Byref();
809834
835+ if (!intp(json["byref"])) error("Expected integer");
810836 retval.byref = json["byref"];
811837
812838 return retval;
@@ -827,6 +853,7 @@ class Byte {
827853 Byte Byte_from_JSON(mixed json) {
828854 Byte retval = Byte();
829855
856+ if (!intp(json["byte"])) error("Expected integer");
830857 retval.byte = json["byte"];
831858
832859 return retval;
@@ -847,6 +874,7 @@ class Chan {
847874 Chan Chan_from_JSON(mixed json) {
848875 Chan retval = Chan();
849876
877+ if (!intp(json["chan"])) error("Expected integer");
850878 retval.chan = json["chan"];
851879
852880 return retval;
@@ -867,6 +895,7 @@ class Char {
867895 Char Char_from_JSON(mixed json) {
868896 Char retval = Char();
869897
898+ if (!intp(json["char"])) error("Expected integer");
870899 retval.char = json["char"];
871900
872901 return retval;
@@ -887,6 +916,7 @@ class Char16T {
887916 Char16T Char16T_from_JSON(mixed json) {
888917 Char16T retval = Char16T();
889918
919+ if (!intp(json["char16_t"])) error("Expected integer");
890920 retval.char16_t = json["char16_t"];
891921
892922 return retval;
@@ -907,6 +937,7 @@ class Char32T {
907937 Char32T Char32T_from_JSON(mixed json) {
908938 Char32T retval = Char32T();
909939
940+ if (!intp(json["char32_t"])) error("Expected integer");
910941 retval.char32_t = json["char32_t"];
911942
912943 return retval;
@@ -927,6 +958,7 @@ class Checked {
927958 Checked Checked_from_JSON(mixed json) {
928959 Checked retval = Checked();
929960
961+ if (!intp(json["checked"])) error("Expected integer");
930962 retval.checked = json["checked"];
931963
932964 return retval;
@@ -947,6 +979,7 @@ class Clone {
947979 Clone Clone_from_JSON(mixed json) {
948980 Clone retval = Clone();
949981
982+ if (!intp(json["clone"])) error("Expected integer");
950983 retval.clone = json["clone"];
951984
952985 return retval;
@@ -967,6 +1000,7 @@ class CoAwait {
9671000 CoAwait CoAwait_from_JSON(mixed json) {
9681001 CoAwait retval = CoAwait();
9691002
1003+ if (!intp(json["co_await"])) error("Expected integer");
9701004 retval.co_await = json["co_await"];
9711005
9721006 return retval;
@@ -987,6 +1021,7 @@ class CoReturn {
9871021 CoReturn CoReturn_from_JSON(mixed json) {
9881022 CoReturn retval = CoReturn();
9891023
1024+ if (!intp(json["co_return"])) error("Expected integer");
9901025 retval.co_return = json["co_return"];
9911026
9921027 return retval;
@@ -1007,6 +1042,7 @@ class CoYield {
10071042 CoYield CoYield_from_JSON(mixed json) {
10081043 CoYield retval = CoYield();
10091044
1045+ if (!intp(json["co_yield"])) error("Expected integer");
10101046 retval.co_yield = json["co_yield"];
10111047
10121048 return retval;
@@ -1027,6 +1063,7 @@ class Compl {
10271063 Compl Compl_from_JSON(mixed json) {
10281064 Compl retval = Compl();
10291065
1066+ if (!intp(json["compl"])) error("Expected integer");
10301067 retval.compl = json["compl"];
10311068
10321069 return retval;
@@ -1047,6 +1084,7 @@ class Complex {
10471084 Complex Complex_from_JSON(mixed json) {
10481085 Complex retval = Complex();
10491086
1087+ if (!intp(json["_Complex"])) error("Expected integer");
10501088 retval.complex = json["_Complex"];
10511089
10521090 return retval;
@@ -1067,6 +1105,7 @@ class Concept {
10671105 Concept Concept_from_JSON(mixed json) {
10681106 Concept retval = Concept();
10691107
1108+ if (!intp(json["concept"])) error("Expected integer");
10701109 retval.concept = json["concept"];
10711110
10721111 return retval;
@@ -1087,6 +1126,7 @@ class Console {
10871126 Console Console_from_JSON(mixed json) {
10881127 Console retval = Console();
10891128
1129+ if (!intp(json["console"])) error("Expected integer");
10901130 retval.console = json["console"];
10911131
10921132 return retval;
@@ -1107,6 +1147,7 @@ class ConstCast {
11071147 ConstCast ConstCast_from_JSON(mixed json) {
11081148 ConstCast retval = ConstCast();
11091149
1150+ if (!intp(json["const_cast"])) error("Expected integer");
11101151 retval.const_cast = json["const_cast"];
11111152
11121153 return retval;
@@ -1127,6 +1168,7 @@ class Constexpr {
11271168 Constexpr Constexpr_from_JSON(mixed json) {
11281169 Constexpr retval = Constexpr();
11291170
1171+ if (!intp(json["constexpr"])) error("Expected integer");
11301172 retval.constexpr = json["constexpr"];
11311173
11321174 return retval;
@@ -1147,6 +1189,7 @@ class Constructor {
11471189 Constructor Constructor_from_JSON(mixed json) {
11481190 Constructor retval = Constructor();
11491191
1192+ if (!intp(json["constructor"])) error("Expected integer");
11501193 retval.constructor = json["constructor"];
11511194
11521195 return retval;
@@ -1167,6 +1210,7 @@ class Convenience {
11671210 Convenience Convenience_from_JSON(mixed json) {
11681211 Convenience retval = Convenience();
11691212
1213+ if (!intp(json["convenience"])) error("Expected integer");
11701214 retval.convenience = json["convenience"];
11711215
11721216 return retval;
@@ -1187,6 +1231,7 @@ class Convert {
11871231 Convert Convert_from_JSON(mixed json) {
11881232 Convert retval = Convert();
11891233
1234+ if (!intp(json["convert"])) error("Expected integer");
11901235 retval.convert = json["convert"];
11911236
11921237 return retval;
@@ -1207,6 +1252,7 @@ class Converter {
12071252 Converter Converter_from_JSON(mixed json) {
12081253 Converter retval = Converter();
12091254
1255+ if (!intp(json["converter"])) error("Expected integer");
12101256 retval.converter = json["converter"];
12111257
12121258 return retval;
@@ -1227,6 +1273,7 @@ class Date {
12271273 Date Date_from_JSON(mixed json) {
12281274 Date retval = Date();
12291275
1276+ if (!intp(json["date"])) error("Expected integer");
12301277 retval.date = json["date"];
12311278
12321279 return retval;
@@ -1247,6 +1294,7 @@ class DateParseHandling {
12471294 DateParseHandling DateParseHandling_from_JSON(mixed json) {
12481295 DateParseHandling retval = DateParseHandling();
12491296
1297+ if (!intp(json["date_parse_handling"])) error("Expected integer");
12501298 retval.date_parse_handling = json["date_parse_handling"];
12511299
12521300 return retval;
@@ -1267,6 +1315,7 @@ class Debugger {
12671315 Debugger Debugger_from_JSON(mixed json) {
12681316 Debugger retval = Debugger();
12691317
1318+ if (!intp(json["debugger"])) error("Expected integer");
12701319 retval.debugger = json["debugger"];
12711320
12721321 return retval;
@@ -1287,6 +1336,7 @@ class Decimal {
12871336 Decimal Decimal_from_JSON(mixed json) {
12881337 Decimal retval = Decimal();
12891338
1339+ if (!intp(json["decimal"])) error("Expected integer");
12901340 retval.decimal = json["decimal"];
12911341
12921342 return retval;
@@ -1307,6 +1357,7 @@ class Declare {
13071357 Declare Declare_from_JSON(mixed json) {
13081358 Declare retval = Declare();
13091359
1360+ if (!intp(json["declare"])) error("Expected integer");
13101361 retval.declare = json["declare"];
13111362
13121363 return retval;
@@ -1327,6 +1378,7 @@ class Decltype {
13271378 Decltype Decltype_from_JSON(mixed json) {
13281379 Decltype retval = Decltype();
13291380
1381+ if (!intp(json["decltype"])) error("Expected integer");
13301382 retval.decltype = json["decltype"];
13311383
13321384 return retval;
@@ -1347,6 +1399,7 @@ class DecodeString {
13471399 DecodeString DecodeString_from_JSON(mixed json) {
13481400 DecodeString retval = DecodeString();
13491401
1402+ if (!intp(json["decode_string"])) error("Expected integer");
13501403 retval.decode_string = json["decode_string"];
13511404
13521405 return retval;
@@ -1367,6 +1420,7 @@ class Empty {
13671420 Empty Empty_from_JSON(mixed json) {
13681421 Empty retval = Empty();
13691422
1423+ if (!intp(json["_"])) error("Expected integer");
13701424 retval.empty = json["_"];
13711425
13721426 return retval;
@@ -1387,6 +1441,7 @@ class Imaginery {
13871441 Imaginery Imaginery_from_JSON(mixed json) {
13881442 Imaginery retval = Imaginery();
13891443
1444+ if (!intp(json["_Imaginery"])) error("Expected integer");
13901445 retval.imaginery = json["_Imaginery"];
13911446
13921447 return retval;
@@ -1407,6 +1462,7 @@ class AnyClass {
14071462 AnyClass AnyClass_from_JSON(mixed json) {
14081463 AnyClass retval = AnyClass();
14091464
1465+ if (!intp(json["any"])) error("Expected integer");
14101466 retval.any = json["any"];
14111467
14121468 return retval;
@@ -1427,6 +1483,7 @@ class Array {
14271483 Array Array_from_JSON(mixed json) {
14281484 Array retval = Array();
14291485
1486+ if (!intp(json["array"])) error("Expected integer");
14301487 retval.array_array = json["array"];
14311488
14321489 return retval;
@@ -1447,6 +1504,7 @@ class Auto {
14471504 Auto Auto_from_JSON(mixed json) {
14481505 Auto retval = Auto();
14491506
1507+ if (!intp(json["auto"])) error("Expected integer");
14501508 retval.auto_auto = json["auto"];
14511509
14521510 return retval;
@@ -1467,6 +1525,7 @@ class BoolClass {
14671525 BoolClass BoolClass_from_JSON(mixed json) {
14681526 BoolClass retval = BoolClass();
14691527
1528+ if (!intp(json["_Bool"])) error("Expected integer");
14701529 retval.bool = json["_Bool"];
14711530
14721531 return retval;
@@ -1487,6 +1546,7 @@ class Break {
14871546 Break Break_from_JSON(mixed json) {
14881547 Break retval = Break();
14891548
1549+ if (!intp(json["break"])) error("Expected integer");
14901550 retval.break_break = json["break"];
14911551
14921552 return retval;
@@ -1507,6 +1567,7 @@ class Case {
15071567 Case Case_from_JSON(mixed json) {
15081568 Case retval = Case();
15091569
1570+ if (!intp(json["case"])) error("Expected integer");
15101571 retval.case_case = json["case"];
15111572
15121573 return retval;
@@ -1527,6 +1588,7 @@ class Catch {
15271588 Catch Catch_from_JSON(mixed json) {
15281589 Catch retval = Catch();
15291590
1591+ if (!intp(json["catch"])) error("Expected integer");
15301592 retval.catch_catch = json["catch"];
15311593
15321594 return retval;
@@ -1547,6 +1609,7 @@ class Class {
15471609 Class Class_from_JSON(mixed json) {
15481610 Class retval = Class();
15491611
1612+ if (!intp(json["Class"])) error("Expected integer");
15501613 retval.class_class = json["Class"];
15511614
15521615 return retval;
@@ -1567,6 +1630,7 @@ class Const {
15671630 Const Const_from_JSON(mixed json) {
15681631 Const retval = Const();
15691632
1633+ if (!intp(json["const"])) error("Expected integer");
15701634 retval.const_const = json["const"];
15711635
15721636 return retval;
@@ -1587,6 +1651,7 @@ class Continue {
15871651 Continue Continue_from_JSON(mixed json) {
15881652 Continue retval = Continue();
15891653
1654+ if (!intp(json["continue"])) error("Expected integer");
15901655 retval.continue_continue = json["continue"];
15911656
15921657 return retval;
@@ -1607,6 +1672,7 @@ class Obj1Bool {
16071672 Obj1Bool Obj1Bool_from_JSON(mixed json) {
16081673 Obj1Bool retval = Obj1Bool();
16091674
1675+ if (!intp(json["bool"])) error("Expected integer");
16101676 retval.bool = json["bool"];
16111677
16121678 return retval;
@@ -1627,6 +1693,7 @@ class ClassClass {
16271693 ClassClass ClassClass_from_JSON(mixed json) {
16281694 ClassClass retval = ClassClass();
16291695
1696+ if (!intp(json["class"])) error("Expected integer");
16301697 retval.class_class = json["class"];
16311698
16321699 return retval;
@@ -1797,6 +1864,7 @@ Obj2 Obj2_from_JSON(mixed json) {
17971864 retval.did_set = json["didSet"];
17981865 Double_from_JSON(json["double"]);
17991866 retval.double = json["double"];
1867+ if (!intp(json["dummy"])) error("Expected integer");
18001868 retval.dummy = json["dummy"];
18011869 Dynamic_from_JSON(json["dynamic"]);
18021870 retval.dynamic = json["dynamic"];
@@ -1927,6 +1995,7 @@ class Def {
19271995 Def Def_from_JSON(mixed json) {
19281996 Def retval = Def();
19291997
1998+ if (!intp(json["def"])) error("Expected integer");
19301999 retval.def = json["def"];
19312000
19322001 return retval;
@@ -1947,6 +2016,7 @@ class Defer {
19472016 Defer Defer_from_JSON(mixed json) {
19482017 Defer retval = Defer();
19492018
2019+ if (!intp(json["defer"])) error("Expected integer");
19502020 retval.defer = json["defer"];
19512021
19522022 return retval;
@@ -1967,6 +2037,7 @@ class Deinit {
19672037 Deinit Deinit_from_JSON(mixed json) {
19682038 Deinit retval = Deinit();
19692039
2040+ if (!intp(json["deinit"])) error("Expected integer");
19702041 retval.deinit = json["deinit"];
19712042
19722043 return retval;
@@ -1987,6 +2058,7 @@ class Del {
19872058 Del Del_from_JSON(mixed json) {
19882059 Del retval = Del();
19892060
2061+ if (!intp(json["del"])) error("Expected integer");
19902062 retval.del = json["del"];
19912063
19922064 return retval;
@@ -2007,6 +2079,7 @@ class Delegate {
20072079 Delegate Delegate_from_JSON(mixed json) {
20082080 Delegate retval = Delegate();
20092081
2082+ if (!intp(json["delegate"])) error("Expected integer");
20102083 retval.delegate = json["delegate"];
20112084
20122085 return retval;
@@ -2027,6 +2100,7 @@ class Delete {
20272100 Delete Delete_from_JSON(mixed json) {
20282101 Delete retval = Delete();
20292102
2103+ if (!intp(json["delete"])) error("Expected integer");
20302104 retval.delete = json["delete"];
20312105
20322106 return retval;
@@ -2047,6 +2121,7 @@ class Dict {
20472121 Dict Dict_from_JSON(mixed json) {
20482122 Dict retval = Dict();
20492123
2124+ if (!intp(json["dict"])) error("Expected integer");
20502125 retval.dict = json["dict"];
20512126
20522127 return retval;
@@ -2067,6 +2142,7 @@ class Dictionary {
20672142 Dictionary Dictionary_from_JSON(mixed json) {
20682143 Dictionary retval = Dictionary();
20692144
2145+ if (!intp(json["dictionary"])) error("Expected integer");
20702146 retval.dictionary = json["dictionary"];
20712147
20722148 return retval;
@@ -2087,6 +2163,7 @@ class DidSet {
20872163 DidSet DidSet_from_JSON(mixed json) {
20882164 DidSet retval = DidSet();
20892165
2166+ if (!intp(json["didSet"])) error("Expected integer");
20902167 retval.did_set = json["didSet"];
20912168
20922169 return retval;
@@ -2107,6 +2184,7 @@ class Double {
21072184 Double Double_from_JSON(mixed json) {
21082185 Double retval = Double();
21092186
2187+ if (!intp(json["double"])) error("Expected integer");
21102188 retval.double = json["double"];
21112189
21122190 return retval;
@@ -2127,6 +2205,7 @@ class Dynamic {
21272205 Dynamic Dynamic_from_JSON(mixed json) {
21282206 Dynamic retval = Dynamic();
21292207
2208+ if (!intp(json["dynamic"])) error("Expected integer");
21302209 retval.dynamic = json["dynamic"];
21312210
21322211 return retval;
@@ -2147,6 +2226,7 @@ class DynamicCast {
21472226 DynamicCast DynamicCast_from_JSON(mixed json) {
21482227 DynamicCast retval = DynamicCast();
21492228
2229+ if (!intp(json["dynamic_cast"])) error("Expected integer");
21502230 retval.dynamic_cast = json["dynamic_cast"];
21512231
21522232 return retval;
@@ -2167,6 +2247,7 @@ class Elif {
21672247 Elif Elif_from_JSON(mixed json) {
21682248 Elif retval = Elif();
21692249
2250+ if (!intp(json["elif"])) error("Expected integer");
21702251 retval.elif = json["elif"];
21712252
21722253 return retval;
@@ -2187,6 +2268,7 @@ class EncodeQuickType {
21872268 EncodeQuickType EncodeQuickType_from_JSON(mixed json) {
21882269 EncodeQuickType retval = EncodeQuickType();
21892270
2271+ if (!intp(json["encode_quick_type"])) error("Expected integer");
21902272 retval.encode_quick_type = json["encode_quick_type"];
21912273
21922274 return retval;
@@ -2207,6 +2289,7 @@ class EqualityContract {
22072289 EqualityContract EqualityContract_from_JSON(mixed json) {
22082290 EqualityContract retval = EqualityContract();
22092291
2292+ if (!intp(json["equalityContract"])) error("Expected integer");
22102293 retval.equality_contract = json["equalityContract"];
22112294
22122295 return retval;
@@ -2227,6 +2310,7 @@ class Event {
22272310 Event Event_from_JSON(mixed json) {
22282311 Event retval = Event();
22292312
2313+ if (!intp(json["event"])) error("Expected integer");
22302314 retval.event = json["event"];
22312315
22322316 return retval;
@@ -2247,6 +2331,7 @@ class Except {
22472331 Except Except_from_JSON(mixed json) {
22482332 Except retval = Except();
22492333
2334+ if (!intp(json["except"])) error("Expected integer");
22502335 retval.except = json["except"];
22512336
22522337 return retval;
@@ -2267,6 +2352,7 @@ class Exception {
22672352 Exception Exception_from_JSON(mixed json) {
22682353 Exception retval = Exception();
22692354
2355+ if (!intp(json["exception"])) error("Expected integer");
22702356 retval.exception = json["exception"];
22712357
22722358 return retval;
@@ -2287,6 +2373,7 @@ class Explicit {
22872373 Explicit Explicit_from_JSON(mixed json) {
22882374 Explicit retval = Explicit();
22892375
2376+ if (!intp(json["explicit"])) error("Expected integer");
22902377 retval.explicit = json["explicit"];
22912378
22922379 return retval;
@@ -2307,6 +2394,7 @@ class Export {
23072394 Export Export_from_JSON(mixed json) {
23082395 Export retval = Export();
23092396
2397+ if (!intp(json["export"])) error("Expected integer");
23102398 retval.export = json["export"];
23112399
23122400 return retval;
@@ -2327,6 +2415,7 @@ class Exposing {
23272415 Exposing Exposing_from_JSON(mixed json) {
23282416 Exposing retval = Exposing();
23292417
2418+ if (!intp(json["exposing"])) error("Expected integer");
23302419 retval.exposing = json["exposing"];
23312420
23322421 return retval;
@@ -2347,6 +2436,7 @@ class Extends {
23472436 Extends Extends_from_JSON(mixed json) {
23482437 Extends retval = Extends();
23492438
2439+ if (!intp(json["extends"])) error("Expected integer");
23502440 retval.extends = json["extends"];
23512441
23522442 return retval;
@@ -2367,6 +2457,7 @@ class Extension {
23672457 Extension Extension_from_JSON(mixed json) {
23682458 Extension retval = Extension();
23692459
2460+ if (!intp(json["extension"])) error("Expected integer");
23702461 retval.extension = json["extension"];
23712462
23722463 return retval;
@@ -2387,6 +2478,7 @@ class Fallthrough {
23872478 Fallthrough Fallthrough_from_JSON(mixed json) {
23882479 Fallthrough retval = Fallthrough();
23892480
2481+ if (!intp(json["fallthrough"])) error("Expected integer");
23902482 retval.fallthrough = json["fallthrough"];
23912483
23922484 return retval;
@@ -2407,6 +2499,7 @@ class False {
24072499 False False_from_JSON(mixed json) {
24082500 False retval = False();
24092501
2502+ if (!intp(json["False"])) error("Expected integer");
24102503 retval.false = json["False"];
24112504
24122505 return retval;
@@ -2427,6 +2520,7 @@ class Fileprivate {
24272520 Fileprivate Fileprivate_from_JSON(mixed json) {
24282521 Fileprivate retval = Fileprivate();
24292522
2523+ if (!intp(json["fileprivate"])) error("Expected integer");
24302524 retval.fileprivate = json["fileprivate"];
24312525
24322526 return retval;
@@ -2447,6 +2541,7 @@ class Finally {
24472541 Finally Finally_from_JSON(mixed json) {
24482542 Finally retval = Finally();
24492543
2544+ if (!intp(json["finally"])) error("Expected integer");
24502545 retval.finally = json["finally"];
24512546
24522547 return retval;
@@ -2467,6 +2562,7 @@ class Fixed {
24672562 Fixed Fixed_from_JSON(mixed json) {
24682563 Fixed retval = Fixed();
24692564
2565+ if (!intp(json["fixed"])) error("Expected integer");
24702566 retval.fixed = json["fixed"];
24712567
24722568 return retval;
@@ -2487,6 +2583,7 @@ class Friend {
24872583 Friend Friend_from_JSON(mixed json) {
24882584 Friend retval = Friend();
24892585
2586+ if (!intp(json["friend"])) error("Expected integer");
24902587 retval.friend = json["friend"];
24912588
24922589 return retval;
@@ -2507,6 +2604,7 @@ class From {
25072604 From From_from_JSON(mixed json) {
25082605 From retval = From();
25092606
2607+ if (!intp(json["from"])) error("Expected integer");
25102608 retval.from = json["from"];
25112609
25122610 return retval;
@@ -2527,6 +2625,7 @@ class FromJson {
25272625 FromJson FromJson_from_JSON(mixed json) {
25282626 FromJson retval = FromJson();
25292627
2628+ if (!intp(json["from_json"])) error("Expected integer");
25302629 retval.from_json = json["from_json"];
25312630
25322631 return retval;
@@ -2547,6 +2646,7 @@ class Func {
25472646 Func Func_from_JSON(mixed json) {
25482647 Func retval = Func();
25492648
2649+ if (!intp(json["func"])) error("Expected integer");
25502650 retval.func = json["func"];
25512651
25522652 return retval;
@@ -2567,6 +2667,7 @@ class Get {
25672667 Get Get_from_JSON(mixed json) {
25682668 Get retval = Get();
25692669
2670+ if (!intp(json["get"])) error("Expected integer");
25702671 retval.get = json["get"];
25712672
25722673 return retval;
@@ -2587,6 +2688,7 @@ class Go {
25872688 Go Go_from_JSON(mixed json) {
25882689 Go retval = Go();
25892690
2691+ if (!intp(json["go"])) error("Expected integer");
25902692 retval.go = json["go"];
25912693
25922694 return retval;
@@ -2607,6 +2709,7 @@ class Goto {
26072709 Goto Goto_from_JSON(mixed json) {
26082710 Goto retval = Goto();
26092711
2712+ if (!intp(json["goto"])) error("Expected integer");
26102713 retval.goto = json["goto"];
26112714
26122715 return retval;
@@ -2627,6 +2730,7 @@ class Guard {
26272730 Guard Guard_from_JSON(mixed json) {
26282731 Guard retval = Guard();
26292732
2733+ if (!intp(json["guard"])) error("Expected integer");
26302734 retval.guard = json["guard"];
26312735
26322736 return retval;
@@ -2647,6 +2751,7 @@ class HasOwnProperty {
26472751 HasOwnProperty HasOwnProperty_from_JSON(mixed json) {
26482752 HasOwnProperty retval = HasOwnProperty();
26492753
2754+ if (!intp(json["hasOwnProperty"])) error("Expected integer");
26502755 retval.has_own_property = json["hasOwnProperty"];
26512756
26522757 return retval;
@@ -2667,6 +2772,7 @@ class Id {
26672772 Id Id_from_JSON(mixed json) {
26682773 Id retval = Id();
26692774
2775+ if (!intp(json["id"])) error("Expected integer");
26702776 retval.id = json["id"];
26712777
26722778 return retval;
@@ -2687,6 +2793,7 @@ class Imp {
26872793 Imp Imp_from_JSON(mixed json) {
26882794 Imp retval = Imp();
26892795
2796+ if (!intp(json["IMP"])) error("Expected integer");
26902797 retval.imp = json["IMP"];
26912798
26922799 return retval;
@@ -2707,6 +2814,7 @@ class Implements {
27072814 Implements Implements_from_JSON(mixed json) {
27082815 Implements retval = Implements();
27092816
2817+ if (!intp(json["implements"])) error("Expected integer");
27102818 retval.implements = json["implements"];
27112819
27122820 return retval;
@@ -2727,6 +2835,7 @@ class Implicit {
27272835 Implicit Implicit_from_JSON(mixed json) {
27282836 Implicit retval = Implicit();
27292837
2838+ if (!intp(json["implicit"])) error("Expected integer");
27302839 retval.implicit = json["implicit"];
27312840
27322841 return retval;
@@ -2747,6 +2856,7 @@ class In {
27472856 In In_from_JSON(mixed json) {
27482857 In retval = In();
27492858
2859+ if (!intp(json["in"])) error("Expected integer");
27502860 retval.in = json["in"];
27512861
27522862 return retval;
@@ -2767,6 +2877,7 @@ class Indirect {
27672877 Indirect Indirect_from_JSON(mixed json) {
27682878 Indirect retval = Indirect();
27692879
2880+ if (!intp(json["indirect"])) error("Expected integer");
27702881 retval.indirect = json["indirect"];
27712882
27722883 return retval;
@@ -2787,6 +2898,7 @@ class Infix {
27872898 Infix Infix_from_JSON(mixed json) {
27882899 Infix retval = Infix();
27892900
2901+ if (!intp(json["infix"])) error("Expected integer");
27902902 retval.infix = json["infix"];
27912903
27922904 return retval;
@@ -2807,6 +2919,7 @@ class Init {
28072919 Init Init_from_JSON(mixed json) {
28082920 Init retval = Init();
28092921
2922+ if (!intp(json["init"])) error("Expected integer");
28102923 retval.init = json["init"];
28112924
28122925 return retval;
@@ -2827,6 +2940,7 @@ class Inout {
28272940 Inout Inout_from_JSON(mixed json) {
28282941 Inout retval = Inout();
28292942
2943+ if (!intp(json["inout"])) error("Expected integer");
28302944 retval.inout = json["inout"];
28312945
28322946 return retval;
@@ -2847,6 +2961,7 @@ class Instanceof {
28472961 Instanceof Instanceof_from_JSON(mixed json) {
28482962 Instanceof retval = Instanceof();
28492963
2964+ if (!intp(json["instanceof"])) error("Expected integer");
28502965 retval.instanceof = json["instanceof"];
28512966
28522967 return retval;
@@ -2867,6 +2982,7 @@ class Interface {
28672982 Interface Interface_from_JSON(mixed json) {
28682983 Interface retval = Interface();
28692984
2985+ if (!intp(json["interface"])) error("Expected integer");
28702986 retval.interface = json["interface"];
28712987
28722988 return retval;
@@ -2887,6 +3003,7 @@ class Internal {
28873003 Internal Internal_from_JSON(mixed json) {
28883004 Internal retval = Internal();
28893005
3006+ if (!intp(json["internal"])) error("Expected integer");
28903007 retval.internal = json["internal"];
28913008
28923009 return retval;
@@ -2907,6 +3024,7 @@ class Default {
29073024 Default Default_from_JSON(mixed json) {
29083025 Default retval = Default();
29093026
3027+ if (!intp(json["default"])) error("Expected integer");
29103028 retval.default_default = json["default"];
29113029
29123030 return retval;
@@ -2927,6 +3045,7 @@ class Do {
29273045 Do Do_from_JSON(mixed json) {
29283046 Do retval = Do();
29293047
3048+ if (!intp(json["do"])) error("Expected integer");
29303049 retval.do_do = json["do"];
29313050
29323051 return retval;
@@ -2947,6 +3066,7 @@ class Else {
29473066 Else Else_from_JSON(mixed json) {
29483067 Else retval = Else();
29493068
3069+ if (!intp(json["else"])) error("Expected integer");
29503070 retval.else_else = json["else"];
29513071
29523072 return retval;
@@ -2967,6 +3087,7 @@ class Enum {
29673087 Enum Enum_from_JSON(mixed json) {
29683088 Enum retval = Enum();
29693089
3090+ if (!intp(json["enum"])) error("Expected integer");
29703091 retval.enum_enum = json["enum"];
29713092
29723093 return retval;
@@ -2987,6 +3108,7 @@ class Extern {
29873108 Extern Extern_from_JSON(mixed json) {
29883109 Extern retval = Extern();
29893110
3111+ if (!intp(json["extern"])) error("Expected integer");
29903112 retval.extern_extern = json["extern"];
29913113
29923114 return retval;
@@ -3007,6 +3129,7 @@ class FalseClass {
30073129 FalseClass FalseClass_from_JSON(mixed json) {
30083130 FalseClass retval = FalseClass();
30093131
3132+ if (!intp(json["false"])) error("Expected integer");
30103133 retval.false = json["false"];
30113134
30123135 return retval;
@@ -3027,6 +3150,7 @@ class Final {
30273150 Final Final_from_JSON(mixed json) {
30283151 Final retval = Final();
30293152
3153+ if (!intp(json["final"])) error("Expected integer");
30303154 retval.final_final = json["final"];
30313155
30323156 return retval;
@@ -3047,6 +3171,7 @@ class Float {
30473171 Float Float_from_JSON(mixed json) {
30483172 Float retval = Float();
30493173
3174+ if (!intp(json["float"])) error("Expected integer");
30503175 retval.float_float = json["float"];
30513176
30523177 return retval;
@@ -3067,6 +3192,7 @@ class For {
30673192 For For_from_JSON(mixed json) {
30683193 For retval = For();
30693194
3195+ if (!intp(json["for"])) error("Expected integer");
30703196 retval.for_for = json["for"];
30713197
30723198 return retval;
@@ -3087,6 +3213,7 @@ class Foreach {
30873213 Foreach Foreach_from_JSON(mixed json) {
30883214 Foreach retval = Foreach();
30893215
3216+ if (!intp(json["foreach"])) error("Expected integer");
30903217 retval.foreach_foreach = json["foreach"];
30913218
30923219 return retval;
@@ -3107,6 +3234,7 @@ class Function {
31073234 Function Function_from_JSON(mixed json) {
31083235 Function retval = Function();
31093236
3237+ if (!intp(json["function"])) error("Expected integer");
31103238 retval.function_function = json["function"];
31113239
31123240 return retval;
@@ -3127,6 +3255,7 @@ class Global {
31273255 Global Global_from_JSON(mixed json) {
31283256 Global retval = Global();
31293257
3258+ if (!intp(json["global"])) error("Expected integer");
31303259 retval.global_global = json["global"];
31313260
31323261 return retval;
@@ -3147,6 +3276,7 @@ class If {
31473276 If If_from_JSON(mixed json) {
31483277 If retval = If();
31493278
3279+ if (!intp(json["if"])) error("Expected integer");
31503280 retval.if_if = json["if"];
31513281
31523282 return retval;
@@ -3167,6 +3297,7 @@ class Import {
31673297 Import Import_from_JSON(mixed json) {
31683298 Import retval = Import();
31693299
3300+ if (!intp(json["import"])) error("Expected integer");
31703301 retval.import_import = json["import"];
31713302
31723303 return retval;
@@ -3187,6 +3318,7 @@ class Inline {
31873318 Inline Inline_from_JSON(mixed json) {
31883319 Inline retval = Inline();
31893320
3321+ if (!intp(json["inline"])) error("Expected integer");
31903322 retval.inline_inline = json["inline"];
31913323
31923324 return retval;
@@ -3207,6 +3339,7 @@ class Int {
32073339 Int Int_from_JSON(mixed json) {
32083340 Int retval = Int();
32093341
3342+ if (!intp(json["int"])) error("Expected integer");
32103343 retval.int_int = json["int"];
32113344
32123345 return retval;
@@ -3357,6 +3490,7 @@ class Obj3 {
33573490 Obj3 Obj3_from_JSON(mixed json) {
33583491 Obj3 retval = Obj3();
33593492
3493+ if (!intp(json["dummy"])) error("Expected integer");
33603494 retval.dummy = json["dummy"];
33613495 Is_from_JSON(json["is"]);
33623496 retval.is = json["is"];
@@ -3507,6 +3641,7 @@ class Is {
35073641 Is Is_from_JSON(mixed json) {
35083642 Is retval = Is();
35093643
3644+ if (!intp(json["is"])) error("Expected integer");
35103645 retval.is = json["is"];
35113646
35123647 return retval;
@@ -3527,6 +3662,7 @@ class Iterable {
35273662 Iterable Iterable_from_JSON(mixed json) {
35283663 Iterable retval = Iterable();
35293664
3665+ if (!intp(json["iterable"])) error("Expected integer");
35303666 retval.iterable = json["iterable"];
35313667
35323668 return retval;
@@ -3547,6 +3683,7 @@ class Jdec {
35473683 Jdec Jdec_from_JSON(mixed json) {
35483684 Jdec retval = Jdec();
35493685
3686+ if (!intp(json["jdec"])) error("Expected integer");
35503687 retval.jdec = json["jdec"];
35513688
35523689 return retval;
@@ -3567,6 +3704,7 @@ class Jenc {
35673704 Jenc Jenc_from_JSON(mixed json) {
35683705 Jenc retval = Jenc();
35693706
3707+ if (!intp(json["jenc"])) error("Expected integer");
35703708 retval.jenc = json["jenc"];
35713709
35723710 return retval;
@@ -3587,6 +3725,7 @@ class Jpipe {
35873725 Jpipe Jpipe_from_JSON(mixed json) {
35883726 Jpipe retval = Jpipe();
35893727
3728+ if (!intp(json["jpipe"])) error("Expected integer");
35903729 retval.jpipe = json["jpipe"];
35913730
35923731 return retval;
@@ -3607,6 +3746,7 @@ class Json {
36073746 Json Json_from_JSON(mixed json) {
36083747 Json retval = Json();
36093748
3749+ if (!intp(json["json"])) error("Expected integer");
36103750 retval.json = json["json"];
36113751
36123752 return retval;
@@ -3627,6 +3767,7 @@ class JsonConverter {
36273767 JsonConverter JsonConverter_from_JSON(mixed json) {
36283768 JsonConverter retval = JsonConverter();
36293769
3770+ if (!intp(json["json_converter"])) error("Expected integer");
36303771 retval.json_converter = json["json_converter"];
36313772
36323773 return retval;
@@ -3647,6 +3788,7 @@ class JsonSerializer {
36473788 JsonSerializer JsonSerializer_from_JSON(mixed json) {
36483789 JsonSerializer retval = JsonSerializer();
36493790
3791+ if (!intp(json["json_serializer"])) error("Expected integer");
36503792 retval.json_serializer = json["json_serializer"];
36513793
36523794 return retval;
@@ -3667,6 +3809,7 @@ class JsonToken {
36673809 JsonToken JsonToken_from_JSON(mixed json) {
36683810 JsonToken retval = JsonToken();
36693811
3812+ if (!intp(json["json_token"])) error("Expected integer");
36703813 retval.json_token = json["json_token"];
36713814
36723815 return retval;
@@ -3687,6 +3830,7 @@ class JsonWriter {
36873830 JsonWriter JsonWriter_from_JSON(mixed json) {
36883831 JsonWriter retval = JsonWriter();
36893832
3833+ if (!intp(json["json_writer"])) error("Expected integer");
36903834 retval.json_writer = json["json_writer"];
36913835
36923836 return retval;
@@ -3707,6 +3851,7 @@ class Lazy {
37073851 Lazy Lazy_from_JSON(mixed json) {
37083852 Lazy retval = Lazy();
37093853
3854+ if (!intp(json["lazy"])) error("Expected integer");
37103855 retval.lazy = json["lazy"];
37113856
37123857 return retval;
@@ -3727,6 +3872,7 @@ class Left {
37273872 Left Left_from_JSON(mixed json) {
37283873 Left retval = Left();
37293874
3875+ if (!intp(json["left"])) error("Expected integer");
37303876 retval.left = json["left"];
37313877
37323878 return retval;
@@ -3747,6 +3893,7 @@ class Let {
37473893 Let Let_from_JSON(mixed json) {
37483894 Let retval = Let();
37493895
3896+ if (!intp(json["let"])) error("Expected integer");
37503897 retval.let = json["let"];
37513898
37523899 return retval;
@@ -3767,6 +3914,7 @@ class List {
37673914 List List_from_JSON(mixed json) {
37683915 List retval = List();
37693916
3917+ if (!intp(json["list"])) error("Expected integer");
37703918 retval.list = json["list"];
37713919
37723920 return retval;
@@ -3787,6 +3935,7 @@ class Lock {
37873935 Lock Lock_from_JSON(mixed json) {
37883936 Lock retval = Lock();
37893937
3938+ if (!intp(json["lock"])) error("Expected integer");
37903939 retval.lock = json["lock"];
37913940
37923941 return retval;
@@ -3807,6 +3956,7 @@ class Long {
38073956 Long Long_from_JSON(mixed json) {
38083957 Long retval = Long();
38093958
3959+ if (!intp(json["long"])) error("Expected integer");
38103960 retval.long = json["long"];
38113961
38123962 return retval;
@@ -3827,6 +3977,7 @@ class Map {
38273977 Map Map_from_JSON(mixed json) {
38283978 Map retval = Map();
38293979
3980+ if (!intp(json["map"])) error("Expected integer");
38303981 retval.map = json["map"];
38313982
38323983 return retval;
@@ -3847,6 +3998,7 @@ class MetadataPropertyHandling {
38473998 MetadataPropertyHandling MetadataPropertyHandling_from_JSON(mixed json) {
38483999 MetadataPropertyHandling retval = MetadataPropertyHandling();
38494000
4001+ if (!intp(json["metadata_property_handling"])) error("Expected integer");
38504002 retval.metadata_property_handling = json["metadata_property_handling"];
38514003
38524004 return retval;
@@ -3867,6 +4019,7 @@ class Module {
38674019 Module Module_from_JSON(mixed json) {
38684020 Module retval = Module();
38694021
4022+ if (!intp(json["module"])) error("Expected integer");
38704023 retval.module = json["module"];
38714024
38724025 return retval;
@@ -3887,6 +4040,7 @@ class Mutable {
38874040 Mutable Mutable_from_JSON(mixed json) {
38884041 Mutable retval = Mutable();
38894042
4043+ if (!intp(json["mutable"])) error("Expected integer");
38904044 retval.mutable = json["mutable"];
38914045
38924046 return retval;
@@ -3907,6 +4061,7 @@ class Mutating {
39074061 Mutating Mutating_from_JSON(mixed json) {
39084062 Mutating retval = Mutating();
39094063
4064+ if (!intp(json["mutating"])) error("Expected integer");
39104065 retval.mutating = json["mutating"];
39114066
39124067 return retval;
@@ -3927,6 +4082,7 @@ class Namespace {
39274082 Namespace Namespace_from_JSON(mixed json) {
39284083 Namespace retval = Namespace();
39294084
4085+ if (!intp(json["namespace"])) error("Expected integer");
39304086 retval.namespace = json["namespace"];
39314087
39324088 return retval;
@@ -3947,6 +4103,7 @@ class Native {
39474103 Native Native_from_JSON(mixed json) {
39484104 Native retval = Native();
39494105
4106+ if (!intp(json["native"])) error("Expected integer");
39504107 retval.native = json["native"];
39514108
39524109 return retval;
@@ -3967,6 +4124,7 @@ class New {
39674124 New New_from_JSON(mixed json) {
39684125 New retval = New();
39694126
4127+ if (!intp(json["new"])) error("Expected integer");
39704128 retval.new = json["new"];
39714129
39724130 return retval;
@@ -3987,6 +4145,7 @@ class Newtonsoft {
39874145 Newtonsoft Newtonsoft_from_JSON(mixed json) {
39884146 Newtonsoft retval = Newtonsoft();
39894147
4148+ if (!intp(json["newtonsoft"])) error("Expected integer");
39904149 retval.newtonsoft = json["newtonsoft"];
39914150
39924151 return retval;
@@ -4007,6 +4166,7 @@ class Nil {
40074166 Nil Nil_from_JSON(mixed json) {
40084167 Nil retval = Nil();
40094168
4169+ if (!intp(json["nil"])) error("Expected integer");
40104170 retval.nil = json["nil"];
40114171
40124172 return retval;
@@ -4027,6 +4187,7 @@ class No {
40274187 No No_from_JSON(mixed json) {
40284188 No retval = No();
40294189
4190+ if (!intp(json["NO"])) error("Expected integer");
40304191 retval.no = json["NO"];
40314192
40324193 return retval;
@@ -4047,6 +4208,7 @@ class Noexcept {
40474208 Noexcept Noexcept_from_JSON(mixed json) {
40484209 Noexcept retval = Noexcept();
40494210
4211+ if (!intp(json["noexcept"])) error("Expected integer");
40504212 retval.noexcept = json["noexcept"];
40514213
40524214 return retval;
@@ -4067,6 +4229,7 @@ class Nonatomic {
40674229 Nonatomic Nonatomic_from_JSON(mixed json) {
40684230 Nonatomic retval = Nonatomic();
40694231
4232+ if (!intp(json["nonatomic"])) error("Expected integer");
40704233 retval.nonatomic = json["nonatomic"];
40714234
40724235 return retval;
@@ -4087,6 +4250,7 @@ class None {
40874250 None None_from_JSON(mixed json) {
40884251 None retval = None();
40894252
4253+ if (!intp(json["None"])) error("Expected integer");
40904254 retval.none = json["None"];
40914255
40924256 return retval;
@@ -4107,6 +4271,7 @@ class Nonlocal {
41074271 Nonlocal Nonlocal_from_JSON(mixed json) {
41084272 Nonlocal retval = Nonlocal();
41094273
4274+ if (!intp(json["nonlocal"])) error("Expected integer");
41104275 retval.nonlocal = json["nonlocal"];
41114276
41124277 return retval;
@@ -4127,6 +4292,7 @@ class Nonmutating {
41274292 Nonmutating Nonmutating_from_JSON(mixed json) {
41284293 Nonmutating retval = Nonmutating();
41294294
4295+ if (!intp(json["nonmutating"])) error("Expected integer");
41304296 retval.nonmutating = json["nonmutating"];
41314297
41324298 return retval;
@@ -4147,6 +4313,7 @@ class Not {
41474313 Not Not_from_JSON(mixed json) {
41484314 Not retval = Not();
41494315
4316+ if (!intp(json["not"])) error("Expected integer");
41504317 retval.not = json["not"];
41514318
41524319 return retval;
@@ -4167,6 +4334,7 @@ class NotEq {
41674334 NotEq NotEq_from_JSON(mixed json) {
41684335 NotEq retval = NotEq();
41694336
4337+ if (!intp(json["not_eq"])) error("Expected integer");
41704338 retval.not_eq = json["not_eq"];
41714339
41724340 return retval;
@@ -4187,6 +4355,7 @@ class NsString {
41874355 NsString NsString_from_JSON(mixed json) {
41884356 NsString retval = NsString();
41894357
4358+ if (!intp(json["NSString"])) error("Expected integer");
41904359 retval.ns_string = json["NSString"];
41914360
41924361 return retval;
@@ -4207,6 +4376,7 @@ class Null {
42074376 Null Null_from_JSON(mixed json) {
42084377 Null retval = Null();
42094378
4379+ if (!intp(json["NULL"])) error("Expected integer");
42104380 retval.null = json["NULL"];
42114381
42124382 return retval;
@@ -4227,6 +4397,7 @@ class Nullptr {
42274397 Nullptr Nullptr_from_JSON(mixed json) {
42284398 Nullptr retval = Nullptr();
42294399
4400+ if (!intp(json["nullptr"])) error("Expected integer");
42304401 retval.nullptr = json["nullptr"];
42314402
42324403 return retval;
@@ -4247,6 +4418,7 @@ class Number {
42474418 Number Number_from_JSON(mixed json) {
42484419 Number retval = Number();
42494420
4421+ if (!intp(json["number"])) error("Expected integer");
42504422 retval.number = json["number"];
42514423
42524424 return retval;
@@ -4267,6 +4439,7 @@ class Lambda {
42674439 Lambda Lambda_from_JSON(mixed json) {
42684440 Lambda retval = Lambda();
42694441
4442+ if (!intp(json["lambda"])) error("Expected integer");
42704443 retval.lambda_lambda = json["lambda"];
42714444
42724445 return retval;
@@ -4287,6 +4460,7 @@ class NoneClass {
42874460 NoneClass NoneClass_from_JSON(mixed json) {
42884461 NoneClass retval = NoneClass();
42894462
4463+ if (!intp(json["none"])) error("Expected integer");
42904464 retval.none = json["none"];
42914465
42924466 return retval;
@@ -4307,6 +4481,7 @@ class NullClass {
43074481 NullClass NullClass_from_JSON(mixed json) {
43084482 NullClass retval = NullClass();
43094483
4484+ if (!intp(json["null"])) error("Expected integer");
43104485 retval.null = json["null"];
43114486
43124487 return retval;
@@ -4327,6 +4502,7 @@ class Object {
43274502 Object Object_from_JSON(mixed json) {
43284503 Object retval = Object();
43294504
4505+ if (!intp(json["object"])) error("Expected integer");
43304506 retval.object_object = json["object"];
43314507
43324508 return retval;
@@ -4347,6 +4523,7 @@ class Optional {
43474523 Optional Optional_from_JSON(mixed json) {
43484524 Optional retval = Optional();
43494525
4526+ if (!intp(json["optional"])) error("Expected integer");
43504527 retval.optional_optional = json["optional"];
43514528
43524529 return retval;
@@ -4367,6 +4544,7 @@ class Private {
43674544 Private Private_from_JSON(mixed json) {
43684545 Private retval = Private();
43694546
4547+ if (!intp(json["private"])) error("Expected integer");
43704548 retval.private_private = json["private"];
43714549
43724550 return retval;
@@ -4387,6 +4565,7 @@ class Protected {
43874565 Protected Protected_from_JSON(mixed json) {
43884566 Protected retval = Protected();
43894567
4568+ if (!intp(json["protected"])) error("Expected integer");
43904569 retval.protected_protected = json["protected"];
43914570
43924571 return retval;
@@ -4407,6 +4586,7 @@ class ProtocolClass {
44074586 ProtocolClass ProtocolClass_from_JSON(mixed json) {
44084587 ProtocolClass retval = ProtocolClass();
44094588
4589+ if (!intp(json["protocol"])) error("Expected integer");
44104590 retval.protocol = json["protocol"];
44114591
44124592 return retval;
@@ -4427,6 +4607,7 @@ class Of {
44274607 Of Of_from_JSON(mixed json) {
44284608 Of retval = Of();
44294609
4610+ if (!intp(json["of"])) error("Expected integer");
44304611 retval.of = json["of"];
44314612
44324613 return retval;
@@ -4447,6 +4628,7 @@ class Oneway {
44474628 Oneway Oneway_from_JSON(mixed json) {
44484629 Oneway retval = Oneway();
44494630
4631+ if (!intp(json["oneway"])) error("Expected integer");
44504632 retval.oneway = json["oneway"];
44514633
44524634 return retval;
@@ -4467,6 +4649,7 @@ class Open {
44674649 Open Open_from_JSON(mixed json) {
44684650 Open retval = Open();
44694651
4652+ if (!intp(json["open"])) error("Expected integer");
44704653 retval.open = json["open"];
44714654
44724655 return retval;
@@ -4487,6 +4670,7 @@ class Operator {
44874670 Operator Operator_from_JSON(mixed json) {
44884671 Operator retval = Operator();
44894672
4673+ if (!intp(json["operator"])) error("Expected integer");
44904674 retval.operator = json["operator"];
44914675
44924676 return retval;
@@ -4507,6 +4691,7 @@ class Or {
45074691 Or Or_from_JSON(mixed json) {
45084692 Or retval = Or();
45094693
4694+ if (!intp(json["or"])) error("Expected integer");
45104695 retval.or = json["or"];
45114696
45124697 return retval;
@@ -4527,6 +4712,7 @@ class OrEq {
45274712 OrEq OrEq_from_JSON(mixed json) {
45284713 OrEq retval = OrEq();
45294714
4715+ if (!intp(json["or_eq"])) error("Expected integer");
45304716 retval.or_eq = json["or_eq"];
45314717
45324718 return retval;
@@ -4547,6 +4733,7 @@ class Out {
45474733 Out Out_from_JSON(mixed json) {
45484734 Out retval = Out();
45494735
4736+ if (!intp(json["out"])) error("Expected integer");
45504737 retval.out = json["out"];
45514738
45524739 return retval;
@@ -4567,6 +4754,7 @@ class Override {
45674754 Override Override_from_JSON(mixed json) {
45684755 Override retval = Override();
45694756
4757+ if (!intp(json["override"])) error("Expected integer");
45704758 retval.override = json["override"];
45714759
45724760 return retval;
@@ -4587,6 +4775,7 @@ class Package {
45874775 Package Package_from_JSON(mixed json) {
45884776 Package retval = Package();
45894777
4778+ if (!intp(json["package"])) error("Expected integer");
45904779 retval.package = json["package"];
45914780
45924781 return retval;
@@ -4607,6 +4796,7 @@ class Params {
46074796 Params Params_from_JSON(mixed json) {
46084797 Params retval = Params();
46094798
4799+ if (!intp(json["params"])) error("Expected integer");
46104800 retval.params = json["params"];
46114801
46124802 return retval;
@@ -4627,6 +4817,7 @@ class Pass {
46274817 Pass Pass_from_JSON(mixed json) {
46284818 Pass retval = Pass();
46294819
4820+ if (!intp(json["pass"])) error("Expected integer");
46304821 retval.pass = json["pass"];
46314822
46324823 return retval;
@@ -4647,6 +4838,7 @@ class Port {
46474838 Port Port_from_JSON(mixed json) {
46484839 Port retval = Port();
46494840
4841+ if (!intp(json["port"])) error("Expected integer");
46504842 retval.port = json["port"];
46514843
46524844 return retval;
@@ -4667,6 +4859,7 @@ class Postfix {
46674859 Postfix Postfix_from_JSON(mixed json) {
46684860 Postfix retval = Postfix();
46694861
4862+ if (!intp(json["postfix"])) error("Expected integer");
46704863 retval.postfix = json["postfix"];
46714864
46724865 return retval;
@@ -4687,6 +4880,7 @@ class Precedence {
46874880 Precedence Precedence_from_JSON(mixed json) {
46884881 Precedence retval = Precedence();
46894882
4883+ if (!intp(json["precedence"])) error("Expected integer");
46904884 retval.precedence = json["precedence"];
46914885
46924886 return retval;
@@ -4707,6 +4901,7 @@ class Prefix {
47074901 Prefix Prefix_from_JSON(mixed json) {
47084902 Prefix retval = Prefix();
47094903
4904+ if (!intp(json["prefix"])) error("Expected integer");
47104905 retval.prefix = json["prefix"];
47114906
47124907 return retval;
@@ -4727,6 +4922,7 @@ class Print {
47274922 Print Print_from_JSON(mixed json) {
47284923 Print retval = Print();
47294924
4925+ if (!intp(json["print"])) error("Expected integer");
47304926 retval.print = json["print"];
47314927
47324928 return retval;
@@ -4747,6 +4943,7 @@ class PrintMembers {
47474943 PrintMembers PrintMembers_from_JSON(mixed json) {
47484944 PrintMembers retval = PrintMembers();
47494945
4946+ if (!intp(json["printMembers"])) error("Expected integer");
47504947 retval.print_members = json["printMembers"];
47514948
47524949 return retval;
@@ -4767,6 +4964,7 @@ class Printf {
47674964 Printf Printf_from_JSON(mixed json) {
47684965 Printf retval = Printf();
47694966
4967+ if (!intp(json["printf"])) error("Expected integer");
47704968 retval.printf = json["printf"];
47714969
47724970 return retval;
@@ -4787,6 +4985,7 @@ class Protocol {
47874985 Protocol Protocol_from_JSON(mixed json) {
47884986 Protocol retval = Protocol();
47894987
4988+ if (!intp(json["Protocol"])) error("Expected integer");
47904989 retval.protocol = json["Protocol"];
47914990
47924991 return retval;
@@ -4935,6 +5134,7 @@ class Obj4 {
49355134 Obj4 Obj4_from_JSON(mixed json) {
49365135 Obj4 retval = Obj4();
49375136
5137+ if (!intp(json["dummy"])) error("Expected integer");
49385138 retval.dummy = json["dummy"];
49395139 Public_from_JSON(json["public"]);
49405140 retval.obj4_public = json["public"];
@@ -5083,6 +5283,7 @@ class Public {
50835283 Public Public_from_JSON(mixed json) {
50845284 Public retval = Public();
50855285
5286+ if (!intp(json["public"])) error("Expected integer");
50865287 retval.public_public = json["public"];
50875288
50885289 return retval;
@@ -5103,6 +5304,7 @@ class Return {
51035304 Return Return_from_JSON(mixed json) {
51045305 Return retval = Return();
51055306
5307+ if (!intp(json["return"])) error("Expected integer");
51065308 retval.return_return = json["return"];
51075309
51085310 return retval;
@@ -5123,6 +5325,7 @@ class SelfClass {
51235325 SelfClass SelfClass_from_JSON(mixed json) {
51245326 SelfClass retval = SelfClass();
51255327
5328+ if (!intp(json["self"])) error("Expected integer");
51265329 retval.self = json["self"];
51275330
51285331 return retval;
@@ -5143,6 +5346,7 @@ class Static {
51435346 Static Static_from_JSON(mixed json) {
51445347 Static retval = Static();
51455348
5349+ if (!intp(json["static"])) error("Expected integer");
51465350 retval.static_static = json["static"];
51475351
51485352 return retval;
@@ -5163,6 +5367,7 @@ class String {
51635367 String String_from_JSON(mixed json) {
51645368 String retval = String();
51655369
5370+ if (!intp(json["string"])) error("Expected integer");
51665371 retval.string_string = json["string"];
51675372
51685373 return retval;
@@ -5183,6 +5388,7 @@ class Switch {
51835388 Switch Switch_from_JSON(mixed json) {
51845389 Switch retval = Switch();
51855390
5391+ if (!intp(json["switch"])) error("Expected integer");
51865392 retval.switch_switch = json["switch"];
51875393
51885394 return retval;
@@ -5203,6 +5409,7 @@ class TrueClass {
52035409 TrueClass TrueClass_from_JSON(mixed json) {
52045410 TrueClass retval = TrueClass();
52055411
5412+ if (!intp(json["true"])) error("Expected integer");
52065413 retval.true = json["true"];
52075414
52085415 return retval;
@@ -5223,6 +5430,7 @@ class TypeClass {
52235430 TypeClass TypeClass_from_JSON(mixed json) {
52245431 TypeClass retval = TypeClass();
52255432
5433+ if (!intp(json["type"])) error("Expected integer");
52265434 retval.type = json["type"];
52275435
52285436 return retval;
@@ -5243,6 +5451,7 @@ class Typedef {
52435451 Typedef Typedef_from_JSON(mixed json) {
52445452 Typedef retval = Typedef();
52455453
5454+ if (!intp(json["typedef"])) error("Expected integer");
52465455 retval.typedef_typedef = json["typedef"];
52475456
52485457 return retval;
@@ -5263,6 +5472,7 @@ class Typeof {
52635472 Typeof Typeof_from_JSON(mixed json) {
52645473 Typeof retval = Typeof();
52655474
5475+ if (!intp(json["typeof"])) error("Expected integer");
52665476 retval.typeof_typeof = json["typeof"];
52675477
52685478 return retval;
@@ -5283,6 +5493,7 @@ class Quicktype {
52835493 Quicktype Quicktype_from_JSON(mixed json) {
52845494 Quicktype retval = Quicktype();
52855495
5496+ if (!intp(json["quicktype"])) error("Expected integer");
52865497 retval.quicktype = json["quicktype"];
52875498
52885499 return retval;
@@ -5303,6 +5514,7 @@ class Raise {
53035514 Raise Raise_from_JSON(mixed json) {
53045515 Raise retval = Raise();
53055516
5517+ if (!intp(json["raise"])) error("Expected integer");
53065518 retval.raise = json["raise"];
53075519
53085520 return retval;
@@ -5323,6 +5535,7 @@ class Range {
53235535 Range Range_from_JSON(mixed json) {
53245536 Range retval = Range();
53255537
5538+ if (!intp(json["range"])) error("Expected integer");
53265539 retval.range = json["range"];
53275540
53285541 return retval;
@@ -5343,6 +5556,7 @@ class Readonly {
53435556 Readonly Readonly_from_JSON(mixed json) {
53445557 Readonly retval = Readonly();
53455558
5559+ if (!intp(json["readonly"])) error("Expected integer");
53465560 retval.readonly = json["readonly"];
53475561
53485562 return retval;
@@ -5363,6 +5577,7 @@ class Ref {
53635577 Ref Ref_from_JSON(mixed json) {
53645578 Ref retval = Ref();
53655579
5580+ if (!intp(json["ref"])) error("Expected integer");
53665581 retval.ref = json["ref"];
53675582
53685583 return retval;
@@ -5383,6 +5598,7 @@ class Register {
53835598 Register Register_from_JSON(mixed json) {
53845599 Register retval = Register();
53855600
5601+ if (!intp(json["register"])) error("Expected integer");
53865602 retval.register = json["register"];
53875603
53885604 return retval;
@@ -5403,6 +5619,7 @@ class ReinterpretCast {
54035619 ReinterpretCast ReinterpretCast_from_JSON(mixed json) {
54045620 ReinterpretCast retval = ReinterpretCast();
54055621
5622+ if (!intp(json["reinterpret_cast"])) error("Expected integer");
54065623 retval.reinterpret_cast = json["reinterpret_cast"];
54075624
54085625 return retval;
@@ -5423,6 +5640,7 @@ class Repeat {
54235640 Repeat Repeat_from_JSON(mixed json) {
54245641 Repeat retval = Repeat();
54255642
5643+ if (!intp(json["repeat"])) error("Expected integer");
54265644 retval.repeat = json["repeat"];
54275645
54285646 return retval;
@@ -5443,6 +5661,7 @@ class Require {
54435661 Require Require_from_JSON(mixed json) {
54445662 Require retval = Require();
54455663
5664+ if (!intp(json["require"])) error("Expected integer");
54465665 retval.require = json["require"];
54475666
54485667 return retval;
@@ -5463,6 +5682,7 @@ class Required {
54635682 Required Required_from_JSON(mixed json) {
54645683 Required retval = Required();
54655684
5685+ if (!intp(json["required"])) error("Expected integer");
54665686 retval.required = json["required"];
54675687
54685688 return retval;
@@ -5483,6 +5703,7 @@ class Requires {
54835703 Requires Requires_from_JSON(mixed json) {
54845704 Requires retval = Requires();
54855705
5706+ if (!intp(json["requires"])) error("Expected integer");
54865707 retval.requires = json["requires"];
54875708
54885709 return retval;
@@ -5503,6 +5724,7 @@ class Restrict {
55035724 Restrict Restrict_from_JSON(mixed json) {
55045725 Restrict retval = Restrict();
55055726
5727+ if (!intp(json["restrict"])) error("Expected integer");
55065728 retval.restrict = json["restrict"];
55075729
55085730 return retval;
@@ -5523,6 +5745,7 @@ class Retain {
55235745 Retain Retain_from_JSON(mixed json) {
55245746 Retain retval = Retain();
55255747
5748+ if (!intp(json["retain"])) error("Expected integer");
55265749 retval.retain = json["retain"];
55275750
55285751 return retval;
@@ -5543,6 +5766,7 @@ class Rethrows {
55435766 Rethrows Rethrows_from_JSON(mixed json) {
55445767 Rethrows retval = Rethrows();
55455768
5769+ if (!intp(json["rethrows"])) error("Expected integer");
55465770 retval.rethrows = json["rethrows"];
55475771
55485772 return retval;
@@ -5563,6 +5787,7 @@ class Right {
55635787 Right Right_from_JSON(mixed json) {
55645788 Right retval = Right();
55655789
5790+ if (!intp(json["right"])) error("Expected integer");
55665791 retval.right = json["right"];
55675792
55685793 return retval;
@@ -5583,6 +5808,7 @@ class Sbyte {
55835808 Sbyte Sbyte_from_JSON(mixed json) {
55845809 Sbyte retval = Sbyte();
55855810
5811+ if (!intp(json["sbyte"])) error("Expected integer");
55865812 retval.sbyte = json["sbyte"];
55875813
55885814 return retval;
@@ -5603,6 +5829,7 @@ class Sealed {
56035829 Sealed Sealed_from_JSON(mixed json) {
56045830 Sealed retval = Sealed();
56055831
5832+ if (!intp(json["sealed"])) error("Expected integer");
56065833 retval.sealed = json["sealed"];
56075834
56085835 return retval;
@@ -5623,6 +5850,7 @@ class Sel {
56235850 Sel Sel_from_JSON(mixed json) {
56245851 Sel retval = Sel();
56255852
5853+ if (!intp(json["SEL"])) error("Expected integer");
56265854 retval.sel = json["SEL"];
56275855
56285856 return retval;
@@ -5643,6 +5871,7 @@ class Select {
56435871 Select Select_from_JSON(mixed json) {
56445872 Select retval = Select();
56455873
5874+ if (!intp(json["select"])) error("Expected integer");
56465875 retval.select = json["select"];
56475876
56485877 return retval;
@@ -5663,6 +5892,7 @@ class Self {
56635892 Self Self_from_JSON(mixed json) {
56645893 Self retval = Self();
56655894
5895+ if (!intp(json["Self"])) error("Expected integer");
56665896 retval.self = json["Self"];
56675897
56685898 return retval;
@@ -5683,6 +5913,7 @@ class Serialize {
56835913 Serialize Serialize_from_JSON(mixed json) {
56845914 Serialize retval = Serialize();
56855915
5916+ if (!intp(json["serialize"])) error("Expected integer");
56865917 retval.serialize = json["serialize"];
56875918
56885919 return retval;
@@ -5703,6 +5934,7 @@ class Set {
57035934 Set Set_from_JSON(mixed json) {
57045935 Set retval = Set();
57055936
5937+ if (!intp(json["set"])) error("Expected integer");
57065938 retval.set = json["set"];
57075939
57085940 return retval;
@@ -5723,6 +5955,7 @@ class Short {
57235955 Short Short_from_JSON(mixed json) {
57245956 Short retval = Short();
57255957
5958+ if (!intp(json["short"])) error("Expected integer");
57265959 retval.short = json["short"];
57275960
57285961 return retval;
@@ -5743,6 +5976,7 @@ class Signed {
57435976 Signed Signed_from_JSON(mixed json) {
57445977 Signed retval = Signed();
57455978
5979+ if (!intp(json["signed"])) error("Expected integer");
57465980 retval.signed = json["signed"];
57475981
57485982 return retval;
@@ -5763,6 +5997,7 @@ class Sizeof {
57635997 Sizeof Sizeof_from_JSON(mixed json) {
57645998 Sizeof retval = Sizeof();
57655999
6000+ if (!intp(json["sizeof"])) error("Expected integer");
57666001 retval.sizeof = json["sizeof"];
57676002
57686003 return retval;
@@ -5783,6 +6018,7 @@ class Stackalloc {
57836018 Stackalloc Stackalloc_from_JSON(mixed json) {
57846019 Stackalloc retval = Stackalloc();
57856020
6021+ if (!intp(json["stackalloc"])) error("Expected integer");
57866022 retval.stackalloc = json["stackalloc"];
57876023
57886024 return retval;
@@ -5803,6 +6039,7 @@ class StaticAssert {
58036039 StaticAssert StaticAssert_from_JSON(mixed json) {
58046040 StaticAssert retval = StaticAssert();
58056041
6042+ if (!intp(json["static_assert"])) error("Expected integer");
58066043 retval.static_assert = json["static_assert"];
58076044
58086045 return retval;
@@ -5823,6 +6060,7 @@ class StaticCast {
58236060 StaticCast StaticCast_from_JSON(mixed json) {
58246061 StaticCast retval = StaticCast();
58256062
6063+ if (!intp(json["static_cast"])) error("Expected integer");
58266064 retval.static_cast = json["static_cast"];
58276065
58286066 return retval;
@@ -5843,6 +6081,7 @@ class Strictfp {
58436081 Strictfp Strictfp_from_JSON(mixed json) {
58446082 Strictfp retval = Strictfp();
58456083
6084+ if (!intp(json["strictfp"])) error("Expected integer");
58466085 retval.strictfp = json["strictfp"];
58476086
58486087 return retval;
@@ -5863,6 +6102,7 @@ class Struct {
58636102 Struct Struct_from_JSON(mixed json) {
58646103 Struct retval = Struct();
58656104
6105+ if (!intp(json["struct"])) error("Expected integer");
58666106 retval.struct = json["struct"];
58676107
58686108 return retval;
@@ -5883,6 +6123,7 @@ class Subscript {
58836123 Subscript Subscript_from_JSON(mixed json) {
58846124 Subscript retval = Subscript();
58856125
6126+ if (!intp(json["subscript"])) error("Expected integer");
58866127 retval.subscript = json["subscript"];
58876128
58886129 return retval;
@@ -5903,6 +6144,7 @@ class Super {
59036144 Super Super_from_JSON(mixed json) {
59046145 Super retval = Super();
59056146
6147+ if (!intp(json["super"])) error("Expected integer");
59066148 retval.super = json["super"];
59076149
59086150 return retval;
@@ -5923,6 +6165,7 @@ class Symbol {
59236165 Symbol Symbol_from_JSON(mixed json) {
59246166 Symbol retval = Symbol();
59256167
6168+ if (!intp(json["symbol"])) error("Expected integer");
59266169 retval.symbol = json["symbol"];
59276170
59286171 return retval;
@@ -5943,6 +6186,7 @@ class Synchronized {
59436186 Synchronized Synchronized_from_JSON(mixed json) {
59446187 Synchronized retval = Synchronized();
59456188
6189+ if (!intp(json["synchronized"])) error("Expected integer");
59466190 retval.synchronized = json["synchronized"];
59476191
59486192 return retval;
@@ -5963,6 +6207,7 @@ class System {
59636207 System System_from_JSON(mixed json) {
59646208 System retval = System();
59656209
6210+ if (!intp(json["system"])) error("Expected integer");
59666211 retval.system = json["system"];
59676212
59686213 return retval;
@@ -5983,6 +6228,7 @@ class Template {
59836228 Template Template_from_JSON(mixed json) {
59846229 Template retval = Template();
59856230
6231+ if (!intp(json["template"])) error("Expected integer");
59866232 retval.template = json["template"];
59876233
59886234 return retval;
@@ -6003,6 +6249,7 @@ class Then {
60036249 Then Then_from_JSON(mixed json) {
60046250 Then retval = Then();
60056251
6252+ if (!intp(json["then"])) error("Expected integer");
60066253 retval.then = json["then"];
60076254
60086255 return retval;
@@ -6023,6 +6270,7 @@ class This {
60236270 This This_from_JSON(mixed json) {
60246271 This retval = This();
60256272
6273+ if (!intp(json["this"])) error("Expected integer");
60266274 retval.this = json["this"];
60276275
60286276 return retval;
@@ -6043,6 +6291,7 @@ class ThreadLocal {
60436291 ThreadLocal ThreadLocal_from_JSON(mixed json) {
60446292 ThreadLocal retval = ThreadLocal();
60456293
6294+ if (!intp(json["thread_local"])) error("Expected integer");
60466295 retval.thread_local = json["thread_local"];
60476296
60486297 return retval;
@@ -6063,6 +6312,7 @@ class Throw {
60636312 Throw Throw_from_JSON(mixed json) {
60646313 Throw retval = Throw();
60656314
6315+ if (!intp(json["throw"])) error("Expected integer");
60666316 retval.throw = json["throw"];
60676317
60686318 return retval;
@@ -6083,6 +6333,7 @@ class Throws {
60836333 Throws Throws_from_JSON(mixed json) {
60846334 Throws retval = Throws();
60856335
6336+ if (!intp(json["throws"])) error("Expected integer");
60866337 retval.throws = json["throws"];
60876338
60886339 return retval;
@@ -6103,6 +6354,7 @@ class ToJson {
61036354 ToJson ToJson_from_JSON(mixed json) {
61046355 ToJson retval = ToJson();
61056356
6357+ if (!intp(json["to_json"])) error("Expected integer");
61066358 retval.to_json = json["to_json"];
61076359
61086360 return retval;
@@ -6123,6 +6375,7 @@ class TopLevelClass {
61236375 TopLevelClass TopLevelClass_from_JSON(mixed json) {
61246376 TopLevelClass retval = TopLevelClass();
61256377
6378+ if (!intp(json["top_level"])) error("Expected integer");
61266379 retval.top_level = json["top_level"];
61276380
61286381 return retval;
@@ -6143,6 +6396,7 @@ class Transient {
61436396 Transient Transient_from_JSON(mixed json) {
61446397 Transient retval = Transient();
61456398
6399+ if (!intp(json["transient"])) error("Expected integer");
61466400 retval.transient = json["transient"];
61476401
61486402 return retval;
@@ -6163,6 +6417,7 @@ class True {
61636417 True True_from_JSON(mixed json) {
61646418 True retval = True();
61656419
6420+ if (!intp(json["True"])) error("Expected integer");
61666421 retval.true = json["True"];
61676422
61686423 return retval;
@@ -6183,6 +6438,7 @@ class Try {
61836438 Try Try_from_JSON(mixed json) {
61846439 Try retval = Try();
61856440
6441+ if (!intp(json["try"])) error("Expected integer");
61866442 retval.try = json["try"];
61876443
61886444 return retval;
@@ -6203,6 +6459,7 @@ class Type {
62036459 Type Type_from_JSON(mixed json) {
62046460 Type retval = Type();
62056461
6462+ if (!intp(json["Type"])) error("Expected integer");
62066463 retval.type = json["Type"];
62076464
62086465 return retval;
@@ -6223,6 +6480,7 @@ class Typealias {
62236480 Typealias Typealias_from_JSON(mixed json) {
62246481 Typealias retval = Typealias();
62256482
6483+ if (!intp(json["typealias"])) error("Expected integer");
62266484 retval.typealias = json["typealias"];
62276485
62286486 return retval;
@@ -6243,6 +6501,7 @@ class Typeid {
62436501 Typeid Typeid_from_JSON(mixed json) {
62446502 Typeid retval = Typeid();
62456503
6504+ if (!intp(json["typeid"])) error("Expected integer");
62466505 retval.typeid = json["typeid"];
62476506
62486507 return retval;
@@ -6263,6 +6522,7 @@ class Typename {
62636522 Typename Typename_from_JSON(mixed json) {
62646523 Typename retval = Typename();
62656524
6525+ if (!intp(json["typename"])) error("Expected integer");
62666526 retval.typename = json["typename"];
62676527
62686528 return retval;
@@ -6283,6 +6543,7 @@ class Uint {
62836543 Uint Uint_from_JSON(mixed json) {
62846544 Uint retval = Uint();
62856545
6546+ if (!intp(json["uint"])) error("Expected integer");
62866547 retval.uint = json["uint"];
62876548
62886549 return retval;
@@ -6303,6 +6564,7 @@ class Ulong {
63036564 Ulong Ulong_from_JSON(mixed json) {
63046565 Ulong retval = Ulong();
63056566
6567+ if (!intp(json["ulong"])) error("Expected integer");
63066568 retval.ulong = json["ulong"];
63076569
63086570 return retval;
@@ -6323,6 +6585,7 @@ class Unchecked {
63236585 Unchecked Unchecked_from_JSON(mixed json) {
63246586 Unchecked retval = Unchecked();
63256587
6588+ if (!intp(json["unchecked"])) error("Expected integer");
63266589 retval.unchecked = json["unchecked"];
63276590
63286591 return retval;
@@ -6343,6 +6606,7 @@ class Undefined {
63436606 Undefined Undefined_from_JSON(mixed json) {
63446607 Undefined retval = Undefined();
63456608
6609+ if (!intp(json["undefined"])) error("Expected integer");
63466610 retval.undefined = json["undefined"];
63476611
63486612 return retval;
@@ -6403,6 +6667,7 @@ class Obj5 {
64036667 Obj5 Obj5_from_JSON(mixed json) {
64046668 Obj5 retval = Obj5();
64056669
6670+ if (!intp(json["dummy"])) error("Expected integer");
64066671 retval.dummy = json["dummy"];
64076672 Void_from_JSON(json["void"]);
64086673 retval.obj5_void = json["void"];
@@ -6463,6 +6728,7 @@ class Void {
64636728 Void Void_from_JSON(mixed json) {
64646729 Void retval = Void();
64656730
6731+ if (!intp(json["void"])) error("Expected integer");
64666732 retval.void_void = json["void"];
64676733
64686734 return retval;
@@ -6483,6 +6749,7 @@ class While {
64836749 While While_from_JSON(mixed json) {
64846750 While retval = While();
64856751
6752+ if (!intp(json["while"])) error("Expected integer");
64866753 retval.while_while = json["while"];
64876754
64886755 return retval;
@@ -6503,6 +6770,7 @@ class Union {
65036770 Union Union_from_JSON(mixed json) {
65046771 Union retval = Union();
65056772
6773+ if (!intp(json["union"])) error("Expected integer");
65066774 retval.union = json["union"];
65076775
65086776 return retval;
@@ -6523,6 +6791,7 @@ class Unowned {
65236791 Unowned Unowned_from_JSON(mixed json) {
65246792 Unowned retval = Unowned();
65256793
6794+ if (!intp(json["unowned"])) error("Expected integer");
65266795 retval.unowned = json["unowned"];
65276796
65286797 return retval;
@@ -6543,6 +6812,7 @@ class Unsafe {
65436812 Unsafe Unsafe_from_JSON(mixed json) {
65446813 Unsafe retval = Unsafe();
65456814
6815+ if (!intp(json["unsafe"])) error("Expected integer");
65466816 retval.unsafe = json["unsafe"];
65476817
65486818 return retval;
@@ -6563,6 +6833,7 @@ class Unsigned {
65636833 Unsigned Unsigned_from_JSON(mixed json) {
65646834 Unsigned retval = Unsigned();
65656835
6836+ if (!intp(json["unsigned"])) error("Expected integer");
65666837 retval.unsigned = json["unsigned"];
65676838
65686839 return retval;
@@ -6583,6 +6854,7 @@ class Ushort {
65836854 Ushort Ushort_from_JSON(mixed json) {
65846855 Ushort retval = Ushort();
65856856
6857+ if (!intp(json["ushort"])) error("Expected integer");
65866858 retval.ushort = json["ushort"];
65876859
65886860 return retval;
@@ -6603,6 +6875,7 @@ class Using {
66036875 Using Using_from_JSON(mixed json) {
66046876 Using retval = Using();
66056877
6878+ if (!intp(json["using"])) error("Expected integer");
66066879 retval.using = json["using"];
66076880
66086881 return retval;
@@ -6623,6 +6896,7 @@ class Var {
66236896 Var Var_from_JSON(mixed json) {
66246897 Var retval = Var();
66256898
6899+ if (!intp(json["var"])) error("Expected integer");
66266900 retval.var = json["var"];
66276901
66286902 return retval;
@@ -6643,6 +6917,7 @@ class Virtual {
66436917 Virtual Virtual_from_JSON(mixed json) {
66446918 Virtual retval = Virtual();
66456919
6920+ if (!intp(json["virtual"])) error("Expected integer");
66466921 retval.virtual = json["virtual"];
66476922
66486923 return retval;
@@ -6663,6 +6938,7 @@ class Volatile {
66636938 Volatile Volatile_from_JSON(mixed json) {
66646939 Volatile retval = Volatile();
66656940
6941+ if (!intp(json["volatile"])) error("Expected integer");
66666942 retval.volatile = json["volatile"];
66676943
66686944 return retval;
@@ -6683,6 +6959,7 @@ class WcharT {
66836959 WcharT WcharT_from_JSON(mixed json) {
66846960 WcharT retval = WcharT();
66856961
6962+ if (!intp(json["wchar_t"])) error("Expected integer");
66866963 retval.wchar_t = json["wchar_t"];
66876964
66886965 return retval;
@@ -6703,6 +6980,7 @@ class Weak {
67036980 Weak Weak_from_JSON(mixed json) {
67046981 Weak retval = Weak();
67056982
6983+ if (!intp(json["weak"])) error("Expected integer");
67066984 retval.weak = json["weak"];
67076985
67086986 return retval;
@@ -6723,6 +7001,7 @@ class Where {
67237001 Where Where_from_JSON(mixed json) {
67247002 Where retval = Where();
67257003
7004+ if (!intp(json["where"])) error("Expected integer");
67267005 retval.where = json["where"];
67277006
67287007 return retval;
@@ -6743,6 +7022,7 @@ class WillSet {
67437022 WillSet WillSet_from_JSON(mixed json) {
67447023 WillSet retval = WillSet();
67457024
7025+ if (!intp(json["willSet"])) error("Expected integer");
67467026 retval.will_set = json["willSet"];
67477027
67487028 return retval;
@@ -6763,6 +7043,7 @@ class With {
67637043 With With_from_JSON(mixed json) {
67647044 With retval = With();
67657045
7046+ if (!intp(json["with"])) error("Expected integer");
67667047 retval.with = json["with"];
67677048
67687049 return retval;
@@ -6783,6 +7064,7 @@ class Xor {
67837064 Xor Xor_from_JSON(mixed json) {
67847065 Xor retval = Xor();
67857066
7067+ if (!intp(json["xor"])) error("Expected integer");
67867068 retval.xor = json["xor"];
67877069
67887070 return retval;
@@ -6803,6 +7085,7 @@ class XorEq {
68037085 XorEq XorEq_from_JSON(mixed json) {
68047086 XorEq retval = XorEq();
68057087
7088+ if (!intp(json["xor_eq"])) error("Expected integer");
68067089 retval.xor_eq = json["xor_eq"];
68077090
68087091 return retval;
@@ -6823,6 +7106,7 @@ class Yes {
68237106 Yes Yes_from_JSON(mixed json) {
68247107 Yes retval = Yes();
68257108
7109+ if (!intp(json["YES"])) error("Expected integer");
68267110 retval.yes = json["YES"];
68277111
68287112 return retval;
@@ -6843,6 +7127,7 @@ class Yield {
68437127 Yield Yield_from_JSON(mixed json) {
68447128 Yield retval = Yield();
68457129
7130+ if (!intp(json["yield"])) error("Expected integer");
68467131 retval.yield = json["yield"];
68477132
68487133 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 if (has_index(json, "next") && json["next"] != 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 Totallds_from_JSON(json["totallds"]);
8997 retval.totallds = json["totallds"];
@@ -147,15 +155,18 @@ Othermatch Othermatch_from_JSON(mixed json) {
147155 retval.clock = json["clock"];
148156 retval.competition_name = json["competitionName"];
149157 retval.id = json["id"];
158+ if (!intp(json["period"])) error("Expected integer");
150159 retval.period = json["period"];
151160 retval.period_type = PerType_from_JSON(json["periodType"]);
152161 Team_from_JSON(json["team1"]);
153162 retval.team1 = json["team1"];
154163 retval.team1_name = json["team1Name"];
164+ if (!intp(json["team1Score"])) error("Expected integer");
155165 retval.team1_score = json["team1Score"];
156166 Team_from_JSON(json["team2"]);
157167 retval.team2 = json["team2"];
158168 retval.team2_name = json["team2Name"];
169+ if (!intp(json["team2Score"])) error("Expected integer");
159170 retval.team2_score = json["team2Score"];
160171
161172 return retval;
@@ -269,19 +280,27 @@ Pbp Pbp_from_JSON(mixed json) {
269280 retval.international_family_name_initial = FamilyNameInitial_from_JSON(json["internationalFamilyNameInitial"]);
270281 retval.international_first_name = json["internationalFirstName"];
271282 retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]);
283+ if (!intp(json["lead"])) error("Expected integer");
272284 retval.lead = json["lead"];
285+ if (!intp(json["period"])) error("Expected integer");
273286 retval.period = json["period"];
274287 retval.period_type = PerType_from_JSON(json["periodType"]);
275288 retval.player = json["player"];
289+ if (!intp(json["pno"])) error("Expected integer");
276290 retval.pno = json["pno"];
277291 retval.qualifier = json["qualifier"];
292+ if (!intp(json["s1"])) error("Expected integer");
278293 retval.s1 = json["s1"];
294+ if (!intp(json["s2"])) error("Expected integer");
279295 retval.s2 = json["s2"];
280296 retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]);
297+ if (!intp(json["scoring"])) error("Expected integer");
281298 retval.scoring = json["scoring"];
282299 retval.shirt_number = json["shirtNumber"];
283300 retval.sub_type = json["subType"];
301+ if (!intp(json["success"])) error("Expected integer");
284302 retval.success = json["success"];
303+ if (!intp(json["tno"])) error("Expected integer");
285304 retval.tno = json["tno"];
286305
287306 return retval;
@@ -427,11 +446,13 @@ Scorer Scorer_from_JSON(mixed json) {
427446 retval.per = json["per"];
428447 retval.per_type = PerType_from_JSON(json["perType"]);
429448 retval.player = json["player"];
449+ if (!intp(json["pno"])) error("Expected integer");
430450 retval.pno = json["pno"];
431451 retval.scoreboard_name = ScoreboardName_from_JSON(json["scoreboardName"]);
432452 retval.shirt_number = json["shirtNumber"];
433453 retval.summary = json["summary"];
434454 retval.times = json["times"];
455+ if (!intp(json["tno"])) error("Expected integer");
435456 retval.tno = json["tno"];
436457 retval.tot = json["tot"];
437458
@@ -458,6 +479,7 @@ Time Time_from_JSON(mixed json) {
458479 Time retval = Time();
459480
460481 retval.gt = json["gt"];
482+ if (!intp(json["per"])) error("Expected integer");
461483 retval.per = json["per"];
462484 retval.per_type = PerType_from_JSON(json["perType"]);
463485
@@ -609,69 +631,121 @@ Tm Tm_from_JSON(mixed json) {
609631
610632 retval.code = json["code"];
611633 retval.code_international = json["codeInternational"];
634+ if (!intp(json["fouls"])) error("Expected integer");
612635 retval.fouls = json["fouls"];
636+ if (!intp(json["full_score"])) error("Expected integer");
613637 retval.full_score = json["full_score"];
614638 Lds_from_JSON(json["lds"]);
615639 retval.lds = json["lds"];
616640 retval.logo = json["logo"];
617641 retval.name = json["name"];
618642 retval.name_international = json["nameInternational"];
643+ if (!intp(json["p1_score"])) error("Expected integer");
619644 retval.p1_score = json["p1_score"];
645+ if (!intp(json["p2_score"])) error("Expected integer");
620646 retval.p2_score = json["p2_score"];
647+ if (!intp(json["p3_score"])) error("Expected integer");
621648 retval.p3_score = json["p3_score"];
649+ if (!intp(json["p4_score"])) error("Expected integer");
622650 retval.p4_score = json["p4_score"];
623651 retval.pl = json["pl"];
652+ if (!intp(json["score"])) error("Expected integer");
624653 retval.score = json["score"];
625654 retval.scoring = json["scoring"];
626655 retval.short_name = json["shortName"];
627656 retval.short_name_international = json["shortNameInternational"];
628657 retval.shot = json["shot"];
658+ if (!intp(json["timeouts"])) error("Expected integer");
629659 retval.timeouts = json["timeouts"];
660+ if (!intp(json["tot_eff_1"])) error("Expected integer");
630661 retval.tot_eff_1 = json["tot_eff_1"];
662+ if (!intp(json["tot_eff_2"])) error("Expected integer");
631663 retval.tot_eff_2 = json["tot_eff_2"];
632664 retval.tot_eff_3 = (float)json["tot_eff_3"];
665+ if (!intp(json["tot_eff_4"])) error("Expected integer");
633666 retval.tot_eff_4 = json["tot_eff_4"];
667+ if (!intp(json["tot_eff_5"])) error("Expected integer");
634668 retval.tot_eff_5 = json["tot_eff_5"];
669+ if (!intp(json["tot_eff_6"])) error("Expected integer");
635670 retval.tot_eff_6 = json["tot_eff_6"];
671+ if (!intp(json["tot_eff_7"])) error("Expected integer");
636672 retval.tot_eff_7 = json["tot_eff_7"];
673+ if (!intp(json["tot_sAssists"])) error("Expected integer");
637674 retval.tot_s_assists = json["tot_sAssists"];
675+ if (!intp(json["tot_sBenchPoints"])) error("Expected integer");
638676 retval.tot_s_bench_points = json["tot_sBenchPoints"];
677+ if (!intp(json["tot_sBiggestLead"])) error("Expected integer");
639678 retval.tot_s_biggest_lead = json["tot_sBiggestLead"];
679+ if (!intp(json["tot_sBiggestScoringRun"])) error("Expected integer");
640680 retval.tot_s_biggest_scoring_run = json["tot_sBiggestScoringRun"];
681+ if (!intp(json["tot_sBlocks"])) error("Expected integer");
641682 retval.tot_s_blocks = json["tot_sBlocks"];
683+ if (!intp(json["tot_sBlocksReceived"])) error("Expected integer");
642684 retval.tot_s_blocks_received = json["tot_sBlocksReceived"];
685+ if (!intp(json["tot_sFieldGoalsAttempted"])) error("Expected integer");
643686 retval.tot_s_field_goals_attempted = json["tot_sFieldGoalsAttempted"];
687+ if (!intp(json["tot_sFieldGoalsMade"])) error("Expected integer");
644688 retval.tot_s_field_goals_made = json["tot_sFieldGoalsMade"];
689+ if (!intp(json["tot_sFieldGoalsPercentage"])) error("Expected integer");
645690 retval.tot_s_field_goals_percentage = json["tot_sFieldGoalsPercentage"];
691+ if (!intp(json["tot_sFoulsOn"])) error("Expected integer");
646692 retval.tot_s_fouls_on = json["tot_sFoulsOn"];
693+ if (!intp(json["tot_sFoulsPersonal"])) error("Expected integer");
647694 retval.tot_s_fouls_personal = json["tot_sFoulsPersonal"];
695+ if (!intp(json["tot_sFoulsTeam"])) error("Expected integer");
648696 retval.tot_s_fouls_team = json["tot_sFoulsTeam"];
697+ if (!intp(json["tot_sFreeThrowsAttempted"])) error("Expected integer");
649698 retval.tot_s_free_throws_attempted = json["tot_sFreeThrowsAttempted"];
699+ if (!intp(json["tot_sFreeThrowsMade"])) error("Expected integer");
650700 retval.tot_s_free_throws_made = json["tot_sFreeThrowsMade"];
701+ if (!intp(json["tot_sFreeThrowsPercentage"])) error("Expected integer");
651702 retval.tot_s_free_throws_percentage = json["tot_sFreeThrowsPercentage"];
703+ if (!intp(json["tot_sLeadChanges"])) error("Expected integer");
652704 retval.tot_s_lead_changes = json["tot_sLeadChanges"];
705+ if (!intp(json["tot_sMinutes"])) error("Expected integer");
653706 retval.tot_s_minutes = json["tot_sMinutes"];
707+ if (!intp(json["tot_sPoints"])) error("Expected integer");
654708 retval.tot_s_points = json["tot_sPoints"];
709+ if (!intp(json["tot_sPointsFastBreak"])) error("Expected integer");
655710 retval.tot_s_points_fast_break = json["tot_sPointsFastBreak"];
711+ if (!intp(json["tot_sPointsFromTurnovers"])) error("Expected integer");
656712 retval.tot_s_points_from_turnovers = json["tot_sPointsFromTurnovers"];
713+ if (!intp(json["tot_sPointsInThePaint"])) error("Expected integer");
657714 retval.tot_s_points_in_the_paint = json["tot_sPointsInThePaint"];
715+ if (!intp(json["tot_sPointsSecondChance"])) error("Expected integer");
658716 retval.tot_s_points_second_chance = json["tot_sPointsSecondChance"];
717+ if (!intp(json["tot_sReboundsDefensive"])) error("Expected integer");
659718 retval.tot_s_rebounds_defensive = json["tot_sReboundsDefensive"];
719+ if (!intp(json["tot_sReboundsOffensive"])) error("Expected integer");
660720 retval.tot_s_rebounds_offensive = json["tot_sReboundsOffensive"];
721+ if (!intp(json["tot_sReboundsTeam"])) error("Expected integer");
661722 retval.tot_s_rebounds_team = json["tot_sReboundsTeam"];
723+ if (!intp(json["tot_sReboundsTeamDefensive"])) error("Expected integer");
662724 retval.tot_s_rebounds_team_defensive = json["tot_sReboundsTeamDefensive"];
725+ if (!intp(json["tot_sReboundsTeamOffensive"])) error("Expected integer");
663726 retval.tot_s_rebounds_team_offensive = json["tot_sReboundsTeamOffensive"];
727+ if (!intp(json["tot_sReboundsTotal"])) error("Expected integer");
664728 retval.tot_s_rebounds_total = json["tot_sReboundsTotal"];
729+ if (!intp(json["tot_sSteals"])) error("Expected integer");
665730 retval.tot_s_steals = json["tot_sSteals"];
731+ if (!intp(json["tot_sThreePointersAttempted"])) error("Expected integer");
666732 retval.tot_s_three_pointers_attempted = json["tot_sThreePointersAttempted"];
733+ if (!intp(json["tot_sThreePointersMade"])) error("Expected integer");
667734 retval.tot_s_three_pointers_made = json["tot_sThreePointersMade"];
735+ if (!intp(json["tot_sThreePointersPercentage"])) error("Expected integer");
668736 retval.tot_s_three_pointers_percentage = json["tot_sThreePointersPercentage"];
669737 retval.tot_s_time_leading = (float)json["tot_sTimeLeading"];
738+ if (!intp(json["tot_sTimesScoresLevel"])) error("Expected integer");
670739 retval.tot_s_times_scores_level = json["tot_sTimesScoresLevel"];
740+ if (!intp(json["tot_sTurnovers"])) error("Expected integer");
671741 retval.tot_s_turnovers = json["tot_sTurnovers"];
742+ if (!intp(json["tot_sTurnoversTeam"])) error("Expected integer");
672743 retval.tot_s_turnovers_team = json["tot_sTurnoversTeam"];
744+ if (!intp(json["tot_sTwoPointersAttempted"])) error("Expected integer");
673745 retval.tot_s_two_pointers_attempted = json["tot_sTwoPointersAttempted"];
746+ if (!intp(json["tot_sTwoPointersMade"])) error("Expected integer");
674747 retval.tot_s_two_pointers_made = json["tot_sTwoPointersMade"];
748+ if (!intp(json["tot_sTwoPointersPercentage"])) error("Expected integer");
675749 retval.tot_s_two_pointers_percentage = json["tot_sTwoPointersPercentage"];
676750
677751 return retval;
@@ -844,16 +918,22 @@ class Pl {
844918 Pl Pl_from_JSON(mixed json) {
845919 Pl retval = Pl();
846920
921+ if (!intp(json["active"])) error("Expected integer");
847922 retval.active = json["active"];
848923 retval.captain = json["captain"];
849924 if (has_index(json, "comp") && json["comp"] != Val.null) Comp_from_JSON(json["comp"]);
850925 retval.comp = json["comp"];
926+ if (!intp(json["eff_1"])) error("Expected integer");
851927 retval.eff_1 = json["eff_1"];
928+ if (!intp(json["eff_2"])) error("Expected integer");
852929 retval.eff_2 = json["eff_2"];
853930 retval.eff_3 = (float)json["eff_3"];
854931 retval.eff_4 = (float)json["eff_4"];
932+ if (!intp(json["eff_5"])) error("Expected integer");
855933 retval.eff_5 = json["eff_5"];
934+ if (!intp(json["eff_6"])) error("Expected integer");
856935 retval.eff_6 = json["eff_6"];
936+ if (!intp(json["eff_7"])) error("Expected integer");
857937 retval.eff_7 = json["eff_7"];
858938 retval.family_name = json["familyName"];
859939 retval.family_name_initial = FamilyNameInitial_from_JSON(json["familyNameInitial"]);
@@ -865,36 +945,64 @@ Pl Pl_from_JSON(mixed json) {
865945 retval.international_first_name_initial = FirstNameInitial_from_JSON(json["internationalFirstNameInitial"]);
866946 retval.name = json["name"];
867947 retval.playing_position = json["playingPosition"];
948+ if (!intp(json["sAssists"])) error("Expected integer");
868949 retval.s_assists = json["sAssists"];
950+ if (!intp(json["sBlocks"])) error("Expected integer");
869951 retval.s_blocks = json["sBlocks"];
952+ if (!intp(json["sBlocksReceived"])) error("Expected integer");
870953 retval.s_blocks_received = json["sBlocksReceived"];
954+ if (!intp(json["sFieldGoalsAttempted"])) error("Expected integer");
871955 retval.s_field_goals_attempted = json["sFieldGoalsAttempted"];
956+ if (!intp(json["sFieldGoalsMade"])) error("Expected integer");
872957 retval.s_field_goals_made = json["sFieldGoalsMade"];
958+ if (!intp(json["sFieldGoalsPercentage"])) error("Expected integer");
873959 retval.s_field_goals_percentage = json["sFieldGoalsPercentage"];
960+ if (!intp(json["sFoulsOn"])) error("Expected integer");
874961 retval.s_fouls_on = json["sFoulsOn"];
962+ if (!intp(json["sFoulsPersonal"])) error("Expected integer");
875963 retval.s_fouls_personal = json["sFoulsPersonal"];
964+ if (!intp(json["sFreeThrowsAttempted"])) error("Expected integer");
876965 retval.s_free_throws_attempted = json["sFreeThrowsAttempted"];
966+ if (!intp(json["sFreeThrowsMade"])) error("Expected integer");
877967 retval.s_free_throws_made = json["sFreeThrowsMade"];
968+ if (!intp(json["sFreeThrowsPercentage"])) error("Expected integer");
878969 retval.s_free_throws_percentage = json["sFreeThrowsPercentage"];
879970 if (arrayp(json["sMinutes"])) error("Unexpected array");
880971 retval.s_minutes = json["sMinutes"];
972+ if (!intp(json["sPlusMinusPoints"])) error("Expected integer");
881973 retval.s_plus_minus_points = json["sPlusMinusPoints"];
974+ if (!intp(json["sPoints"])) error("Expected integer");
882975 retval.s_points = json["sPoints"];
976+ if (!intp(json["sPointsFastBreak"])) error("Expected integer");
883977 retval.s_points_fast_break = json["sPointsFastBreak"];
978+ if (!intp(json["sPointsInThePaint"])) error("Expected integer");
884979 retval.s_points_in_the_paint = json["sPointsInThePaint"];
980+ if (!intp(json["sPointsSecondChance"])) error("Expected integer");
885981 retval.s_points_second_chance = json["sPointsSecondChance"];
982+ if (!intp(json["sReboundsDefensive"])) error("Expected integer");
886983 retval.s_rebounds_defensive = json["sReboundsDefensive"];
984+ if (!intp(json["sReboundsOffensive"])) error("Expected integer");
887985 retval.s_rebounds_offensive = json["sReboundsOffensive"];
986+ if (!intp(json["sReboundsTotal"])) error("Expected integer");
888987 retval.s_rebounds_total = json["sReboundsTotal"];
988+ if (!intp(json["sSteals"])) error("Expected integer");
889989 retval.s_steals = json["sSteals"];
990+ if (!intp(json["sThreePointersAttempted"])) error("Expected integer");
890991 retval.s_three_pointers_attempted = json["sThreePointersAttempted"];
992+ if (!intp(json["sThreePointersMade"])) error("Expected integer");
891993 retval.s_three_pointers_made = json["sThreePointersMade"];
994+ if (!intp(json["sThreePointersPercentage"])) error("Expected integer");
892995 retval.s_three_pointers_percentage = json["sThreePointersPercentage"];
996+ if (!intp(json["sTurnovers"])) error("Expected integer");
893997 retval.s_turnovers = json["sTurnovers"];
998+ if (!intp(json["sTwoPointersAttempted"])) error("Expected integer");
894999 retval.s_two_pointers_attempted = json["sTwoPointersAttempted"];
1000+ if (!intp(json["sTwoPointersMade"])) error("Expected integer");
8951001 retval.s_two_pointers_made = json["sTwoPointersMade"];
1002+ if (!intp(json["sTwoPointersPercentage"])) error("Expected integer");
8961003 retval.s_two_pointers_percentage = json["sTwoPointersPercentage"];
8971004 retval.shirt_number = json["shirtNumber"];
1005+ if (!intp(json["starter"])) error("Expected integer");
8981006 retval.starter = json["starter"];
8991007
9001008 return retval;
@@ -973,16 +1081,23 @@ Shot Shot_from_JSON(mixed json) {
9731081 Shot retval = Shot();
9741082
9751083 retval.action_type = ActionType_from_JSON(json["actionType"]);
1084+ if (!intp(json["p"])) error("Expected integer");
9761085 retval.p = json["p"];
1086+ if (!intp(json["per"])) error("Expected integer");
9771087 retval.per = json["per"];
9781088 retval.per_type = PerType_from_JSON(json["perType"]);
9791089 retval.player = json["player"];
1090+ if (!intp(json["pno"])) error("Expected integer");
9801091 retval.pno = json["pno"];
1092+ if (!intp(json["r"])) error("Expected integer");
9811093 retval.r = json["r"];
9821094 retval.shirt_number = json["shirtNumber"];
9831095 retval.sub_type = SubType_from_JSON(json["subType"]);
1096+ if (!intp(json["tno"])) error("Expected integer");
9841097 retval.tno = json["tno"];
1098+ if (!intp(json["x"])) error("Expected integer");
9851099 retval.x = json["x"];
1100+ if (!intp(json["y"])) error("Expected integer");
9861101 retval.y = json["y"];
9871102
9881103 return retval;
Test case

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

1 generated file · +3 −0
Mpikedefault / TopLevel.pmod+3 −0
@@ -306,6 +306,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
306306 retval.y_string_with_del_character_json = json["y_string_with_del_character.json"];
307307 if (json["y_structure_lonely_false.json"] != Standards.JSON.true && json["y_structure_lonely_false.json"] != Standards.JSON.false) error("Expected bool");
308308 retval.y_structure_lonely_false_json = json["y_structure_lonely_false.json"];
309+ if (!intp(json["y_structure_lonely_int.json"])) error("Expected integer");
309310 retval.y_structure_lonely_int_json = json["y_structure_lonely_int.json"];
310311 retval.y_structure_lonely_negative_real_json = (float)json["y_structure_lonely_negative_real.json"];
311312 retval.y_structure_lonely_null_json = json["y_structure_lonely_null.json"];
@@ -377,6 +378,7 @@ class YObjectEmptyKeyJson {
377378 YObjectEmptyKeyJson YObjectEmptyKeyJson_from_JSON(mixed json) {
378379 YObjectEmptyKeyJson retval = YObjectEmptyKeyJson();
379380
381+ if (!intp(json[""])) error("Expected integer");
380382 retval.empty = json[""];
381383
382384 return retval;
@@ -397,6 +399,7 @@ class YObjectEscapedNullInKeyJson {
397399 YObjectEscapedNullInKeyJson YObjectEscapedNullInKeyJson_from_JSON(mixed json) {
398400 YObjectEscapedNullInKeyJson retval = YObjectEscapedNullInKeyJson();
399401
402+ if (!intp(json["foo\u0000bar"])) error("Expected integer");
400403 retval.foo_bar = json["foo\u0000bar"];
401404
402405 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
@@ -50,13 +50,18 @@ TopLevel TopLevel_from_JSON(mixed json) {
5050 Details_from_JSON(json["details"]);
5151 retval.details = json["details"];
5252 retval.match = json["match"];
53+ if (!intp(json["page"])) error("Expected integer");
5354 retval.page = json["page"];
5455 retval.product = json["product"];
5556 if (json["schk"] != Standards.JSON.true && json["schk"] != Standards.JSON.false) error("Expected bool");
5657 retval.schk = json["schk"];
58+ if (!intp(json["totallooseoffers"])) error("Expected integer");
5759 retval.totallooseoffers = json["totallooseoffers"];
60+ if (!intp(json["totalpages"])) error("Expected integer");
5861 retval.totalpages = json["totalpages"];
62+ if (!intp(json["totalresultsavailable"])) error("Expected integer");
5963 retval.totalresultsavailable = json["totalresultsavailable"];
64+ if (!intp(json["totalresultsreturned"])) error("Expected integer");
6065 retval.totalresultsreturned = json["totalresultsreturned"];
6166
6267 return retval;
@@ -95,11 +100,13 @@ Category Category_from_JSON(mixed json) {
95100 retval.concatenatecategoryname = json["concatenatecategoryname"];
96101 if (json["hasoffer"] != Standards.JSON.true && json["hasoffer"] != Standards.JSON.false) error("Expected bool");
97102 retval.hasoffer = json["hasoffer"];
103+ if (!intp(json["id"])) error("Expected integer");
98104 retval.id = json["id"];
99105 if (json["isfinal"] != Standards.JSON.true && json["isfinal"] != Standards.JSON.false) error("Expected bool");
100106 retval.isfinal = json["isfinal"];
101107 retval.links = json["links"];
102108 retval.name = json["name"];
109+ if (!intp(json["parentcategoryid"])) error("Expected integer");
103110 retval.parentcategoryid = json["parentcategoryid"];
104111 CategoryThumbnail_from_JSON(json["thumbnail"]);
105112 retval.thumbnail = json["thumbnail"];
@@ -200,9 +207,11 @@ Details Details_from_JSON(mixed json) {
200207
201208 retval.applicationid = json["applicationid"];
202209 retval.applicationversion = json["applicationversion"];
210+ if (!intp(json["code"])) error("Expected integer");
203211 retval.code = json["code"];
204212 Date_from_JSON(json["date"]);
205213 retval.date = json["date"];
214+ if (!intp(json["elapsedtime"])) error("Expected integer");
206215 retval.elapsedtime = json["elapsedtime"];
207216 retval.message = json["message"];
208217 retval.status = json["status"];
@@ -245,19 +254,27 @@ class Date {
245254 Date Date_from_JSON(mixed json) {
246255 Date retval = Date();
247256
257+ if (!intp(json["day"])) error("Expected integer");
248258 retval.day = json["day"];
249259 Eonandyear_from_JSON(json["eonandyear"]);
250260 retval.eonandyear = json["eonandyear"];
261+ if (!intp(json["hour"])) error("Expected integer");
251262 retval.hour = json["hour"];
263+ if (!intp(json["millisecond"])) error("Expected integer");
252264 retval.millisecond = json["millisecond"];
265+ if (!intp(json["minute"])) error("Expected integer");
253266 retval.minute = json["minute"];
267+ if (!intp(json["month"])) error("Expected integer");
254268 retval.month = json["month"];
269+ if (!intp(json["second"])) error("Expected integer");
255270 retval.second = json["second"];
271+ if (!intp(json["timezone"])) error("Expected integer");
256272 retval.timezone = json["timezone"];
257273 if (json["valid"] != Standards.JSON.true && json["valid"] != Standards.JSON.false) error("Expected bool");
258274 retval.valid = json["valid"];
259275 Xmlschematype_from_JSON(json["xmlschematype"]);
260276 retval.xmlschematype = json["xmlschematype"];
277+ if (!intp(json["year"])) error("Expected integer");
261278 retval.year = json["year"];
262279
263280 return retval;
@@ -278,6 +295,7 @@ class Eonandyear {
278295 Eonandyear Eonandyear_from_JSON(mixed json) {
279296 Eonandyear retval = Eonandyear();
280297
298+ if (!intp(json["lowestsetbit"])) error("Expected integer");
281299 retval.lowestsetbit = json["lowestsetbit"];
282300
283301 return retval;
@@ -375,6 +393,7 @@ class ProductProduct {
375393 ProductProduct ProductProduct_from_JSON(mixed json) {
376394 ProductProduct retval = ProductProduct();
377395
396+ if (!intp(json["categoryid"])) error("Expected integer");
378397 retval.categoryid = json["categoryid"];
379398 Currency_from_JSON(json["currency"]);
380399 retval.currency = json["currency"];
@@ -384,12 +403,15 @@ ProductProduct ProductProduct_from_JSON(mixed json) {
384403 retval.fulldescription = json["fulldescription"];
385404 if (json["hasmetasearch"] != Standards.JSON.true && json["hasmetasearch"] != Standards.JSON.false) error("Expected bool");
386405 retval.hasmetasearch = json["hasmetasearch"];
406+ if (!intp(json["id"])) error("Expected integer");
387407 retval.id = json["id"];
388408 retval.links = json["links"];
409+ if (!intp(json["numoffers"])) error("Expected integer");
389410 retval.numoffers = json["numoffers"];
390411 retval.pricemax = json["pricemax"];
391412 retval.pricemin = json["pricemin"];
392413 retval.productname = json["productname"];
414+ if (!intp(json["quantity"])) error("Expected integer");
393415 retval.quantity = json["quantity"];
394416 Rating_from_JSON(json["rating"]);
395417 retval.rating = json["rating"];
@@ -397,6 +419,7 @@ ProductProduct ProductProduct_from_JSON(mixed json) {
397419 retval.specification = json["specification"];
398420 FormatsClass_from_JSON(json["thumbnail"]);
399421 retval.thumbnail = json["thumbnail"];
422+ if (!intp(json["totalsellers"])) error("Expected integer");
400423 retval.totalsellers = json["totalsellers"];
401424
402425 return retval;
@@ -463,6 +486,7 @@ Useraveragerating Useraveragerating_from_JSON(mixed json) {
463486 Useraveragerating retval = Useraveragerating();
464487
465488 retval.links = json["links"];
489+ if (!intp(json["numcomments"])) error("Expected integer");
466490 retval.numcomments = json["numcomments"];
467491 retval.rating = json["rating"];
468492
@@ -532,8 +556,10 @@ FormatsClass FormatsClass_from_JSON(mixed json) {
532556 FormatsClass retval = FormatsClass();
533557
534558 retval.formats = json["formats"];
559+ if (!intp(json["height"])) error("Expected integer");
535560 retval.height = json["height"];
536561 retval.url = json["url"];
562+ if (!intp(json["width"])) error("Expected integer");
537563 retval.width = json["width"];
538564
539565 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
@@ -92,6 +92,7 @@ Actor Actor_from_JSON(mixed json) {
9292 retval.avatar_url = json["avatar_url"];
9393 retval.display_login = json["display_login"];
9494 retval.gravatar_id = json["gravatar_id"];
95+ if (!intp(json["id"])) error("Expected integer");
9596 retval.id = json["id"];
9697 retval.login = json["login"];
9798 retval.url = json["url"];
@@ -199,6 +200,7 @@ Comment Comment_from_JSON(mixed json) {
199200 retval.body = json["body"];
200201 retval.created_at = json["created_at"];
201202 retval.html_url = json["html_url"];
203+ if (!intp(json["id"])) error("Expected integer");
202204 retval.id = json["id"];
203205 retval.issue_url = json["issue_url"];
204206 retval.updated_at = json["updated_at"];
@@ -263,6 +265,7 @@ User User_from_JSON(mixed json) {
263265 retval.gists_url = json["gists_url"];
264266 retval.gravatar_id = json["gravatar_id"];
265267 retval.html_url = json["html_url"];
268+ if (!intp(json["id"])) error("Expected integer");
266269 retval.id = json["id"];
267270 retval.login = json["login"];
268271 retval.organizations_url = json["organizations_url"];
@@ -406,11 +409,13 @@ Issue Issue_from_JSON(mixed json) {
406409 retval.body = json["body"];
407410 if (!has_index(json, "closed_at")) error("Missing required property");
408411 retval.closed_at = json["closed_at"];
412+ if (!intp(json["comments"])) error("Expected integer");
409413 retval.comments = json["comments"];
410414 retval.comments_url = json["comments_url"];
411415 retval.created_at = json["created_at"];
412416 retval.events_url = json["events_url"];
413417 retval.html_url = json["html_url"];
418+ if (!intp(json["id"])) error("Expected integer");
414419 retval.id = json["id"];
415420 retval.labels = json["labels"];
416421 retval.labels_url = json["labels_url"];
@@ -419,6 +424,7 @@ Issue Issue_from_JSON(mixed json) {
419424 if (!has_index(json, "milestone")) error("Missing required property");
420425 if (has_index(json, "milestone") && json["milestone"] != Val.null) Milestone_from_JSON(json["milestone"]);
421426 retval.milestone = json["milestone"];
427+ if (!intp(json["number"])) error("Expected integer");
422428 retval.number = json["number"];
423429 if (has_index(json, "pull_request") && json["pull_request"] != Val.null) IssuePullRequest_from_JSON(json["pull_request"]);
424430 retval.pull_request = json["pull_request"];
@@ -457,6 +463,7 @@ Label Label_from_JSON(mixed json) {
457463 Label retval = Label();
458464
459465 retval.color = json["color"];
466+ if (!intp(json["id"])) error("Expected integer");
460467 retval.id = json["id"];
461468 if (json["default"] != Standards.JSON.true && json["default"] != Standards.JSON.false) error("Expected bool");
462469 retval.label_default = json["default"];
@@ -510,6 +517,7 @@ Milestone Milestone_from_JSON(mixed json) {
510517 Milestone retval = Milestone();
511518
512519 retval.closed_at = json["closed_at"];
520+ if (!intp(json["closed_issues"])) error("Expected integer");
513521 retval.closed_issues = json["closed_issues"];
514522 retval.created_at = json["created_at"];
515523 User_from_JSON(json["creator"]);
@@ -518,9 +526,12 @@ Milestone Milestone_from_JSON(mixed json) {
518526 if (!has_index(json, "due_on")) error("Missing required property");
519527 retval.due_on = json["due_on"];
520528 retval.html_url = json["html_url"];
529+ if (!intp(json["id"])) error("Expected integer");
521530 retval.id = json["id"];
522531 retval.labels_url = json["labels_url"];
532+ if (!intp(json["number"])) error("Expected integer");
523533 retval.number = json["number"];
534+ if (!intp(json["open_issues"])) error("Expected integer");
524535 retval.open_issues = json["open_issues"];
525536 retval.state = json["state"];
526537 retval.title = json["title"];
@@ -654,24 +665,30 @@ class PayloadPullRequest {
654665 PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) {
655666 PayloadPullRequest retval = PayloadPullRequest();
656667
668+ if (!intp(json["additions"])) error("Expected integer");
657669 retval.additions = json["additions"];
658670 retval.assignee = json["assignee"];
659671 retval.assignees = json["assignees"];
660672 Base_from_JSON(json["base"]);
661673 retval.base = json["base"];
662674 retval.body = json["body"];
675+ if (!intp(json["changed_files"])) error("Expected integer");
663676 retval.changed_files = json["changed_files"];
664677 retval.closed_at = json["closed_at"];
678+ if (!intp(json["comments"])) error("Expected integer");
665679 retval.comments = json["comments"];
666680 retval.comments_url = json["comments_url"];
681+ if (!intp(json["commits"])) error("Expected integer");
667682 retval.commits = json["commits"];
668683 retval.commits_url = json["commits_url"];
669684 retval.created_at = json["created_at"];
685+ if (!intp(json["deletions"])) error("Expected integer");
670686 retval.deletions = json["deletions"];
671687 retval.diff_url = json["diff_url"];
672688 Base_from_JSON(json["head"]);
673689 retval.head = json["head"];
674690 retval.html_url = json["html_url"];
691+ if (!intp(json["id"])) error("Expected integer");
675692 retval.id = json["id"];
676693 retval.issue_url = json["issue_url"];
677694 Links_from_JSON(json["_links"]);
@@ -689,11 +706,13 @@ PayloadPullRequest PayloadPullRequest_from_JSON(mixed json) {
689706 User_from_JSON(json["merged_by"]);
690707 retval.merged_by = json["merged_by"];
691708 retval.milestone = json["milestone"];
709+ if (!intp(json["number"])) error("Expected integer");
692710 retval.number = json["number"];
693711 retval.patch_url = json["patch_url"];
694712 retval.rebaseable = json["rebaseable"];
695713 retval.requested_reviewers = json["requested_reviewers"];
696714 retval.review_comment_url = json["review_comment_url"];
715+ if (!intp(json["review_comments"])) error("Expected integer");
697716 retval.review_comments = json["review_comments"];
698717 retval.review_comments_url = json["review_comments_url"];
699718 retval.state = json["state"];
@@ -911,7 +930,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
911930 retval.events_url = json["events_url"];
912931 if (json["fork"] != Standards.JSON.true && json["fork"] != Standards.JSON.false) error("Expected bool");
913932 retval.fork = json["fork"];
933+ if (!intp(json["forks"])) error("Expected integer");
914934 retval.forks = json["forks"];
935+ if (!intp(json["forks_count"])) error("Expected integer");
915936 retval.forks_count = json["forks_count"];
916937 retval.forks_url = json["forks_url"];
917938 retval.full_name = json["full_name"];
@@ -932,6 +953,7 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
932953 retval.homepage = json["homepage"];
933954 retval.hooks_url = json["hooks_url"];
934955 retval.html_url = json["html_url"];
956+ if (!intp(json["id"])) error("Expected integer");
935957 retval.id = json["id"];
936958 retval.issue_comment_url = json["issue_comment_url"];
937959 retval.issue_events_url = json["issue_events_url"];
@@ -945,7 +967,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
945967 retval.mirror_url = json["mirror_url"];
946968 retval.name = json["name"];
947969 retval.notifications_url = json["notifications_url"];
970+ if (!intp(json["open_issues"])) error("Expected integer");
948971 retval.open_issues = json["open_issues"];
972+ if (!intp(json["open_issues_count"])) error("Expected integer");
949973 retval.open_issues_count = json["open_issues_count"];
950974 User_from_JSON(json["owner"]);
951975 retval.owner = json["owner"];
@@ -954,8 +978,10 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
954978 retval.releases_url = json["releases_url"];
955979 if (json["private"] != Standards.JSON.true && json["private"] != Standards.JSON.false) error("Expected bool");
956980 retval.repo_private = json["private"];
981+ if (!intp(json["size"])) error("Expected integer");
957982 retval.size = json["size"];
958983 retval.ssh_url = json["ssh_url"];
984+ if (!intp(json["stargazers_count"])) error("Expected integer");
959985 retval.stargazers_count = json["stargazers_count"];
960986 retval.stargazers_url = json["stargazers_url"];
961987 retval.statuses_url = json["statuses_url"];
@@ -967,7 +993,9 @@ BaseRepo BaseRepo_from_JSON(mixed json) {
967993 retval.trees_url = json["trees_url"];
968994 retval.updated_at = json["updated_at"];
969995 retval.url = json["url"];
996+ if (!intp(json["watchers"])) error("Expected integer");
970997 retval.watchers = json["watchers"];
998+ if (!intp(json["watchers_count"])) error("Expected integer");
971999 retval.watchers_count = json["watchers_count"];
9721000
9731001 return retval;
@@ -1061,6 +1089,7 @@ class TopLevelRepo {
10611089 TopLevelRepo TopLevelRepo_from_JSON(mixed json) {
10621090 TopLevelRepo retval = TopLevelRepo();
10631091
1092+ if (!intp(json["id"])) error("Expected integer");
10641093 retval.id = json["id"];
10651094 retval.name = json["name"];
10661095 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"];
@@ -151,6 +152,7 @@ class PurplePerson {
151152 PurplePerson PurplePerson_from_JSON(mixed json) {
152153 PurplePerson retval = PurplePerson();
153154
155+ if (!intp(json["intOrString"])) error("Expected integer");
154156 retval.int_or_string = json["intOrString"];
155157 retval.name = json["name"];
Test case

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

1 generated file · +1 −0
Mpikedefault / TopLevel.pmod+1 −0
@@ -57,6 +57,7 @@ Item Item_from_JSON(mixed json) {
5757 retval.address = json["address"];
5858 retval.created_at = json["created_at"];
5959 retval.name = json["name"];
60+ if (!intp(json["sex"])) error("Expected integer");
6061 if (!has_index(json, "sex")) error("Missing required property");
6162 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
@@ -255,14 +255,18 @@ ChildData ChildData_from_JSON(mixed json) {
255255 retval.clicked = json["clicked"];
256256 if (json["contest_mode"] != Standards.JSON.true && json["contest_mode"] != Standards.JSON.false) error("Expected bool");
257257 retval.contest_mode = json["contest_mode"];
258+ if (!intp(json["created"])) error("Expected integer");
258259 retval.created = json["created"];
260+ if (!intp(json["created_utc"])) error("Expected integer");
259261 retval.created_utc = json["created_utc"];
260262 if (!has_index(json, "distinguished")) error("Missing required property");
261263 retval.distinguished = json["distinguished"];
262264 retval.domain = Domain_from_JSON(json["domain"]);
265+ if (!intp(json["downs"])) error("Expected integer");
263266 retval.downs = json["downs"];
264267 if (json["edited"] != Standards.JSON.true && json["edited"] != Standards.JSON.false) error("Expected bool");
265268 retval.edited = json["edited"];
269+ if (!intp(json["gilded"])) error("Expected integer");
266270 retval.gilded = json["gilded"];
267271 if (json["hidden"] != Standards.JSON.true && json["hidden"] != Standards.JSON.false) error("Expected bool");
268272 retval.hidden = json["hidden"];
@@ -285,6 +289,7 @@ ChildData ChildData_from_JSON(mixed json) {
285289 retval.media_embed = json["media_embed"];
286290 retval.mod_reports = json["mod_reports"];
287291 retval.name = json["name"];
292+ if (!intp(json["num_comments"])) error("Expected integer");
288293 retval.num_comments = json["num_comments"];
289294 retval.num_reports = json["num_reports"];
290295 if (json["over_18"] != Standards.JSON.true && json["over_18"] != Standards.JSON.false) error("Expected bool");
@@ -300,6 +305,7 @@ ChildData ChildData_from_JSON(mixed json) {
300305 retval.report_reasons = json["report_reasons"];
301306 if (json["saved"] != Standards.JSON.true && json["saved"] != Standards.JSON.false) error("Expected bool");
302307 retval.saved = json["saved"];
308+ if (!intp(json["score"])) error("Expected integer");
303309 retval.score = json["score"];
304310 retval.secure_media = json["secure_media"];
305311 MediaEmbed_from_JSON(json["secure_media_embed"]);
@@ -316,9 +322,12 @@ ChildData ChildData_from_JSON(mixed json) {
316322 retval.subreddit_type = SubredditType_from_JSON(json["subreddit_type"]);
317323 retval.suggested_sort = json["suggested_sort"];
318324 retval.thumbnail = json["thumbnail"];
325+ if (!intp(json["thumbnail_height"])) error("Expected integer");
319326 retval.thumbnail_height = json["thumbnail_height"];
327+ if (!intp(json["thumbnail_width"])) error("Expected integer");
320328 retval.thumbnail_width = json["thumbnail_width"];
321329 retval.title = json["title"];
330+ if (!intp(json["ups"])) error("Expected integer");
322331 retval.ups = json["ups"];
323332 retval.url = json["url"];
324333 retval.user_reports = json["user_reports"];
@@ -448,8 +457,10 @@ class Source {
448457 Source Source_from_JSON(mixed json) {
449458 Source retval = Source();
450459
460+ if (!intp(json["height"])) error("Expected integer");
451461 retval.height = json["height"];
452462 retval.url = json["url"];
463+ if (!intp(json["width"])) error("Expected integer");
453464 retval.width = json["width"];
454465
455466 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
@@ -72,6 +72,7 @@ TopLevel TopLevel_from_JSON(mixed json) {
7272 retval.id = json["id"];
7373 retval.images = json["images"];
7474 retval.name = json["name"];
75+ if (!intp(json["popularity"])) error("Expected integer");
7576 retval.popularity = json["popularity"];
7677 retval.release_date = json["release_date"];
7778 retval.release_date_precision = json["release_date_precision"];
@@ -201,8 +202,10 @@ class Image {
201202 Image Image_from_JSON(mixed json) {
202203 Image retval = Image();
203204
205+ if (!intp(json["height"])) error("Expected integer");
204206 retval.height = json["height"];
205207 retval.url = json["url"];
208+ if (!intp(json["width"])) error("Expected integer");
206209 retval.width = json["width"];
207210
208211 return retval;
@@ -237,10 +240,13 @@ Tracks Tracks_from_JSON(mixed json) {
237240
238241 retval.href = json["href"];
239242 retval.items = json["items"];
243+ if (!intp(json["limit"])) error("Expected integer");
240244 retval.limit = json["limit"];
241245 retval.next = json["next"];
246+ if (!intp(json["offset"])) error("Expected integer");
242247 retval.offset = json["offset"];
243248 retval.previous = json["previous"];
249+ if (!intp(json["total"])) error("Expected integer");
244250 retval.total = json["total"];
245251
246252 return retval;
@@ -287,7 +293,9 @@ Item Item_from_JSON(mixed json) {
287293
288294 retval.artists = json["artists"];
289295 retval.available_markets = json["available_markets"];
296+ if (!intp(json["disc_number"])) error("Expected integer");
290297 retval.disc_number = json["disc_number"];
298+ if (!intp(json["duration_ms"])) error("Expected integer");
291299 retval.duration_ms = json["duration_ms"];
292300 if (json["explicit"] != Standards.JSON.true && json["explicit"] != Standards.JSON.false) error("Expected bool");
293301 retval.explicit = json["explicit"];
@@ -297,6 +305,7 @@ Item Item_from_JSON(mixed json) {
297305 retval.id = json["id"];
298306 retval.name = json["name"];
299307 retval.preview_url = json["preview_url"];
308+ if (!intp(json["track_number"])) error("Expected integer");
300309 retval.track_number = json["track_number"];
301310 retval.type = json["type"];
302311 retval.uri = json["uri"];
Test case

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

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

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

1 generated file · +4 −0
Mpikedefault / TopLevel.pmod+4 −0
@@ -55,8 +55,11 @@ class Meta {
5555 Meta Meta_from_JSON(mixed json) {
5656 Meta retval = Meta();
5757
58+ if (!intp(json["limit"])) error("Expected integer");
5859 retval.limit = json["limit"];
60+ if (!intp(json["offset"])) error("Expected integer");
5961 retval.offset = json["offset"];
62+ if (!intp(json["total_count"])) error("Expected integer");
6063 retval.total_count = json["total_count"];
6164
6265 return retval;
@@ -241,6 +244,7 @@ Person Person_from_JSON(mixed json) {
241244
242245 retval.bioguideid = json["bioguideid"];
243246 retval.birthday = json["birthday"];
247+ if (!intp(json["cspanid"])) error("Expected integer");
244248 retval.cspanid = json["cspanid"];
245249 retval.firstname = json["firstname"];
246250 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.