Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
132test cases
132files differ
132modified
0new
0deleted
1,766changed lines
+883 −883insertions / deletions
Base 10cdaef273530caef2fdf9afdc07cdd0d1f9cae7 · PR merge d4d426aa66f59817a6741c524389f023113fdc1d · Head b122781f18161618e10dbea4a8352acd90b04231 · raw patch
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -9,7 +9,7 @@ export type Datum = z.infer<typeof DatumSchema>;
99
1010 export const DescriptionSchema = z.object({
1111 "base_period": z.string(),
12- "missing": z.number(),
12+ "missing": z.number().int(),
1313 "title": z.string(),
1414 "units": z.string(),
1515 });
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -8,7 +8,7 @@ export type Facets = z.infer<typeof FacetsSchema>;
88 export const ResultSchema = z.object({
99 "code": z.string(),
1010 "created_at": z.coerce.date(),
11- "id": z.number(),
11+ "id": z.number().int(),
1212 "name": z.string(),
1313 "updated_at": z.coerce.date(),
1414 "uri": z.string(),
@@ -16,11 +16,11 @@ export const ResultSchema = z.object({
1616 export type Result = z.infer<typeof ResultSchema>;
1717
1818 export const TopLevelSchema = z.object({
19- "count": z.number(),
19+ "count": z.number().int(),
2020 "facets": FacetsSchema,
21- "limit": z.number(),
21+ "limit": z.number().int(),
2222 "next": z.string(),
23- "offset": z.number(),
23+ "offset": z.number().int(),
2424 "previous": z.boolean(),
2525 "results": z.array(ResultSchema),
2626 });
Test case

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

1 generated file · +24 −24
Mtypescript-zoddefault / TopLevel.ts+24 −24
@@ -14,7 +14,7 @@ export const ActorSchema = z.object({
1414 "avatar_url": z.string(),
1515 "display_login": z.string().optional(),
1616 "gravatar_id": z.string(),
17- "id": z.number(),
17+ "id": z.number().int(),
1818 "login": z.string(),
1919 "url": z.string(),
2020 });
@@ -34,7 +34,7 @@ export const MergedBySchema = z.object({
3434 "gists_url": z.string(),
3535 "gravatar_id": z.string(),
3636 "html_url": z.string(),
37- "id": z.number(),
37+ "id": z.number().int(),
3838 "login": z.string(),
3939 "organizations_url": z.string(),
4040 "received_events_url": z.string(),
@@ -53,7 +53,7 @@ export const CommentsSchema = z.object({
5353 export type Comments = z.infer<typeof CommentsSchema>;
5454
5555 export const TopLevelRepoSchema = z.object({
56- "id": z.number(),
56+ "id": z.number().int(),
5757 "name": z.string(),
5858 "url": z.string(),
5959 });
@@ -87,8 +87,8 @@ export const BaseRepoSchema = z.object({
8787 "downloads_url": z.string(),
8888 "events_url": z.string(),
8989 "fork": z.boolean(),
90- "forks": z.number(),
91- "forks_count": z.number(),
90+ "forks": z.number().int(),
91+ "forks_count": z.number().int(),
9292 "forks_url": z.string(),
9393 "full_name": z.string(),
9494 "git_commits_url": z.string(),
@@ -103,7 +103,7 @@ export const BaseRepoSchema = z.object({
103103 "homepage": z.null(),
104104 "hooks_url": z.string(),
105105 "html_url": z.string(),
106- "id": z.number(),
106+ "id": z.number().int(),
107107 "issue_comment_url": z.string(),
108108 "issue_events_url": z.string(),
109109 "issues_url": z.string(),
@@ -116,16 +116,16 @@ export const BaseRepoSchema = z.object({
116116 "mirror_url": z.null(),
117117 "name": z.string(),
118118 "notifications_url": z.string(),
119- "open_issues": z.number(),
120- "open_issues_count": z.number(),
119+ "open_issues": z.number().int(),
120+ "open_issues_count": z.number().int(),
121121 "owner": MergedBySchema,
122122 "private": z.boolean(),
123123 "pulls_url": z.string(),
124124 "pushed_at": z.coerce.date(),
125125 "releases_url": z.string(),
126- "size": z.number(),
126+ "size": z.number().int(),
127127 "ssh_url": z.string(),
128- "stargazers_count": z.number(),
128+ "stargazers_count": z.number().int(),
129129 "stargazers_url": z.string(),
130130 "statuses_url": z.string(),
131131 "subscribers_url": z.string(),
@@ -136,8 +136,8 @@ export const BaseRepoSchema = z.object({
136136 "trees_url": z.string(),
137137 "updated_at": z.coerce.date(),
138138 "url": z.string(),
139- "watchers": z.number(),
140- "watchers_count": z.number(),
139+ "watchers": z.number().int(),
140+ "watchers_count": z.number().int(),
141141 });
142142 export type BaseRepo = z.infer<typeof BaseRepoSchema>;
143143
@@ -163,23 +163,23 @@ export const BaseSchema = z.object({
163163 export type Base = z.infer<typeof BaseSchema>;
164164
165165 export const PullRequestSchema = z.object({
166- "additions": z.number(),
166+ "additions": z.number().int(),
167167 "assignee": z.null(),
168168 "assignees": z.array(z.any()),
169169 "base": BaseSchema,
170170 "body": z.string(),
171- "changed_files": z.number(),
171+ "changed_files": z.number().int(),
172172 "closed_at": z.coerce.date(),
173- "comments": z.number(),
173+ "comments": z.number().int(),
174174 "comments_url": z.string(),
175- "commits": z.number(),
175+ "commits": z.number().int(),
176176 "commits_url": z.string(),
177177 "created_at": z.coerce.date(),
178- "deletions": z.number(),
178+ "deletions": z.number().int(),
179179 "diff_url": z.string(),
180180 "head": BaseSchema,
181181 "html_url": z.string(),
182- "id": z.number(),
182+ "id": z.number().int(),
183183 "issue_url": z.string(),
184184 "_links": LinksSchema,
185185 "locked": z.boolean(),
@@ -191,12 +191,12 @@ export const PullRequestSchema = z.object({
191191 "merged_at": z.coerce.date(),
192192 "merged_by": MergedBySchema,
193193 "milestone": z.null(),
194- "number": z.number(),
194+ "number": z.number().int(),
195195 "patch_url": z.string(),
196196 "rebaseable": z.null(),
197197 "requested_reviewers": z.array(z.any()),
198198 "review_comment_url": z.string(),
199- "review_comments": z.number(),
199+ "review_comments": z.number().int(),
200200 "review_comments_url": z.string(),
201201 "state": z.string(),
202202 "statuses_url": z.string(),
@@ -212,16 +212,16 @@ export const PayloadSchema = z.object({
212212 "before": z.string().optional(),
213213 "commits": z.array(CommitSchema).optional(),
214214 "description": z.union([z.null(), z.string()]).optional(),
215- "distinct_size": z.number().optional(),
215+ "distinct_size": z.number().int().optional(),
216216 "head": z.string().optional(),
217217 "master_branch": z.string().optional(),
218- "number": z.number().optional(),
218+ "number": z.number().int().optional(),
219219 "pull_request": PullRequestSchema.optional(),
220- "push_id": z.number().optional(),
220+ "push_id": z.number().int().optional(),
221221 "pusher_type": z.string().optional(),
222222 "ref": z.string().optional(),
223223 "ref_type": z.string().optional(),
224- "size": z.number().optional(),
224+ "size": z.number().int().optional(),
225225 });
226226 export type Payload = z.infer<typeof PayloadSchema>;
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -3,14 +3,14 @@ import * as z from "zod";
33
44 export const ResponseInfoSchema = z.object({
55 "developerMessage": z.string(),
6- "status": z.number(),
6+ "status": z.number().int(),
77 });
88 export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
99
1010 export const ResultsetSchema = z.object({
11- "count": z.number(),
12- "page": z.number(),
13- "pagesize": z.number(),
11+ "count": z.number().int(),
12+ "page": z.number().int(),
13+ "pagesize": z.number().int(),
1414 });
1515 export type Resultset = z.infer<typeof ResultsetSchema>;
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -71,14 +71,14 @@ export type User = z.infer<typeof UserSchema>;
7171 export const MetaSchema = z.object({
7272 "msg": z.string(),
7373 "response_id": z.string(),
74- "status": z.number(),
74+ "status": z.number().int(),
7575 });
7676 export type Meta = z.infer<typeof MetaSchema>;
7777
7878 export const PaginationSchema = z.object({
79- "count": z.number(),
80- "offset": z.number(),
81- "total_count": z.number(),
79+ "count": z.number().int(),
80+ "offset": z.number().int(),
81+ "total_count": z.number().int(),
8282 });
8383 export type Pagination = z.infer<typeof PaginationSchema>;
8484
@@ -117,7 +117,7 @@ export const DatumSchema = z.object({
117117 "id": z.string(),
118118 "images": ImagesSchema,
119119 "import_datetime": z.string(),
120- "is_indexable": z.number(),
120+ "is_indexable": z.number().int(),
121121 "rating": RatingSchema,
122122 "slug": z.string(),
123123 "source": z.string(),
Test case

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

1 generated file · +14 −14
Mtypescript-zoddefault / TopLevel.ts+14 −14
@@ -22,8 +22,8 @@ export const ResultLanguageSchema = z.enum([
2222 export type ResultLanguage = z.infer<typeof ResultLanguageSchema>;
2323
2424 export const CollectionSchema = z.object({
25- "id": z.number(),
26- "movies": z.array(z.number()),
25+ "id": z.number().int(),
26+ "movies": z.array(z.number().int()),
2727 "name": z.string(),
2828 "slug": z.string(),
2929 });
@@ -32,7 +32,7 @@ export type Collection = z.infer<typeof CollectionSchema>;
3232 export const DetailSchema = z.object({
3333 "cast": z.string(),
3434 "director": z.string(),
35- "id": z.number(),
35+ "id": z.number().int(),
3636 "language": DetailLanguageSchema,
3737 "storyline": z.string(),
3838 "tagline": z.string(),
@@ -48,8 +48,8 @@ export const FavMovieSchema = z.object({
4848 export type FavMovie = z.infer<typeof FavMovieSchema>;
4949
5050 export const ImageSchema = z.object({
51- "favs": z.number(),
52- "id": z.number(),
51+ "favs": z.number().int(),
52+ "id": z.number().int(),
5353 "thumbnail": z.string(),
5454 "type": TypeSchema,
5555 "url": z.string(),
@@ -65,33 +65,33 @@ export const VideoSchema = z.object({
6565 export type Video = z.infer<typeof VideoSchema>;
6666
6767 export const VoteScoreSchema = z.object({
68- "avg": z.number(),
69- "score": z.number(),
70- "total": z.number(),
68+ "avg": z.number().int(),
69+ "score": z.number().int(),
70+ "total": z.number().int(),
7171 });
7272 export type VoteScore = z.infer<typeof VoteScoreSchema>;
7373
7474 export const ResultSchema = z.object({
75- "active_screens": z.number(),
75+ "active_screens": z.number().int(),
7676 "collections": z.array(CollectionSchema),
7777 "details": z.array(DetailSchema),
78- "duration": z.number(),
78+ "duration": z.number().int(),
7979 "fav_movie": FavMovieSchema,
80- "id": z.number(),
80+ "id": z.number().int(),
8181 "images": z.array(ImageSchema),
8282 "language": ResultLanguageSchema,
8383 "release_date": z.string(),
84- "stars": z.number(),
84+ "stars": z.number().int(),
8585 "tags": z.union([z.null(), z.array(z.any())]),
8686 "title": z.string(),
8787 "videos": z.array(VideoSchema),
8888 "vote_score": VoteScoreSchema,
89- "watches": z.number(),
89+ "watches": z.number().int(),
9090 });
9191 export type Result = z.infer<typeof ResultSchema>;
9292
9393 export const TopLevelSchema = z.object({
94- "count": z.number(),
94+ "count": z.number().int(),
9595 "next": z.string(),
9696 "previous": z.null(),
9797 "results": z.array(ResultSchema),
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -70,14 +70,14 @@ export type User = z.infer<typeof UserSchema>;
7070 export const MetaSchema = z.object({
7171 "msg": z.string(),
7272 "response_id": z.string(),
73- "status": z.number(),
73+ "status": z.number().int(),
7474 });
7575 export type Meta = z.infer<typeof MetaSchema>;
7676
7777 export const PaginationSchema = z.object({
78- "count": z.number(),
79- "offset": z.number(),
80- "total_count": z.number(),
78+ "count": z.number().int(),
79+ "offset": z.number().int(),
80+ "total_count": z.number().int(),
8181 });
8282 export type Pagination = z.infer<typeof PaginationSchema>;
8383
@@ -116,7 +116,7 @@ export const DatumSchema = z.object({
116116 "id": z.string(),
117117 "images": ImagesSchema,
118118 "import_datetime": z.string(),
119- "is_indexable": z.number(),
119+ "is_indexable": z.number().int(),
120120 "rating": RatingSchema,
121121 "slug": z.string(),
122122 "source": z.string(),
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -29,7 +29,7 @@ export type Results = z.infer<typeof ResultsSchema>;
2929
3030 export const TopLevelSchema = z.object({
3131 "message": z.array(z.any()),
32- "responseTime": z.number(),
32+ "responseTime": z.number().int(),
3333 "Results": ResultsSchema,
3434 "status": z.string(),
3535 });
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +8 −8
Mtypescript-zoddefault / TopLevel.ts+8 −8
@@ -53,9 +53,9 @@ export const TitleSchema = z.enum([
5353 export type Title = z.infer<typeof TitleSchema>;
5454
5555 export const MetaSchema = z.object({
56- "limit": z.number(),
57- "offset": z.number(),
58- "total_count": z.number(),
56+ "limit": z.number().int(),
57+ "offset": z.number().int(),
58+ "total_count": z.number().int(),
5959 });
6060 export type Meta = z.infer<typeof MetaSchema>;
6161
@@ -71,11 +71,11 @@ export type Extra = z.infer<typeof ExtraSchema>;
7171 export const PersonSchema = z.object({
7272 "bioguideid": z.string(),
7373 "birthday": z.string(),
74- "cspanid": z.number(),
74+ "cspanid": z.number().int(),
7575 "firstname": z.string(),
7676 "gender": GenderSchema,
7777 "gender_label": GenderLabelSchema,
78- "id": z.number(),
78+ "id": z.number().int(),
7979 "lastname": z.string(),
8080 "link": z.string(),
8181 "middlename": z.string(),
@@ -92,13 +92,13 @@ export type Person = z.infer<typeof PersonSchema>;
9292
9393 export const ObjectElementSchema = z.object({
9494 "caucus": z.null(),
95- "congress_numbers": z.array(z.number()),
95+ "congress_numbers": z.array(z.number().int()),
9696 "current": z.boolean(),
9797 "description": z.string(),
98- "district": z.number(),
98+ "district": z.number().int(),
9999 "enddate": z.string(),
100100 "extra": ExtraSchema,
101- "id": z.number(),
101+ "id": z.number().int(),
102102 "leadership_title": z.union([z.null(), z.string()]),
103103 "party": PartySchema,
104104 "person": PersonSchema,
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -112,7 +112,7 @@ export const ResultsSchema = z.object({
112112 export type Results = z.infer<typeof ResultsSchema>;
113113
114114 export const QuerySchema = z.object({
115- "count": z.number(),
115+ "count": z.number().int(),
116116 "created": z.coerce.date(),
117117 "lang": z.string(),
118118 "results": ResultsSchema,
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -64,14 +64,14 @@ export type User = z.infer<typeof UserSchema>;
6464 export const MetaSchema = z.object({
6565 "msg": z.string(),
6666 "response_id": z.string(),
67- "status": z.number(),
67+ "status": z.number().int(),
6868 });
6969 export type Meta = z.infer<typeof MetaSchema>;
7070
7171 export const PaginationSchema = z.object({
72- "count": z.number(),
73- "offset": z.number(),
74- "total_count": z.number(),
72+ "count": z.number().int(),
73+ "offset": z.number().int(),
74+ "total_count": z.number().int(),
7575 });
7676 export type Pagination = z.infer<typeof PaginationSchema>;
7777
@@ -111,7 +111,7 @@ export const DatumSchema = z.object({
111111 "id": z.string(),
112112 "images": ImagesSchema,
113113 "import_datetime": z.string(),
114- "is_indexable": z.number(),
114+ "is_indexable": z.number().int(),
115115 "rating": RatingSchema,
116116 "slug": z.string(),
117117 "source": z.string(),
Test case

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

1 generated file · +22 −22
Mtypescript-zoddefault / TopLevel.ts+22 −22
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopSchema = z.object({
5- "count": z.number(),
5+ "count": z.number().int(),
66 "item": z.string(),
77 });
88 export type Top = z.infer<typeof TopSchema>;
@@ -90,7 +90,7 @@ export const OwnerSchema = z.object({
9090 export type Owner = z.infer<typeof OwnerSchema>;
9191
9292 export const ExpressionSchema = z.object({
93- "columnId": z.number(),
93+ "columnId": z.number().int(),
9494 "type": z.string(),
9595 });
9696 export type Expression = z.infer<typeof ExpressionSchema>;
@@ -98,8 +98,8 @@ export type Expression = z.infer<typeof ExpressionSchema>;
9898 export const CachedContentsSchema = z.object({
9999 "average": z.string().optional(),
100100 "largest": z.string(),
101- "non_null": z.number(),
102- "null": z.number(),
101+ "non_null": z.number().int(),
102+ "null": z.number().int(),
103103 "smallest": z.string(),
104104 "sum": z.string().optional(),
105105 "top": z.array(TopSchema),
@@ -137,12 +137,12 @@ export const ColumnSchema = z.object({
137137 "fieldName": z.string(),
138138 "flags": z.array(z.string()).optional(),
139139 "format": FormatSchema,
140- "id": z.number(),
140+ "id": z.number().int(),
141141 "name": z.string(),
142- "position": z.number(),
142+ "position": z.number().int(),
143143 "renderTypeName": z.string(),
144- "tableColumnId": z.number().optional(),
145- "width": z.number().optional(),
144+ "tableColumnId": z.number().int().optional(),
145+ "width": z.number().int().optional(),
146146 });
147147 export type Column = z.infer<typeof ColumnSchema>;
148148
@@ -164,41 +164,41 @@ export type Query = z.infer<typeof QuerySchema>;
164164 export const ViewSchema = z.object({
165165 "attribution": z.string(),
166166 "attributionLink": z.string(),
167- "averageRating": z.number(),
167+ "averageRating": z.number().int(),
168168 "category": z.string(),
169169 "columns": z.array(ColumnSchema),
170- "createdAt": z.number(),
170+ "createdAt": z.number().int(),
171171 "description": z.string(),
172172 "displayType": z.string(),
173- "downloadCount": z.number(),
173+ "downloadCount": z.number().int(),
174174 "flags": z.array(z.string()),
175175 "grants": z.array(GrantSchema),
176176 "hideFromCatalog": z.boolean(),
177177 "hideFromDataJson": z.boolean(),
178178 "id": z.string(),
179- "indexUpdatedAt": z.number(),
179+ "indexUpdatedAt": z.number().int(),
180180 "locale": z.string(),
181181 "metadata": MetadataSchema,
182182 "name": z.string(),
183183 "newBackend": z.boolean(),
184- "numberOfComments": z.number(),
185- "oid": z.number(),
184+ "numberOfComments": z.number().int(),
185+ "oid": z.number().int(),
186186 "owner": OwnerSchema,
187187 "provenance": z.string(),
188188 "publicationAppendEnabled": z.boolean(),
189- "publicationDate": z.number(),
190- "publicationGroup": z.number(),
189+ "publicationDate": z.number().int(),
190+ "publicationGroup": z.number().int(),
191191 "publicationStage": z.string(),
192192 "query": QuerySchema,
193193 "rights": z.array(z.string()),
194- "rowsUpdatedAt": z.number(),
194+ "rowsUpdatedAt": z.number().int(),
195195 "rowsUpdatedBy": z.string(),
196196 "tableAuthor": OwnerSchema,
197- "tableId": z.number(),
197+ "tableId": z.number().int(),
198198 "tags": z.array(z.string()),
199- "totalTimesRated": z.number(),
200- "viewCount": z.number(),
201- "viewLastModified": z.number(),
199+ "totalTimesRated": z.number().int(),
200+ "viewCount": z.number().int(),
201+ "viewLastModified": z.number().int(),
202202 "viewType": z.string(),
203203 });
204204 export type View = z.infer<typeof ViewSchema>;
@@ -209,7 +209,7 @@ export const MetaSchema = z.object({
209209 export type Meta = z.infer<typeof MetaSchema>;
210210
211211 export const TopLevelSchema = z.object({
212- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
212+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
213213 "meta": MetaSchema,
214214 });
215215 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/27332.json

1 generated file · +15 −15
Mtypescript-zoddefault / TopLevel.ts+15 −15
@@ -48,32 +48,32 @@ export type Kind = z.infer<typeof KindSchema>;
4848
4949 export const OembedSchema = z.object({
5050 "description": z.string(),
51- "height": z.number(),
51+ "height": z.number().int(),
5252 "html": z.string(),
5353 "provider_name": z.string(),
5454 "provider_url": z.string(),
55- "thumbnail_height": z.number(),
55+ "thumbnail_height": z.number().int(),
5656 "thumbnail_url": z.string(),
57- "thumbnail_width": z.number(),
57+ "thumbnail_width": z.number().int(),
5858 "title": z.string(),
5959 "type": z.string(),
6060 "version": z.string(),
61- "width": z.number(),
61+ "width": z.number().int(),
6262 });
6363 export type Oembed = z.infer<typeof OembedSchema>;
6464
6565 export const MediaEmbedSchema = z.object({
6666 "content": z.string().optional(),
67- "height": z.number().optional(),
67+ "height": z.number().int().optional(),
6868 "scrolling": z.boolean().optional(),
69- "width": z.number().optional(),
69+ "width": z.number().int().optional(),
7070 });
7171 export type MediaEmbed = z.infer<typeof MediaEmbedSchema>;
7272
7373 export const SourceSchema = z.object({
74- "height": z.number(),
74+ "height": z.number().int(),
7575 "url": z.string(),
76- "width": z.number(),
76+ "width": z.number().int(),
7777 });
7878 export type Source = z.infer<typeof SourceSchema>;
7979
@@ -119,9 +119,9 @@ export const ChildDataSchema = z.object({
119119 "created_utc": z.number(),
120120 "distinguished": z.union([z.null(), z.string()]),
121121 "domain": DomainSchema,
122- "downs": z.number(),
122+ "downs": z.number().int(),
123123 "edited": z.boolean(),
124- "gilded": z.number(),
124+ "gilded": z.number().int(),
125125 "hidden": z.boolean(),
126126 "hide_score": z.boolean(),
127127 "id": z.string(),
@@ -135,7 +135,7 @@ export const ChildDataSchema = z.object({
135135 "media_embed": MediaEmbedSchema,
136136 "mod_reports": z.array(z.any()),
137137 "name": z.string(),
138- "num_comments": z.number(),
138+ "num_comments": z.number().int(),
139139 "num_reports": z.null(),
140140 "over_18": z.boolean(),
141141 "permalink": z.string(),
@@ -145,7 +145,7 @@ export const ChildDataSchema = z.object({
145145 "removal_reason": z.null(),
146146 "report_reasons": z.null(),
147147 "saved": z.boolean(),
148- "score": z.number(),
148+ "score": z.number().int(),
149149 "secure_media": z.union([z.null(), MediaSchema]),
150150 "secure_media_embed": MediaEmbedSchema,
151151 "selftext": z.string(),
@@ -158,10 +158,10 @@ export const ChildDataSchema = z.object({
158158 "subreddit_type": SubredditTypeSchema,
159159 "suggested_sort": z.null(),
160160 "thumbnail": z.string(),
161- "thumbnail_height": z.union([z.null(), z.number()]),
162- "thumbnail_width": z.union([z.null(), z.number()]),
161+ "thumbnail_height": z.union([z.null(), z.number().int()]),
162+ "thumbnail_width": z.union([z.null(), z.number().int()]),
163163 "title": z.string(),
164- "ups": z.number(),
164+ "ups": z.number().int(),
165165 "url": z.string(),
166166 "user_reports": z.array(z.any()),
167167 "view_count": z.null(),
Test case

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

1 generated file · +9 −9
Mtypescript-zoddefault / TopLevel.ts+9 −9
@@ -55,9 +55,9 @@ export const MediaEmbedSchema = z.object({
5555 export type MediaEmbed = z.infer<typeof MediaEmbedSchema>;
5656
5757 export const SourceSchema = z.object({
58- "height": z.number(),
58+ "height": z.number().int(),
5959 "url": z.string(),
60- "width": z.number(),
60+ "width": z.number().int(),
6161 });
6262 export type Source = z.infer<typeof SourceSchema>;
6363
@@ -105,9 +105,9 @@ export const ChildDataSchema = z.object({
105105 "created_utc": z.number(),
106106 "distinguished": DistinguishedSchema,
107107 "domain": DomainSchema,
108- "downs": z.number(),
108+ "downs": z.number().int(),
109109 "edited": z.union([z.boolean(), z.number()]),
110- "gilded": z.number(),
110+ "gilded": z.number().int(),
111111 "hidden": z.boolean(),
112112 "hide_score": z.boolean(),
113113 "id": z.string(),
@@ -121,7 +121,7 @@ export const ChildDataSchema = z.object({
121121 "media_embed": MediaEmbedSchema,
122122 "mod_reports": z.array(z.any()),
123123 "name": z.string(),
124- "num_comments": z.number(),
124+ "num_comments": z.number().int(),
125125 "num_reports": z.null(),
126126 "over_18": z.boolean(),
127127 "permalink": z.string(),
@@ -131,7 +131,7 @@ export const ChildDataSchema = z.object({
131131 "removal_reason": z.null(),
132132 "report_reasons": z.null(),
133133 "saved": z.boolean(),
134- "score": z.number(),
134+ "score": z.number().int(),
135135 "secure_media": z.null(),
136136 "secure_media_embed": MediaEmbedSchema,
137137 "selftext": z.string(),
@@ -144,10 +144,10 @@ export const ChildDataSchema = z.object({
144144 "subreddit_type": SubredditTypeSchema,
145145 "suggested_sort": z.union([z.null(), z.string()]),
146146 "thumbnail": z.string(),
147- "thumbnail_height": z.union([z.null(), z.number()]),
148- "thumbnail_width": z.union([z.null(), z.number()]),
147+ "thumbnail_height": z.union([z.null(), z.number().int()]),
148+ "thumbnail_width": z.union([z.null(), z.number().int()]),
149149 "title": z.string(),
150- "ups": z.number(),
150+ "ups": z.number().int(),
151151 "url": z.string(),
152152 "user_reports": z.array(z.any()),
153153 "view_count": z.null(),
Test case

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

1 generated file · +7 −7
Mtypescript-zoddefault / TopLevel.ts+7 −7
@@ -79,9 +79,9 @@ export const TitleSchema = z.enum([
7979 export type Title = z.infer<typeof TitleSchema>;
8080
8181 export const MetaSchema = z.object({
82- "limit": z.number(),
83- "offset": z.number(),
84- "total_count": z.number(),
82+ "limit": z.number().int(),
83+ "offset": z.number().int(),
84+ "total_count": z.number().int(),
8585 });
8686 export type Meta = z.infer<typeof MetaSchema>;
8787
@@ -97,11 +97,11 @@ export type Extra = z.infer<typeof ExtraSchema>;
9797 export const PersonSchema = z.object({
9898 "bioguideid": z.string(),
9999 "birthday": z.string(),
100- "cspanid": z.number(),
100+ "cspanid": z.number().int(),
101101 "firstname": z.string(),
102102 "gender": GenderSchema,
103103 "gender_label": GenderLabelSchema,
104- "id": z.number(),
104+ "id": z.number().int(),
105105 "lastname": z.string(),
106106 "link": z.string(),
107107 "middlename": z.string(),
@@ -118,13 +118,13 @@ export type Person = z.infer<typeof PersonSchema>;
118118
119119 export const ObjectElementSchema = z.object({
120120 "caucus": z.union([z.null(), PartySchema]),
121- "congress_numbers": z.array(z.number()),
121+ "congress_numbers": z.array(z.number().int()),
122122 "current": z.boolean(),
123123 "description": z.string(),
124124 "district": z.null(),
125125 "enddate": z.string(),
126126 "extra": ExtraSchema,
127- "id": z.number(),
127+ "id": z.number().int(),
128128 "leadership_title": z.union([z.null(), z.string()]),
129129 "party": PartySchema,
130130 "person": PersonSchema,
Test case

test/inputs/json/misc/32431.json

1 generated file · +10 −10
Mtypescript-zoddefault / TopLevel.ts+10 −10
@@ -46,34 +46,34 @@ export const PropertiesSchema = z.object({
4646 "detail": z.string(),
4747 "dmin": z.union([z.null(), z.number()]),
4848 "felt": z.null(),
49- "gap": z.union([z.null(), z.number()]),
49+ "gap": z.union([z.null(), z.number().int()]),
5050 "ids": z.string(),
5151 "mag": z.number(),
5252 "magType": MagTypeSchema,
5353 "mmi": z.null(),
5454 "net": z.string(),
55- "nst": z.union([z.null(), z.number()]),
55+ "nst": z.union([z.null(), z.number().int()]),
5656 "place": z.string(),
5757 "rms": z.number(),
58- "sig": z.number(),
58+ "sig": z.number().int(),
5959 "sources": z.string(),
6060 "status": StatusSchema,
61- "time": z.number(),
61+ "time": z.number().int(),
6262 "title": z.string(),
63- "tsunami": z.number(),
63+ "tsunami": z.number().int(),
6464 "type": PropertiesTypeSchema,
6565 "types": z.string(),
66- "tz": z.number(),
67- "updated": z.number(),
66+ "tz": z.number().int(),
67+ "updated": z.number().int(),
6868 "url": z.string(),
6969 });
7070 export type Properties = z.infer<typeof PropertiesSchema>;
7171
7272 export const MetadataSchema = z.object({
7373 "api": z.string(),
74- "count": z.number(),
75- "generated": z.number(),
76- "status": z.number(),
74+ "count": z.number().int(),
75+ "generated": z.number().int(),
76+ "status": z.number().int(),
7777 "title": z.string(),
7878 "url": z.string(),
7979 });
Test case

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

1 generated file · +19 −19
Mtypescript-zoddefault / TopLevel.ts+19 −19
@@ -27,7 +27,7 @@ export const FacetsSchema = z.object({
2727 export type Facets = z.infer<typeof FacetsSchema>;
2828
2929 export const CustomIncomeSchema = z.object({
30- "amount": z.number(),
30+ "amount": z.number().int(),
3131 "created_at": z.coerce.date(),
3232 "id": z.string(),
3333 "name": z.string(),
@@ -39,35 +39,35 @@ export const CustomIncomeSchema = z.object({
3939 export type CustomIncome = z.infer<typeof CustomIncomeSchema>;
4040
4141 export const ResultSchema = z.object({
42- "cost_absolute": z.union([z.null(), z.number()]),
43- "cost_max": z.union([z.null(), z.number()]),
44- "cost_min": z.union([z.null(), z.number()]),
42+ "cost_absolute": z.union([z.null(), z.number().int()]),
43+ "cost_max": z.union([z.null(), z.number().int()]),
44+ "cost_min": z.union([z.null(), z.number().int()]),
4545 "created_at": z.coerce.date(),
4646 "customIncomes": z.array(CustomIncomeSchema),
4747 "direct_rep_costs_max": z.null(),
4848 "direct_rep_costs_min": z.null(),
4949 "end_date": z.coerce.date(),
50- "eur_sources_grants": z.number(),
50+ "eur_sources_grants": z.number().int(),
5151 "eur_sources_grants_src": z.union([z.null(), z.string()]),
52- "eur_sources_procurement": z.number(),
52+ "eur_sources_procurement": z.number().int(),
5353 "eur_sources_procurement_src": z.union([z.null(), z.string()]),
5454 "id": z.string(),
5555 "new_organisation": z.null(),
5656 "no_clients": z.union([z.null(), z.string()]),
5757 "other_financial_information": z.union([z.null(), z.string()]),
58- "other_sources_contributions": z.union([z.null(), z.number()]),
59- "other_sources_donation": z.union([z.null(), z.number()]),
60- "other_sources_total": z.union([z.null(), z.number()]),
61- "public_financing_infranational": z.union([z.null(), z.number()]),
62- "public_financing_national": z.union([z.null(), z.number()]),
63- "public_financing_total": z.union([z.null(), z.number()]),
58+ "other_sources_contributions": z.union([z.null(), z.number().int()]),
59+ "other_sources_donation": z.union([z.null(), z.number().int()]),
60+ "other_sources_total": z.union([z.null(), z.number().int()]),
61+ "public_financing_infranational": z.union([z.null(), z.number().int()]),
62+ "public_financing_national": z.union([z.null(), z.number().int()]),
63+ "public_financing_total": z.union([z.null(), z.number().int()]),
6464 "representative": z.string(),
6565 "start_date": z.coerce.date(),
6666 "status": StatusSchema,
67- "total_budget": z.union([z.null(), z.number()]),
68- "turnover_absolute": z.union([z.null(), z.number()]),
69- "turnover_max": z.union([z.null(), z.number()]),
70- "turnover_min": z.union([z.null(), z.number()]),
67+ "total_budget": z.union([z.null(), z.number().int()]),
68+ "turnover_absolute": z.union([z.null(), z.number().int()]),
69+ "turnover_max": z.union([z.null(), z.number().int()]),
70+ "turnover_min": z.union([z.null(), z.number().int()]),
7171 "type": ResultTypeSchema,
7272 "updated_at": z.coerce.date(),
7373 "uri": z.string(),
@@ -75,11 +75,11 @@ export const ResultSchema = z.object({
7575 export type Result = z.infer<typeof ResultSchema>;
7676
7777 export const TopLevelSchema = z.object({
78- "count": z.number(),
78+ "count": z.number().int(),
7979 "facets": FacetsSchema,
80- "limit": z.number(),
80+ "limit": z.number().int(),
8181 "next": z.string(),
82- "offset": z.number(),
82+ "offset": z.number().int(),
8383 "previous": z.boolean(),
8484 "results": z.array(ResultSchema),
8585 });
Test case

test/inputs/json/misc/34702.json

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -83,7 +83,7 @@ export const FeaturePropertiesSchema = z.object({
8383 "longitude": z.number(),
8484 "no": z.union([z.null(), z.string()]),
8585 "phone": z.number(),
86- "postcode": z.number(),
86+ "postcode": z.number().int(),
8787 "psa": z.string(),
8888 "region": RegionSchema,
8989 "station": z.string(),
@@ -111,7 +111,7 @@ export type Feature = z.infer<typeof FeatureSchema>;
111111 export const TopLevelSchema = z.object({
112112 "crs": CrsSchema,
113113 "features": z.array(FeatureSchema),
114- "totalFeatures": z.number(),
114+ "totalFeatures": z.number().int(),
115115 "type": z.string(),
116116 });
117117 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -29,7 +29,7 @@ export type Results = z.infer<typeof ResultsSchema>;
2929
3030 export const TopLevelSchema = z.object({
3131 "message": z.array(z.any()),
32- "responseTime": z.number(),
32+ "responseTime": z.number().int(),
3333 "Results": ResultsSchema,
3434 "status": z.string(),
3535 });
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -110,7 +110,7 @@ export const ResultsSchema = z.object({
110110 export type Results = z.infer<typeof ResultsSchema>;
111111
112112 export const QuerySchema = z.object({
113- "count": z.number(),
113+ "count": z.number().int(),
114114 "created": z.coerce.date(),
115115 "lang": z.string(),
116116 "results": ResultsSchema,
Test case

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

1 generated file · +21 −21
Mtypescript-zoddefault / TopLevel.ts+21 −21
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopSchema = z.object({
5- "count": z.number(),
5+ "count": z.number().int(),
66 "item": z.string(),
77 });
88 export type Top = z.infer<typeof TopSchema>;
@@ -38,8 +38,8 @@ export type Owner = z.infer<typeof OwnerSchema>;
3838 export const CachedContentsSchema = z.object({
3939 "average": z.string().optional(),
4040 "largest": z.string().optional(),
41- "non_null": z.number(),
42- "null": z.number(),
41+ "non_null": z.number().int(),
42+ "null": z.number().int(),
4343 "smallest": z.string().optional(),
4444 "sum": z.string().optional(),
4545 "top": z.array(TopSchema).optional(),
@@ -57,12 +57,12 @@ export const ColumnSchema = z.object({
5757 "fieldName": z.string(),
5858 "flags": z.array(z.string()).optional(),
5959 "format": QuerySchema,
60- "id": z.number(),
60+ "id": z.number().int(),
6161 "name": z.string(),
62- "position": z.number(),
62+ "position": z.number().int(),
6363 "renderTypeName": z.string(),
64- "tableColumnId": z.number().optional(),
65- "width": z.number().optional(),
64+ "tableColumnId": z.number().int().optional(),
65+ "width": z.number().int().optional(),
6666 });
6767 export type Column = z.infer<typeof ColumnSchema>;
6868
@@ -77,44 +77,44 @@ export type Metadata = z.infer<typeof MetadataSchema>;
7777
7878 export const ViewSchema = z.object({
7979 "attribution": z.string(),
80- "averageRating": z.number(),
80+ "averageRating": z.number().int(),
8181 "category": z.string(),
8282 "columns": z.array(ColumnSchema),
83- "createdAt": z.number(),
83+ "createdAt": z.number().int(),
8484 "description": z.string(),
8585 "displayType": z.string(),
86- "downloadCount": z.number(),
86+ "downloadCount": z.number().int(),
8787 "flags": z.array(z.string()),
8888 "grants": z.array(GrantSchema),
8989 "hideFromCatalog": z.boolean(),
9090 "hideFromDataJson": z.boolean(),
9191 "id": z.string(),
92- "indexUpdatedAt": z.number(),
92+ "indexUpdatedAt": z.number().int(),
9393 "license": LicenseSchema,
9494 "licenseId": z.string(),
9595 "locale": z.string(),
9696 "metadata": MetadataSchema,
9797 "name": z.string(),
9898 "newBackend": z.boolean(),
99- "numberOfComments": z.number(),
100- "oid": z.number(),
99+ "numberOfComments": z.number().int(),
100+ "oid": z.number().int(),
101101 "owner": OwnerSchema,
102102 "provenance": z.string(),
103103 "publicationAppendEnabled": z.boolean(),
104- "publicationDate": z.number(),
105- "publicationGroup": z.number(),
104+ "publicationDate": z.number().int(),
105+ "publicationGroup": z.number().int(),
106106 "publicationStage": z.string(),
107107 "query": QuerySchema,
108108 "rights": z.array(z.string()),
109109 "rowClass": z.string(),
110- "rowsUpdatedAt": z.number(),
110+ "rowsUpdatedAt": z.number().int(),
111111 "rowsUpdatedBy": z.string(),
112112 "tableAuthor": OwnerSchema,
113- "tableId": z.number(),
113+ "tableId": z.number().int(),
114114 "tags": z.array(z.string()),
115- "totalTimesRated": z.number(),
116- "viewCount": z.number(),
117- "viewLastModified": z.number(),
115+ "totalTimesRated": z.number().int(),
116+ "viewCount": z.number().int(),
117+ "viewLastModified": z.number().int(),
118118 "viewType": z.string(),
119119 });
120120 export type View = z.infer<typeof ViewSchema>;
@@ -125,7 +125,7 @@ export const MetaSchema = z.object({
125125 export type Meta = z.infer<typeof MetaSchema>;
126126
127127 export const TopLevelSchema = z.object({
128- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
128+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
129129 "meta": MetaSchema,
130130 });
131131 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -63,14 +63,14 @@ export type User = z.infer<typeof UserSchema>;
6363 export const MetaSchema = z.object({
6464 "msg": z.string(),
6565 "response_id": z.string(),
66- "status": z.number(),
66+ "status": z.number().int(),
6767 });
6868 export type Meta = z.infer<typeof MetaSchema>;
6969
7070 export const PaginationSchema = z.object({
71- "count": z.number(),
72- "offset": z.number(),
73- "total_count": z.number(),
71+ "count": z.number().int(),
72+ "offset": z.number().int(),
73+ "total_count": z.number().int(),
7474 });
7575 export type Pagination = z.infer<typeof PaginationSchema>;
7676
@@ -108,7 +108,7 @@ export const DatumSchema = z.object({
108108 "id": z.string(),
109109 "images": ImagesSchema,
110110 "import_datetime": z.string(),
111- "is_indexable": z.number(),
111+ "is_indexable": z.number().int(),
112112 "rating": RatingSchema,
113113 "slug": z.string(),
114114 "source": z.string(),
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -8,14 +8,14 @@ export type Name = z.infer<typeof NameSchema>;
88
99 export const ResponseInfoSchema = z.object({
1010 "developerMessage": z.string(),
11- "status": z.number(),
11+ "status": z.number().int(),
1212 });
1313 export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
1414
1515 export const ResultsetSchema = z.object({
16- "count": z.number(),
17- "page": z.number(),
18- "pagesize": z.number(),
16+ "count": z.number().int(),
17+ "page": z.number().int(),
18+ "pagesize": z.number().int(),
1919 });
2020 export type Resultset = z.infer<typeof ResultsetSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -57,7 +57,7 @@ export type Feature = z.infer<typeof FeatureSchema>;
5757 export const TopLevelSchema = z.object({
5858 "crs": CrsSchema,
5959 "features": z.array(FeatureSchema),
60- "totalFeatures": z.number(),
60+ "totalFeatures": z.number().int(),
6161 "type": z.string(),
6262 });
6363 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +3 −3
Mtypescript-zoddefault / TopLevel.ts+3 −3
@@ -22,11 +22,11 @@ export const ResultSchema = z.object({
2222 export type Result = z.infer<typeof ResultSchema>;
2323
2424 export const TopLevelSchema = z.object({
25- "count": z.number(),
25+ "count": z.number().int(),
2626 "facets": FacetsSchema,
27- "limit": z.number(),
27+ "limit": z.number().int(),
2828 "next": z.string(),
29- "offset": z.number(),
29+ "offset": z.number().int(),
3030 "previous": z.boolean(),
3131 "results": z.array(ResultSchema),
3232 });
Test case

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

1 generated file · +22 −22
Mtypescript-zoddefault / TopLevel.ts+22 −22
@@ -9,7 +9,7 @@ export const TypeNameSchema = z.enum([
99 export type TypeName = z.infer<typeof TypeNameSchema>;
1010
1111 export const TopSchema = z.object({
12- "count": z.number(),
12+ "count": z.number().int(),
1313 "item": z.string(),
1414 });
1515 export type Top = z.infer<typeof TopSchema>;
@@ -95,15 +95,15 @@ export const OwnerSchema = z.object({
9595 export type Owner = z.infer<typeof OwnerSchema>;
9696
9797 export const ExpressionSchema = z.object({
98- "columnId": z.number(),
98+ "columnId": z.number().int(),
9999 "type": z.string(),
100100 });
101101 export type Expression = z.infer<typeof ExpressionSchema>;
102102
103103 export const CachedContentsSchema = z.object({
104104 "largest": z.string(),
105- "non_null": z.number(),
106- "null": z.number(),
105+ "non_null": z.number().int(),
106+ "null": z.number().int(),
107107 "smallest": z.string(),
108108 "top": z.array(TopSchema),
109109 });
@@ -140,12 +140,12 @@ export const ColumnSchema = z.object({
140140 "fieldName": z.string(),
141141 "flags": z.array(z.string()).optional(),
142142 "format": FormatSchema,
143- "id": z.number(),
143+ "id": z.number().int(),
144144 "name": z.string(),
145- "position": z.number(),
145+ "position": z.number().int(),
146146 "renderTypeName": TypeNameSchema,
147- "tableColumnId": z.number().optional(),
148- "width": z.number().optional(),
147+ "tableColumnId": z.number().int().optional(),
148+ "width": z.number().int().optional(),
149149 });
150150 export type Column = z.infer<typeof ColumnSchema>;
151151
@@ -167,41 +167,41 @@ export type Query = z.infer<typeof QuerySchema>;
167167 export const ViewSchema = z.object({
168168 "attribution": z.string(),
169169 "attributionLink": z.string(),
170- "averageRating": z.number(),
170+ "averageRating": z.number().int(),
171171 "category": z.string(),
172172 "columns": z.array(ColumnSchema),
173- "createdAt": z.number(),
173+ "createdAt": z.number().int(),
174174 "description": z.string(),
175175 "displayType": z.string(),
176- "downloadCount": z.number(),
176+ "downloadCount": z.number().int(),
177177 "flags": z.array(z.string()),
178178 "grants": z.array(GrantSchema),
179179 "hideFromCatalog": z.boolean(),
180180 "hideFromDataJson": z.boolean(),
181181 "id": z.string(),
182- "indexUpdatedAt": z.number(),
182+ "indexUpdatedAt": z.number().int(),
183183 "locale": z.string(),
184184 "metadata": MetadataSchema,
185185 "name": z.string(),
186186 "newBackend": z.boolean(),
187- "numberOfComments": z.number(),
188- "oid": z.number(),
187+ "numberOfComments": z.number().int(),
188+ "oid": z.number().int(),
189189 "owner": OwnerSchema,
190190 "provenance": z.string(),
191191 "publicationAppendEnabled": z.boolean(),
192- "publicationDate": z.number(),
193- "publicationGroup": z.number(),
192+ "publicationDate": z.number().int(),
193+ "publicationGroup": z.number().int(),
194194 "publicationStage": z.string(),
195195 "query": QuerySchema,
196196 "rights": z.array(z.string()),
197- "rowsUpdatedAt": z.number(),
197+ "rowsUpdatedAt": z.number().int(),
198198 "rowsUpdatedBy": z.string(),
199199 "tableAuthor": OwnerSchema,
200- "tableId": z.number(),
200+ "tableId": z.number().int(),
201201 "tags": z.array(z.string()),
202- "totalTimesRated": z.number(),
203- "viewCount": z.number(),
204- "viewLastModified": z.number(),
202+ "totalTimesRated": z.number().int(),
203+ "viewCount": z.number().int(),
204+ "viewLastModified": z.number().int(),
205205 "viewType": z.string(),
206206 });
207207 export type View = z.infer<typeof ViewSchema>;
@@ -212,7 +212,7 @@ export const MetaSchema = z.object({
212212 export type Meta = z.infer<typeof MetaSchema>;
213213
214214 export const TopLevelSchema = z.object({
215- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
215+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
216216 "meta": MetaSchema,
217217 });
218218 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +22 −22
Mtypescript-zoddefault / TopLevel.ts+22 −22
@@ -9,7 +9,7 @@ export const TypeNameSchema = z.enum([
99 export type TypeName = z.infer<typeof TypeNameSchema>;
1010
1111 export const TopSchema = z.object({
12- "count": z.number(),
12+ "count": z.number().int(),
1313 "item": z.string(),
1414 });
1515 export type Top = z.infer<typeof TopSchema>;
@@ -93,15 +93,15 @@ export const OwnerSchema = z.object({
9393 export type Owner = z.infer<typeof OwnerSchema>;
9494
9595 export const ExpressionSchema = z.object({
96- "columnId": z.number(),
96+ "columnId": z.number().int(),
9797 "type": z.string(),
9898 });
9999 export type Expression = z.infer<typeof ExpressionSchema>;
100100
101101 export const CachedContentsSchema = z.object({
102102 "largest": z.string(),
103- "non_null": z.number(),
104- "null": z.number(),
103+ "non_null": z.number().int(),
104+ "null": z.number().int(),
105105 "smallest": z.string(),
106106 "top": z.array(TopSchema),
107107 });
@@ -139,12 +139,12 @@ export const ColumnSchema = z.object({
139139 "fieldName": z.string(),
140140 "flags": z.array(z.string()).optional(),
141141 "format": FormatSchema,
142- "id": z.number(),
142+ "id": z.number().int(),
143143 "name": z.string(),
144- "position": z.number(),
144+ "position": z.number().int(),
145145 "renderTypeName": TypeNameSchema,
146- "tableColumnId": z.number().optional(),
147- "width": z.number().optional(),
146+ "tableColumnId": z.number().int().optional(),
147+ "width": z.number().int().optional(),
148148 });
149149 export type Column = z.infer<typeof ColumnSchema>;
150150
@@ -166,41 +166,41 @@ export type Query = z.infer<typeof QuerySchema>;
166166 export const ViewSchema = z.object({
167167 "attribution": z.string(),
168168 "attributionLink": z.string(),
169- "averageRating": z.number(),
169+ "averageRating": z.number().int(),
170170 "category": z.string(),
171171 "columns": z.array(ColumnSchema),
172- "createdAt": z.number(),
172+ "createdAt": z.number().int(),
173173 "description": z.string(),
174174 "displayType": z.string(),
175- "downloadCount": z.number(),
175+ "downloadCount": z.number().int(),
176176 "flags": z.array(z.string()),
177177 "grants": z.array(GrantSchema),
178178 "hideFromCatalog": z.boolean(),
179179 "hideFromDataJson": z.boolean(),
180180 "id": z.string(),
181- "indexUpdatedAt": z.number(),
181+ "indexUpdatedAt": z.number().int(),
182182 "locale": z.string(),
183183 "metadata": MetadataSchema,
184184 "name": z.string(),
185185 "newBackend": z.boolean(),
186- "numberOfComments": z.number(),
187- "oid": z.number(),
186+ "numberOfComments": z.number().int(),
187+ "oid": z.number().int(),
188188 "owner": OwnerSchema,
189189 "provenance": z.string(),
190190 "publicationAppendEnabled": z.boolean(),
191- "publicationDate": z.number(),
192- "publicationGroup": z.number(),
191+ "publicationDate": z.number().int(),
192+ "publicationGroup": z.number().int(),
193193 "publicationStage": z.string(),
194194 "query": QuerySchema,
195195 "rights": z.array(z.string()),
196- "rowsUpdatedAt": z.number(),
196+ "rowsUpdatedAt": z.number().int(),
197197 "rowsUpdatedBy": z.string(),
198198 "tableAuthor": OwnerSchema,
199- "tableId": z.number(),
199+ "tableId": z.number().int(),
200200 "tags": z.array(z.string()),
201- "totalTimesRated": z.number(),
202- "viewCount": z.number(),
203- "viewLastModified": z.number(),
201+ "totalTimesRated": z.number().int(),
202+ "viewCount": z.number().int(),
203+ "viewLastModified": z.number().int(),
204204 "viewType": z.string(),
205205 });
206206 export type View = z.infer<typeof ViewSchema>;
@@ -211,7 +211,7 @@ export const MetaSchema = z.object({
211211 export type Meta = z.infer<typeof MetaSchema>;
212212
213213 export const TopLevelSchema = z.object({
214- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
214+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
215215 "meta": MetaSchema,
216216 });
217217 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -68,7 +68,7 @@ export type Ruling = z.infer<typeof RulingSchema>;
6868
6969 export const CardSchema = z.object({
7070 "artist": z.string(),
71- "cmc": z.number(),
71+ "cmc": z.number().int(),
7272 "colorIdentity": z.array(ColorIdentitySchema).optional(),
7373 "colors": z.array(WatermarkSchema).optional(),
7474 "flavor": z.string().optional(),
@@ -78,7 +78,7 @@ export const CardSchema = z.object({
7878 "legalities": z.array(LegalityElementSchema),
7979 "manaCost": z.string().optional(),
8080 "mciNumber": z.string().optional(),
81- "multiverseid": z.number(),
81+ "multiverseid": z.number().int(),
8282 "name": z.string(),
8383 "originalText": z.string(),
8484 "originalType": z.string(),
@@ -93,7 +93,7 @@ export const CardSchema = z.object({
9393 "toughness": z.string().optional(),
9494 "type": z.string(),
9595 "types": z.array(TypeSchema),
96- "variations": z.array(z.number()).optional(),
96+ "variations": z.array(z.number().int()).optional(),
9797 "watermark": WatermarkSchema.optional(),
9898 });
9999 export type Card = z.infer<typeof CardSchema>;
@@ -105,7 +105,7 @@ export const TopLevelSchema = z.object({
105105 "code": z.string(),
106106 "gathererCode": z.string(),
107107 "magicCardsInfoCode": z.string(),
108- "mkm_id": z.number(),
108+ "mkm_id": z.number().int(),
109109 "mkm_name": z.string(),
110110 "name": z.string(),
111111 "releaseDate": z.string(),
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -10,6 +10,6 @@ export type IssPosition = z.infer<typeof IssPositionSchema>;
1010 export const TopLevelSchema = z.object({
1111 "iss_position": IssPositionSchema,
1212 "message": z.string(),
13- "timestamp": z.number(),
13+ "timestamp": z.number().int(),
1414 });
1515 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -9,7 +9,7 @@ export type Person = z.infer<typeof PersonSchema>;
99
1010 export const TopLevelSchema = z.object({
1111 "message": z.string(),
12- "number": z.number(),
12+ "number": z.number().int(),
1313 "people": z.array(PersonSchema),
1414 });
1515 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +12 −12
Mtypescript-zoddefault / TopLevel.ts+12 −12
@@ -3,19 +3,19 @@ import * as z from "zod";
33
44 export const OutSchema = z.object({
55 "addr": z.string(),
6- "n": z.number(),
6+ "n": z.number().int(),
77 "script": z.string(),
88 "spent": z.boolean(),
9- "tx_index": z.number(),
10- "type": z.number(),
11- "value": z.number(),
9+ "tx_index": z.number().int(),
10+ "type": z.number().int(),
11+ "value": z.number().int(),
1212 });
1313 export type Out = z.infer<typeof OutSchema>;
1414
1515 export const InputSchema = z.object({
1616 "prev_out": OutSchema,
1717 "script": z.string(),
18- "sequence": z.number(),
18+ "sequence": z.number().int(),
1919 });
2020 export type Input = z.infer<typeof InputSchema>;
2121
@@ -23,15 +23,15 @@ export const TxSchema = z.object({
2323 "double_spend": z.boolean(),
2424 "hash": z.string(),
2525 "inputs": z.array(InputSchema),
26- "lock_time": z.number(),
26+ "lock_time": z.number().int(),
2727 "out": z.array(OutSchema),
2828 "relayed_by": z.string(),
29- "size": z.number(),
30- "time": z.number(),
31- "tx_index": z.number(),
32- "ver": z.number(),
33- "vin_sz": z.number(),
34- "vout_sz": z.number(),
29+ "size": z.number().int(),
30+ "time": z.number().int(),
31+ "tx_index": z.number().int(),
32+ "ver": z.number().int(),
33+ "vin_sz": z.number().int(),
34+ "vout_sz": z.number().int(),
3535 });
3636 export type Tx = z.infer<typeof TxSchema>;
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -3,14 +3,14 @@ import * as z from "zod";
33
44 export const ResponseInfoSchema = z.object({
55 "developerMessage": z.string(),
6- "status": z.number(),
6+ "status": z.number().int(),
77 });
88 export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
99
1010 export const ResultsetSchema = z.object({
11- "count": z.number(),
12- "page": z.number(),
13- "pagesize": z.number(),
11+ "count": z.number().int(),
12+ "page": z.number().int(),
13+ "pagesize": z.number().int(),
1414 });
1515 export type Resultset = z.infer<typeof ResultsetSchema>;
Test case

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

1 generated file · +15 −15
Mtypescript-zoddefault / TopLevel.ts+15 −15
@@ -22,32 +22,32 @@ export type Kind = z.infer<typeof KindSchema>;
2222
2323 export const OembedSchema = z.object({
2424 "description": z.string(),
25- "height": z.number(),
25+ "height": z.number().int(),
2626 "html": z.string(),
2727 "provider_name": z.string(),
2828 "provider_url": z.string(),
29- "thumbnail_height": z.number(),
29+ "thumbnail_height": z.number().int(),
3030 "thumbnail_url": z.string(),
31- "thumbnail_width": z.number(),
31+ "thumbnail_width": z.number().int(),
3232 "title": z.string(),
3333 "type": z.string(),
3434 "version": z.string(),
35- "width": z.number(),
35+ "width": z.number().int(),
3636 });
3737 export type Oembed = z.infer<typeof OembedSchema>;
3838
3939 export const MediaEmbedSchema = z.object({
4040 "content": z.string().optional(),
41- "height": z.number().optional(),
41+ "height": z.number().int().optional(),
4242 "scrolling": z.boolean().optional(),
43- "width": z.number().optional(),
43+ "width": z.number().int().optional(),
4444 });
4545 export type MediaEmbed = z.infer<typeof MediaEmbedSchema>;
4646
4747 export const SourceSchema = z.object({
48- "height": z.number(),
48+ "height": z.number().int(),
4949 "url": z.string(),
50- "width": z.number(),
50+ "width": z.number().int(),
5151 });
5252 export type Source = z.infer<typeof SourceSchema>;
5353
@@ -103,9 +103,9 @@ export const ChildDataSchema = z.object({
103103 "created_utc": z.number(),
104104 "distinguished": z.null(),
105105 "domain": z.string(),
106- "downs": z.number(),
106+ "downs": z.number().int(),
107107 "edited": z.boolean(),
108- "gilded": z.number(),
108+ "gilded": z.number().int(),
109109 "hidden": z.boolean(),
110110 "hide_score": z.boolean(),
111111 "id": z.string(),
@@ -119,7 +119,7 @@ export const ChildDataSchema = z.object({
119119 "media_embed": MediaEmbedSchema,
120120 "mod_reports": z.array(z.any()),
121121 "name": z.string(),
122- "num_comments": z.number(),
122+ "num_comments": z.number().int(),
123123 "num_reports": z.null(),
124124 "over_18": z.boolean(),
125125 "permalink": z.string(),
@@ -129,7 +129,7 @@ export const ChildDataSchema = z.object({
129129 "removal_reason": z.null(),
130130 "report_reasons": z.null(),
131131 "saved": z.boolean(),
132- "score": z.number(),
132+ "score": z.number().int(),
133133 "secure_media": z.union([z.null(), MediaSchema]),
134134 "secure_media_embed": MediaEmbedSchema,
135135 "selftext": z.string(),
@@ -142,10 +142,10 @@ export const ChildDataSchema = z.object({
142142 "subreddit_type": SubredditTypeSchema,
143143 "suggested_sort": z.union([z.null(), z.string()]),
144144 "thumbnail": z.string(),
145- "thumbnail_height": z.union([z.null(), z.number()]),
146- "thumbnail_width": z.union([z.null(), z.number()]),
145+ "thumbnail_height": z.union([z.null(), z.number().int()]),
146+ "thumbnail_width": z.union([z.null(), z.number().int()]),
147147 "title": z.string(),
148- "ups": z.number(),
148+ "ups": z.number().int(),
149149 "url": z.string(),
150150 "user_reports": z.array(z.any()),
151151 "view_count": z.null(),
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -112,7 +112,7 @@ export const ResultsSchema = z.object({
112112 export type Results = z.infer<typeof ResultsSchema>;
113113
114114 export const QuerySchema = z.object({
115- "count": z.number(),
115+ "count": z.number().int(),
116116 "created": z.coerce.date(),
117117 "lang": z.string(),
118118 "results": ResultsSchema,
Test case

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

1 generated file · +12 −12
Mtypescript-zoddefault / TopLevel.ts+12 −12
@@ -30,7 +30,7 @@ export const ResultSchema = z.object({
3030 "be_office_street": z.string().optional(),
3131 "be_office_town": z.string().optional(),
3232 "code_of_conduct": z.string(),
33- "contact_country": z.number(),
33+ "contact_country": z.number().int(),
3434 "created_at": z.coerce.date(),
3535 "entity": z.string(),
3636 "goals": z.string(),
@@ -49,23 +49,23 @@ export const ResultSchema = z.object({
4949 "last_update_date": z.coerce.date(),
5050 "legal": z.string(),
5151 "legal_status": z.string(),
52- "main_category": z.number(),
52+ "main_category": z.number().int(),
5353 "main_category_title": z.string(),
54- "members": z.number(),
55- "members_100": z.union([z.null(), z.number()]),
56- "members_25": z.union([z.null(), z.number()]),
57- "members_50": z.union([z.null(), z.number()]),
58- "members_75": z.union([z.null(), z.number()]),
54+ "members": z.number().int(),
55+ "members_100": z.union([z.null(), z.number().int()]),
56+ "members_25": z.union([z.null(), z.number().int()]),
57+ "members_50": z.union([z.null(), z.number().int()]),
58+ "members_75": z.union([z.null(), z.number().int()]),
5959 "members_fte": z.number(),
6060 "name": z.string(),
6161 "native_name": z.null(),
6262 "networking": z.union([z.null(), z.string()]),
63- "number_of_natural_persons": z.union([z.null(), z.number()]),
63+ "number_of_natural_persons": z.union([z.null(), z.number().int()]),
6464 "other_code_of_conduct": z.union([z.null(), z.string()]),
6565 "registration_date": z.coerce.date(),
6666 "status": StatusSchema,
6767 "structure_members": z.string(),
68- "sub_category": z.number(),
68+ "sub_category": z.number().int(),
6969 "sub_category_title": z.string(),
7070 "updated_at": z.coerce.date(),
7171 "uri": z.string(),
@@ -74,11 +74,11 @@ export const ResultSchema = z.object({
7474 export type Result = z.infer<typeof ResultSchema>;
7575
7676 export const TopLevelSchema = z.object({
77- "count": z.number(),
77+ "count": z.number().int(),
7878 "facets": FacetsSchema,
79- "limit": z.number(),
79+ "limit": z.number().int(),
8080 "next": z.string(),
81- "offset": z.number(),
81+ "offset": z.number().int(),
8282 "previous": z.boolean(),
8383 "results": z.array(ResultSchema),
8484 });
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -72,14 +72,14 @@ export type User = z.infer<typeof UserSchema>;
7272 export const MetaSchema = z.object({
7373 "msg": z.string(),
7474 "response_id": z.string(),
75- "status": z.number(),
75+ "status": z.number().int(),
7676 });
7777 export type Meta = z.infer<typeof MetaSchema>;
7878
7979 export const PaginationSchema = z.object({
80- "count": z.number(),
81- "offset": z.number(),
82- "total_count": z.number(),
80+ "count": z.number().int(),
81+ "offset": z.number().int(),
82+ "total_count": z.number().int(),
8383 });
8484 export type Pagination = z.infer<typeof PaginationSchema>;
8585
@@ -118,7 +118,7 @@ export const DatumSchema = z.object({
118118 "id": z.string(),
119119 "images": ImagesSchema,
120120 "import_datetime": z.string(),
121- "is_indexable": z.number(),
121+ "is_indexable": z.number().int(),
122122 "rating": RatingSchema,
123123 "slug": z.string(),
124124 "source": z.string(),
Test case

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

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -2,9 +2,9 @@ import * as z from "zod";
22
33
44 export const PcSchema = z.object({
5- "count": z.number(),
5+ "count": z.number().int(),
66 "label": z.string(),
7- "peak24": z.number(),
7+ "peak24": z.number().int(),
88 });
99 export type Pc = z.infer<typeof PcSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -46,20 +46,20 @@ export const ResultSchema = z.object({
4646 "fav": z.boolean(),
4747 "group": GroupSchema,
4848 "location": LocationSchema,
49- "min_screens": z.number(),
50- "num_views": z.number(),
49+ "min_screens": z.number().int(),
50+ "num_views": z.number().int(),
5151 "showtimes": z.string(),
52- "stars": z.number(),
52+ "stars": z.number().int(),
5353 "tel": TelSchema,
5454 "thai": z.string(),
55- "today_screens": z.number(),
55+ "today_screens": z.number().int(),
5656 "url": z.string(),
5757 "website": z.string(),
5858 });
5959 export type Result = z.infer<typeof ResultSchema>;
6060
6161 export const TopLevelSchema = z.object({
62- "count": z.number(),
62+ "count": z.number().int(),
6363 "next": z.string(),
6464 "previous": z.null(),
6565 "results": z.array(ResultSchema),
Test case

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

1 generated file · +6 −6
Mtypescript-zoddefault / TopLevel.ts+6 −6
@@ -7,21 +7,21 @@ export type Facets = z.infer<typeof FacetsSchema>;
77
88 export const ResultSchema = z.object({
99 "created_at": z.coerce.date(),
10- "id": z.number(),
11- "items": z.number(),
10+ "id": z.number().int(),
11+ "items": z.number().int(),
1212 "name": z.string(),
13- "parent": z.union([z.null(), z.number()]),
13+ "parent": z.union([z.null(), z.number().int()]),
1414 "updated_at": z.coerce.date(),
1515 "uri": z.string(),
1616 });
1717 export type Result = z.infer<typeof ResultSchema>;
1818
1919 export const TopLevelSchema = z.object({
20- "count": z.number(),
20+ "count": z.number().int(),
2121 "facets": FacetsSchema,
22- "limit": z.number(),
22+ "limit": z.number().int(),
2323 "next": z.boolean(),
24- "offset": z.number(),
24+ "offset": z.number().int(),
2525 "previous": z.boolean(),
2626 "results": z.array(ResultSchema),
2727 });
Test case

test/inputs/json/misc/88130.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

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

1 generated file · +3 −3
Mtypescript-zoddefault / TopLevel.ts+3 −3
@@ -34,11 +34,11 @@ export const ResultSchema = z.object({
3434 export type Result = z.infer<typeof ResultSchema>;
3535
3636 export const TopLevelSchema = z.object({
37- "count": z.number(),
37+ "count": z.number().int(),
3838 "facets": FacetsSchema,
39- "limit": z.number(),
39+ "limit": z.number().int(),
4040 "next": z.string(),
41- "offset": z.number(),
41+ "offset": z.number().int(),
4242 "previous": z.boolean(),
4343 "results": z.array(ResultSchema),
4444 });
Test case

test/inputs/json/misc/a0496.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -14,7 +14,7 @@ export const TopLevelSchema = z.object({
1414 "errors": ErrorsSchema,
1515 "frequency": z.string(),
1616 "from_date": z.string(),
17- "id": z.number(),
17+ "id": z.number().int(),
1818 "name": z.string(),
1919 "premium": z.boolean(),
2020 "source_code": z.string(),
Test case

test/inputs/json/misc/a1eca.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

test/inputs/json/misc/a3d8c.json

1 generated file · +21 −21
Mtypescript-zoddefault / TopLevel.ts+21 −21
@@ -9,7 +9,7 @@ export const TypeNameSchema = z.enum([
99 export type TypeName = z.infer<typeof TypeNameSchema>;
1010
1111 export const TopSchema = z.object({
12- "count": z.number(),
12+ "count": z.number().int(),
1313 "item": z.string(),
1414 });
1515 export type Top = z.infer<typeof TopSchema>;
@@ -45,8 +45,8 @@ export type Owner = z.infer<typeof OwnerSchema>;
4545 export const CachedContentsSchema = z.object({
4646 "average": z.string().optional(),
4747 "largest": z.string(),
48- "non_null": z.number(),
49- "null": z.number(),
48+ "non_null": z.number().int(),
49+ "null": z.number().int(),
5050 "smallest": z.string(),
5151 "sum": z.string().optional(),
5252 "top": z.array(TopSchema),
@@ -64,12 +64,12 @@ export const ColumnSchema = z.object({
6464 "fieldName": z.string(),
6565 "flags": z.array(z.string()).optional(),
6666 "format": QuerySchema,
67- "id": z.number(),
67+ "id": z.number().int(),
6868 "name": z.string(),
69- "position": z.number(),
69+ "position": z.number().int(),
7070 "renderTypeName": TypeNameSchema,
71- "tableColumnId": z.number().optional(),
72- "width": z.number().optional(),
71+ "tableColumnId": z.number().int().optional(),
72+ "width": z.number().int().optional(),
7373 });
7474 export type Column = z.infer<typeof ColumnSchema>;
7575
@@ -83,42 +83,42 @@ export const MetadataSchema = z.object({
8383 export type Metadata = z.infer<typeof MetadataSchema>;
8484
8585 export const ViewSchema = z.object({
86- "averageRating": z.number(),
86+ "averageRating": z.number().int(),
8787 "category": z.string(),
8888 "columns": z.array(ColumnSchema),
89- "createdAt": z.number(),
89+ "createdAt": z.number().int(),
9090 "displayType": z.string(),
91- "downloadCount": z.number(),
91+ "downloadCount": z.number().int(),
9292 "flags": z.array(z.string()),
9393 "grants": z.array(GrantSchema),
9494 "hideFromCatalog": z.boolean(),
9595 "hideFromDataJson": z.boolean(),
9696 "id": z.string(),
97- "indexUpdatedAt": z.number(),
97+ "indexUpdatedAt": z.number().int(),
9898 "license": LicenseSchema,
9999 "licenseId": z.string(),
100100 "locale": z.string(),
101101 "metadata": MetadataSchema,
102102 "name": z.string(),
103103 "newBackend": z.boolean(),
104- "numberOfComments": z.number(),
105- "oid": z.number(),
104+ "numberOfComments": z.number().int(),
105+ "oid": z.number().int(),
106106 "owner": OwnerSchema,
107107 "provenance": z.string(),
108108 "publicationAppendEnabled": z.boolean(),
109- "publicationDate": z.number(),
110- "publicationGroup": z.number(),
109+ "publicationDate": z.number().int(),
110+ "publicationGroup": z.number().int(),
111111 "publicationStage": z.string(),
112112 "query": QuerySchema,
113113 "rights": z.array(z.string()),
114114 "rowClass": z.string(),
115- "rowsUpdatedAt": z.number(),
115+ "rowsUpdatedAt": z.number().int(),
116116 "rowsUpdatedBy": z.string(),
117117 "tableAuthor": OwnerSchema,
118- "tableId": z.number(),
119- "totalTimesRated": z.number(),
120- "viewCount": z.number(),
121- "viewLastModified": z.number(),
118+ "tableId": z.number().int(),
119+ "totalTimesRated": z.number().int(),
120+ "viewCount": z.number().int(),
121+ "viewLastModified": z.number().int(),
122122 "viewType": z.string(),
123123 });
124124 export type View = z.infer<typeof ViewSchema>;
@@ -129,7 +129,7 @@ export const MetaSchema = z.object({
129129 export type Meta = z.infer<typeof MetaSchema>;
130130
131131 export const TopLevelSchema = z.object({
132- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
132+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
133133 "meta": MetaSchema,
134134 });
135135 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/a45b0.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/ab0d1.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/abb4b.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

test/inputs/json/misc/af2d1.json

1 generated file · +6 −6
Mtypescript-zoddefault / TopLevel.ts+6 −6
@@ -88,7 +88,7 @@ export const FeaturePropertiesSchema = z.object({
8888 "area_": z.number(),
8989 "asset_numb": z.string(),
9090 "comments": z.union([z.null(), z.string()]),
91- "condition": z.number(),
91+ "condition": z.number().int(),
9292 "constructi": z.union([z.null(), z.string()]),
9393 "createdate": z.null(),
9494 "createuser": z.null(),
@@ -98,19 +98,19 @@ export const FeaturePropertiesSchema = z.object({
9898 "file_numbe": z.union([z.null(), z.string()]),
9999 "folder_num": z.union([z.null(), z.string()]),
100100 "funding_ba": z.union([z.null(), FundingBaSchema]),
101- "historic_c": z.number(),
101+ "historic_c": z.number().int(),
102102 "inspection": z.string(),
103103 "inspectors": z.null(),
104104 "last_updat": z.null(),
105105 "level_accu": z.union([z.null(), LevelAccuSchema]),
106106 "material": MaterialSchema,
107- "mi_prinx": z.number(),
107+ "mi_prinx": z.number().int(),
108108 "mi_symbolo": MiSymboloSchema,
109- "number_lan": z.number(),
109+ "number_lan": z.number().int(),
110110 "owner": z.union([z.null(), z.string()]),
111111 "positional": z.union([z.null(), LevelAccuSchema]),
112112 "project_nu": z.union([z.null(), z.string()]),
113- "rec_id": z.number(),
113+ "rec_id": z.number().int(),
114114 "record_cre": z.union([z.null(), z.string()]),
115115 "shape_area": z.number(),
116116 "shape_leng": z.number(),
@@ -143,7 +143,7 @@ export type Feature = z.infer<typeof FeatureSchema>;
143143 export const TopLevelSchema = z.object({
144144 "crs": CrsSchema,
145145 "features": z.array(FeatureSchema),
146- "totalFeatures": z.number(),
146+ "totalFeatures": z.number().int(),
147147 "type": z.string(),
148148 });
149149 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/b6f2c.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

test/inputs/json/misc/bb1ec.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

test/inputs/json/misc/be234.json

1 generated file · +15 −15
Mtypescript-zoddefault / TopLevel.ts+15 −15
@@ -50,32 +50,32 @@ export type Kind = z.infer<typeof KindSchema>;
5050
5151 export const OembedSchema = z.object({
5252 "description": z.string(),
53- "height": z.number(),
53+ "height": z.number().int(),
5454 "html": z.string(),
5555 "provider_name": z.string(),
5656 "provider_url": z.string(),
57- "thumbnail_height": z.number(),
57+ "thumbnail_height": z.number().int(),
5858 "thumbnail_url": z.string(),
59- "thumbnail_width": z.number(),
59+ "thumbnail_width": z.number().int(),
6060 "title": z.string(),
6161 "type": z.string(),
6262 "version": z.string(),
63- "width": z.number(),
63+ "width": z.number().int(),
6464 });
6565 export type Oembed = z.infer<typeof OembedSchema>;
6666
6767 export const MediaEmbedSchema = z.object({
6868 "content": z.string().optional(),
69- "height": z.number().optional(),
69+ "height": z.number().int().optional(),
7070 "scrolling": z.boolean().optional(),
71- "width": z.number().optional(),
71+ "width": z.number().int().optional(),
7272 });
7373 export type MediaEmbed = z.infer<typeof MediaEmbedSchema>;
7474
7575 export const SourceSchema = z.object({
76- "height": z.number(),
76+ "height": z.number().int(),
7777 "url": z.string(),
78- "width": z.number(),
78+ "width": z.number().int(),
7979 });
8080 export type Source = z.infer<typeof SourceSchema>;
8181
@@ -129,9 +129,9 @@ export const ChildDataSchema = z.object({
129129 "created_utc": z.number(),
130130 "distinguished": z.union([z.null(), z.string()]),
131131 "domain": DomainSchema,
132- "downs": z.number(),
132+ "downs": z.number().int(),
133133 "edited": z.boolean(),
134- "gilded": z.number(),
134+ "gilded": z.number().int(),
135135 "hidden": z.boolean(),
136136 "hide_score": z.boolean(),
137137 "id": z.string(),
@@ -145,7 +145,7 @@ export const ChildDataSchema = z.object({
145145 "media_embed": MediaEmbedSchema,
146146 "mod_reports": z.array(z.any()),
147147 "name": z.string(),
148- "num_comments": z.number(),
148+ "num_comments": z.number().int(),
149149 "num_reports": z.null(),
150150 "over_18": z.boolean(),
151151 "permalink": z.string(),
@@ -155,7 +155,7 @@ export const ChildDataSchema = z.object({
155155 "removal_reason": z.null(),
156156 "report_reasons": z.null(),
157157 "saved": z.boolean(),
158- "score": z.number(),
158+ "score": z.number().int(),
159159 "secure_media": z.union([z.null(), MediaSchema]),
160160 "secure_media_embed": MediaEmbedSchema,
161161 "selftext": z.string(),
@@ -168,10 +168,10 @@ export const ChildDataSchema = z.object({
168168 "subreddit_type": SubredditTypeSchema,
169169 "suggested_sort": z.null(),
170170 "thumbnail": z.string(),
171- "thumbnail_height": z.number(),
172- "thumbnail_width": z.number(),
171+ "thumbnail_height": z.number().int(),
172+ "thumbnail_width": z.number().int(),
173173 "title": z.string(),
174- "ups": z.number(),
174+ "ups": z.number().int(),
175175 "url": z.string(),
176176 "user_reports": z.array(z.any()),
177177 "view_count": z.null(),
Test case

test/inputs/json/misc/c0356.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -9,7 +9,7 @@ export type Datum = z.infer<typeof DatumSchema>;
99
1010 export const DescriptionSchema = z.object({
1111 "base_period": z.string(),
12- "missing": z.number(),
12+ "missing": z.number().int(),
1313 "title": z.string(),
1414 });
1515 export type Description = z.infer<typeof DescriptionSchema>;
Test case

test/inputs/json/misc/c3303.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -69,14 +69,14 @@ export type User = z.infer<typeof UserSchema>;
6969 export const MetaSchema = z.object({
7070 "msg": z.string(),
7171 "response_id": z.string(),
72- "status": z.number(),
72+ "status": z.number().int(),
7373 });
7474 export type Meta = z.infer<typeof MetaSchema>;
7575
7676 export const PaginationSchema = z.object({
77- "count": z.number(),
78- "offset": z.number(),
79- "total_count": z.number(),
77+ "count": z.number().int(),
78+ "offset": z.number().int(),
79+ "total_count": z.number().int(),
8080 });
8181 export type Pagination = z.infer<typeof PaginationSchema>;
8282
@@ -115,7 +115,7 @@ export const DatumSchema = z.object({
115115 "id": z.string(),
116116 "images": ImagesSchema,
117117 "import_datetime": z.string(),
118- "is_indexable": z.number(),
118+ "is_indexable": z.number().int(),
119119 "rating": RatingSchema,
120120 "slug": z.string(),
121121 "source": z.string(),
Test case

test/inputs/json/misc/cf0d8.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

test/inputs/json/misc/d0908.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -3,7 +3,7 @@ import * as z from "zod";
33
44 export const TotalPopulationSchema = z.object({
55 "date": z.string(),
6- "population": z.number(),
6+ "population": z.number().int(),
77 });
88 export type TotalPopulation = z.infer<typeof TotalPopulationSchema>;
Test case

test/inputs/json/misc/d23d5.json

1 generated file · +3 −3
Mtypescript-zoddefault / TopLevel.ts+3 −3
@@ -16,11 +16,11 @@ export const ResultSchema = z.object({
1616 export type Result = z.infer<typeof ResultSchema>;
1717
1818 export const TopLevelSchema = z.object({
19- "count": z.number(),
19+ "count": z.number().int(),
2020 "facets": FacetsSchema,
21- "limit": z.number(),
21+ "limit": z.number().int(),
2222 "next": z.string(),
23- "offset": z.number(),
23+ "offset": z.number().int(),
2424 "previous": z.boolean(),
2525 "results": z.array(ResultSchema),
2626 });
Test case

test/inputs/json/misc/dbfb3.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -111,7 +111,7 @@ export const ResultsSchema = z.object({
111111 export type Results = z.infer<typeof ResultsSchema>;
112112
113113 export const QuerySchema = z.object({
114- "count": z.number(),
114+ "count": z.number().int(),
115115 "created": z.coerce.date(),
116116 "lang": z.string(),
117117 "results": ResultsSchema,
Test case

test/inputs/json/misc/dc44f.json

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -117,7 +117,7 @@ export type Ruling = z.infer<typeof RulingSchema>;
117117
118118 export const CardSchema = z.object({
119119 "artist": z.string(),
120- "cmc": z.number(),
120+ "cmc": z.number().int(),
121121 "colorIdentity": z.array(ColorIdentitySchema).optional(),
122122 "colors": z.array(ColorSchema).optional(),
123123 "flavor": z.string().optional(),
@@ -127,7 +127,7 @@ export const CardSchema = z.object({
127127 "legalities": z.array(LegalityElementSchema),
128128 "manaCost": z.string().optional(),
129129 "mciNumber": z.string().optional(),
130- "multiverseid": z.number(),
130+ "multiverseid": z.number().int(),
131131 "name": z.string(),
132132 "originalText": z.string().optional(),
133133 "originalType": z.string(),
@@ -142,7 +142,7 @@ export const CardSchema = z.object({
142142 "toughness": z.string().optional(),
143143 "type": z.string(),
144144 "types": z.array(TypeSchema),
145- "variations": z.array(z.number()).optional(),
145+ "variations": z.array(z.number().int()).optional(),
146146 });
147147 export type Card = z.infer<typeof CardSchema>;
148148
@@ -153,7 +153,7 @@ export const TopLevelSchema = z.object({
153153 "code": z.string(),
154154 "gathererCode": z.string(),
155155 "magicCardsInfoCode": z.string(),
156- "mkm_id": z.number(),
156+ "mkm_id": z.number().int(),
157157 "mkm_name": z.string(),
158158 "name": z.string(),
159159 "releaseDate": z.string(),
Test case

test/inputs/json/misc/dd1ce.json

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -117,7 +117,7 @@ export type Ruling = z.infer<typeof RulingSchema>;
117117
118118 export const CardSchema = z.object({
119119 "artist": z.string(),
120- "cmc": z.number(),
120+ "cmc": z.number().int(),
121121 "colorIdentity": z.array(ColorIdentitySchema).optional(),
122122 "colors": z.array(ColorSchema).optional(),
123123 "flavor": z.string().optional(),
@@ -127,7 +127,7 @@ export const CardSchema = z.object({
127127 "legalities": z.array(LegalityElementSchema),
128128 "manaCost": z.string().optional(),
129129 "mciNumber": z.string().optional(),
130- "multiverseid": z.number(),
130+ "multiverseid": z.number().int(),
131131 "name": z.string(),
132132 "originalText": z.string().optional(),
133133 "originalType": z.string(),
@@ -142,7 +142,7 @@ export const CardSchema = z.object({
142142 "toughness": z.string().optional(),
143143 "type": z.string(),
144144 "types": z.array(TypeSchema),
145- "variations": z.array(z.number()).optional(),
145+ "variations": z.array(z.number().int()).optional(),
146146 });
147147 export type Card = z.infer<typeof CardSchema>;
148148
@@ -153,7 +153,7 @@ export const TopLevelSchema = z.object({
153153 "code": z.string(),
154154 "gathererCode": z.string(),
155155 "magicCardsInfoCode": z.string(),
156- "mkm_id": z.number(),
156+ "mkm_id": z.number().int(),
157157 "mkm_name": z.string(),
158158 "name": z.string(),
159159 "releaseDate": z.string(),
Test case

test/inputs/json/misc/dec3a.json

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -3,14 +3,14 @@ import * as z from "zod";
33
44 export const ResponseInfoSchema = z.object({
55 "developerMessage": z.string(),
6- "status": z.number(),
6+ "status": z.number().int(),
77 });
88 export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
99
1010 export const ResultsetSchema = z.object({
11- "count": z.number(),
12- "page": z.number(),
13- "pagesize": z.number(),
11+ "count": z.number().int(),
12+ "page": z.number().int(),
13+ "pagesize": z.number().int(),
1414 });
1515 export type Resultset = z.infer<typeof ResultsetSchema>;
Test case

test/inputs/json/misc/df957.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -105,7 +105,7 @@ export const ResultsSchema = z.object({
105105 export type Results = z.infer<typeof ResultsSchema>;
106106
107107 export const QuerySchema = z.object({
108- "count": z.number(),
108+ "count": z.number().int(),
109109 "created": z.coerce.date(),
110110 "lang": z.string(),
111111 "results": ResultsSchema,
Test case

test/inputs/json/misc/e0ac7.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -63,14 +63,14 @@ export type User = z.infer<typeof UserSchema>;
6363 export const MetaSchema = z.object({
6464 "msg": z.string(),
6565 "response_id": z.string(),
66- "status": z.number(),
66+ "status": z.number().int(),
6767 });
6868 export type Meta = z.infer<typeof MetaSchema>;
6969
7070 export const PaginationSchema = z.object({
71- "count": z.number(),
72- "offset": z.number(),
73- "total_count": z.number(),
71+ "count": z.number().int(),
72+ "offset": z.number().int(),
73+ "total_count": z.number().int(),
7474 });
7575 export type Pagination = z.infer<typeof PaginationSchema>;
7676
@@ -109,7 +109,7 @@ export const DatumSchema = z.object({
109109 "id": z.string(),
110110 "images": ImagesSchema,
111111 "import_datetime": z.string(),
112- "is_indexable": z.number(),
112+ "is_indexable": z.number().int(),
113113 "rating": RatingSchema,
114114 "slug": z.string(),
115115 "source": z.string(),
Test case

test/inputs/json/misc/e2915.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -110,7 +110,7 @@ export const ResultsSchema = z.object({
110110 export type Results = z.infer<typeof ResultsSchema>;
111111
112112 export const QuerySchema = z.object({
113- "count": z.number(),
113+ "count": z.number().int(),
114114 "created": z.coerce.date(),
115115 "lang": z.string(),
116116 "results": ResultsSchema,
Test case

test/inputs/json/misc/e8a0b.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/e8b04.json

1 generated file · +20 −20
Mtypescript-zoddefault / TopLevel.ts+20 −20
@@ -159,7 +159,7 @@ export const SelectSchema = z.object({
159159 export type Select = z.infer<typeof SelectSchema>;
160160
161161 export const TableColumnIdSchema = z.object({
162- "2819740": z.number(),
162+ "2819740": z.number().int(),
163163 });
164164 export type TableColumnId = z.infer<typeof TableColumnIdSchema>;
165165
@@ -170,7 +170,7 @@ export const PurpleVisibleSchema = z.object({
170170 export type PurpleVisible = z.infer<typeof PurpleVisibleSchema>;
171171
172172 export const FieldSchema = z.object({
173- "tableColumnId": z.number(),
173+ "tableColumnId": z.number().int(),
174174 "type": FieldTypeSchema,
175175 });
176176 export type Field = z.infer<typeof FieldSchema>;
@@ -194,7 +194,7 @@ export const OwnerSchema = z.object({
194194 "displayName": z.string(),
195195 "flags": z.array(z.string()).optional(),
196196 "id": z.string(),
197- "lastNotificationSeenAt": z.number().optional(),
197+ "lastNotificationSeenAt": z.number().int().optional(),
198198 "profileImageUrlLarge": z.string().optional(),
199199 "profileImageUrlMedium": z.string().optional(),
200200 "profileImageUrlSmall": z.string().optional(),
@@ -205,7 +205,7 @@ export const OwnerSchema = z.object({
205205 export type Owner = z.infer<typeof OwnerSchema>;
206206
207207 export const RatingsSchema = z.object({
208- "rating": z.number(),
208+ "rating": z.number().int(),
209209 });
210210 export type Ratings = z.infer<typeof RatingsSchema>;
211211
@@ -226,10 +226,10 @@ export type CustomFields = z.infer<typeof CustomFieldsSchema>;
226226 export const ChildMetadataSchema = z.object({
227227 "customValues": z.array(z.string()).optional(),
228228 "freeform": z.boolean().optional(),
229- "includeAuto": z.number().optional(),
229+ "includeAuto": z.number().int().optional(),
230230 "operator": MetadataOperatorSchema.optional(),
231231 "tableColumnId": TableColumnIdSchema.optional(),
232- "unifiedVersion": z.number().optional(),
232+ "unifiedVersion": z.number().int().optional(),
233233 });
234234 export type ChildMetadata = z.infer<typeof ChildMetadataSchema>;
235235
@@ -311,45 +311,45 @@ export const TopLevelMetadataSchema = z.object({
311311 export type TopLevelMetadata = z.infer<typeof TopLevelMetadataSchema>;
312312
313313 export const TopLevelElementSchema = z.object({
314- "averageRating": z.number(),
314+ "averageRating": z.number().int(),
315315 "category": z.string().optional(),
316- "createdAt": z.number(),
316+ "createdAt": z.number().int(),
317317 "description": z.string().optional(),
318318 "displayType": DisplayTypeSchema.optional(),
319- "downloadCount": z.number(),
319+ "downloadCount": z.number().int(),
320320 "flags": z.array(TopLevelFlagSchema).optional(),
321321 "grants": z.array(GrantSchema),
322322 "hideFromCatalog": z.boolean(),
323323 "hideFromDataJson": z.boolean(),
324324 "id": z.string(),
325- "indexUpdatedAt": z.number().optional(),
325+ "indexUpdatedAt": z.number().int().optional(),
326326 "locale": z.string(),
327327 "metadata": TopLevelMetadataSchema,
328328 "moderationStatus": z.boolean().optional(),
329329 "modifyingViewUid": ModifyingViewUidSchema.optional(),
330330 "name": z.string(),
331331 "newBackend": z.boolean(),
332- "numberOfComments": z.number(),
333- "oid": z.number(),
332+ "numberOfComments": z.number().int(),
333+ "oid": z.number().int(),
334334 "owner": OwnerSchema,
335335 "provenance": ProvenanceSchema,
336336 "publicationAppendEnabled": z.boolean(),
337- "publicationDate": z.number().optional(),
338- "publicationGroup": z.number(),
337+ "publicationDate": z.number().int().optional(),
338+ "publicationGroup": z.number().int(),
339339 "publicationStage": PublicationStageSchema,
340340 "ratings": RatingsSchema.optional(),
341341 "resourceName": z.string().optional(),
342342 "rights": z.array(RightSchema),
343343 "rowClass": z.string().optional(),
344- "rowIdentifierColumnId": z.number().optional(),
345- "rowsUpdatedAt": z.number().optional(),
344+ "rowIdentifierColumnId": z.number().int().optional(),
345+ "rowsUpdatedAt": z.number().int().optional(),
346346 "rowsUpdatedBy": RowsUpdatedBySchema.optional(),
347347 "tableAuthor": TableAuthorSchema,
348- "tableId": z.number(),
348+ "tableId": z.number().int(),
349349 "tags": z.array(z.string()).optional(),
350- "totalTimesRated": z.number(),
351- "viewCount": z.number(),
352- "viewLastModified": z.number(),
350+ "totalTimesRated": z.number().int(),
351+ "viewCount": z.number().int(),
352+ "viewLastModified": z.number().int(),
353353 "viewType": ViewTypeSchema,
354354 });
355355 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/f3edf.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/f466a.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -7,12 +7,12 @@ export const CountrySchema = z.enum([
77 export type Country = z.infer<typeof CountrySchema>;
88
99 export const TopLevelElementSchema = z.object({
10- "age": z.number(),
10+ "age": z.number().int(),
1111 "country": CountrySchema,
12- "females": z.number(),
13- "males": z.number(),
14- "total": z.number(),
15- "year": z.number(),
12+ "females": z.number().int(),
13+ "males": z.number().int(),
14+ "total": z.number().int(),
15+ "year": z.number().int(),
1616 });
1717 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/misc/f6a65.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -73,14 +73,14 @@ export type User = z.infer<typeof UserSchema>;
7373 export const MetaSchema = z.object({
7474 "msg": z.string(),
7575 "response_id": z.string(),
76- "status": z.number(),
76+ "status": z.number().int(),
7777 });
7878 export type Meta = z.infer<typeof MetaSchema>;
7979
8080 export const PaginationSchema = z.object({
81- "count": z.number(),
82- "offset": z.number(),
83- "total_count": z.number(),
81+ "count": z.number().int(),
82+ "offset": z.number().int(),
83+ "total_count": z.number().int(),
8484 });
8585 export type Pagination = z.infer<typeof PaginationSchema>;
8686
@@ -119,7 +119,7 @@ export const DatumSchema = z.object({
119119 "id": z.string(),
120120 "images": ImagesSchema,
121121 "import_datetime": z.string(),
122- "is_indexable": z.number(),
122+ "is_indexable": z.number().int(),
123123 "rating": RatingSchema,
124124 "slug": z.string(),
125125 "source": z.string(),
Test case

test/inputs/json/misc/f74d5.json

1 generated file · +21 −21
Mtypescript-zoddefault / TopLevel.ts+21 −21
@@ -9,7 +9,7 @@ export const TypeNameSchema = z.enum([
99 export type TypeName = z.infer<typeof TypeNameSchema>;
1010
1111 export const TopSchema = z.object({
12- "count": z.number(),
12+ "count": z.number().int(),
1313 "item": z.string(),
1414 });
1515 export type Top = z.infer<typeof TopSchema>;
@@ -45,8 +45,8 @@ export type Owner = z.infer<typeof OwnerSchema>;
4545 export const CachedContentsSchema = z.object({
4646 "average": z.string().optional(),
4747 "largest": z.string(),
48- "non_null": z.number(),
49- "null": z.number(),
48+ "non_null": z.number().int(),
49+ "null": z.number().int(),
5050 "smallest": z.string(),
5151 "sum": z.string().optional(),
5252 "top": z.array(TopSchema),
@@ -64,12 +64,12 @@ export const ColumnSchema = z.object({
6464 "fieldName": z.string(),
6565 "flags": z.array(z.string()).optional(),
6666 "format": QuerySchema,
67- "id": z.number(),
67+ "id": z.number().int(),
6868 "name": z.string(),
69- "position": z.number(),
69+ "position": z.number().int(),
7070 "renderTypeName": TypeNameSchema,
71- "tableColumnId": z.number().optional(),
72- "width": z.number().optional(),
71+ "tableColumnId": z.number().int().optional(),
72+ "width": z.number().int().optional(),
7373 });
7474 export type Column = z.infer<typeof ColumnSchema>;
7575
@@ -83,42 +83,42 @@ export const MetadataSchema = z.object({
8383 export type Metadata = z.infer<typeof MetadataSchema>;
8484
8585 export const ViewSchema = z.object({
86- "averageRating": z.number(),
86+ "averageRating": z.number().int(),
8787 "category": z.string(),
8888 "columns": z.array(ColumnSchema),
89- "createdAt": z.number(),
89+ "createdAt": z.number().int(),
9090 "displayType": z.string(),
91- "downloadCount": z.number(),
91+ "downloadCount": z.number().int(),
9292 "flags": z.array(z.string()),
9393 "grants": z.array(GrantSchema),
9494 "hideFromCatalog": z.boolean(),
9595 "hideFromDataJson": z.boolean(),
9696 "id": z.string(),
97- "indexUpdatedAt": z.number(),
97+ "indexUpdatedAt": z.number().int(),
9898 "license": LicenseSchema,
9999 "licenseId": z.string(),
100100 "locale": z.string(),
101101 "metadata": MetadataSchema,
102102 "name": z.string(),
103103 "newBackend": z.boolean(),
104- "numberOfComments": z.number(),
105- "oid": z.number(),
104+ "numberOfComments": z.number().int(),
105+ "oid": z.number().int(),
106106 "owner": OwnerSchema,
107107 "provenance": z.string(),
108108 "publicationAppendEnabled": z.boolean(),
109- "publicationDate": z.number(),
110- "publicationGroup": z.number(),
109+ "publicationDate": z.number().int(),
110+ "publicationGroup": z.number().int(),
111111 "publicationStage": z.string(),
112112 "query": QuerySchema,
113113 "rights": z.array(z.string()),
114114 "rowClass": z.string(),
115- "rowsUpdatedAt": z.number(),
115+ "rowsUpdatedAt": z.number().int(),
116116 "rowsUpdatedBy": z.string(),
117117 "tableAuthor": OwnerSchema,
118- "tableId": z.number(),
119- "totalTimesRated": z.number(),
120- "viewCount": z.number(),
121- "viewLastModified": z.number(),
118+ "tableId": z.number().int(),
119+ "totalTimesRated": z.number().int(),
120+ "viewCount": z.number().int(),
121+ "viewLastModified": z.number().int(),
122122 "viewType": z.string(),
123123 });
124124 export type View = z.infer<typeof ViewSchema>;
@@ -129,7 +129,7 @@ export const MetaSchema = z.object({
129129 export type Meta = z.infer<typeof MetaSchema>;
130130
131131 export const TopLevelSchema = z.object({
132- "data": z.array(z.array(z.union([z.number(), z.string()]))),
132+ "data": z.array(z.array(z.union([z.number().int(), z.string()]))),
133133 "meta": MetaSchema,
134134 });
135135 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/f974d.json

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -2,10 +2,10 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "block_index": z.number(),
5+ "block_index": z.number().int(),
66 "hash": z.string(),
7- "height": z.number(),
8- "time": z.number(),
9- "txIndexes": z.array(z.number()),
7+ "height": z.number().int(),
8+ "time": z.number().int(),
9+ "txIndexes": z.array(z.number().int()),
1010 });
1111 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/faff5.json

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -2,8 +2,8 @@ import * as z from "zod";
22
33
44 export const ResponseSchema = z.object({
5- "player_count": z.number(),
6- "result": z.number(),
5+ "player_count": z.number().int(),
6+ "result": z.number().int(),
77 });
88 export type Response = z.infer<typeof ResponseSchema>;
Test case

test/inputs/json/misc/fcca3.json

1 generated file · +24 −24
Mtypescript-zoddefault / TopLevel.ts+24 −24
@@ -9,7 +9,7 @@ export const TypeNameSchema = z.enum([
99 export type TypeName = z.infer<typeof TypeNameSchema>;
1010
1111 export const TopSchema = z.object({
12- "count": z.number(),
12+ "count": z.number().int(),
1313 "item": z.string(),
1414 });
1515 export type Top = z.infer<typeof TopSchema>;
@@ -65,13 +65,13 @@ export const DisclaimersSchema = z.object({
6565 export type Disclaimers = z.infer<typeof DisclaimersSchema>;
6666
6767 export const TableColumnIdSchema = z.object({
68- "703610": z.number(),
68+ "703610": z.number().int(),
6969 });
7070 export type TableColumnId = z.infer<typeof TableColumnIdSchema>;
7171
7272 export const FilterConditionMetadataSchema = z.object({
7373 "advanced": z.boolean(),
74- "unifiedVersion": z.number(),
74+ "unifiedVersion": z.number().int(),
7575 });
7676 export type FilterConditionMetadata = z.infer<typeof FilterConditionMetadataSchema>;
7777
@@ -99,7 +99,7 @@ export const OwnerSchema = z.object({
9999 export type Owner = z.infer<typeof OwnerSchema>;
100100
101101 export const ExpressionSchema = z.object({
102- "columnId": z.number(),
102+ "columnId": z.number().int(),
103103 "type": z.string(),
104104 });
105105 export type Expression = z.infer<typeof ExpressionSchema>;
@@ -107,8 +107,8 @@ export type Expression = z.infer<typeof ExpressionSchema>;
107107 export const CachedContentsSchema = z.object({
108108 "average": z.string().optional(),
109109 "largest": z.string(),
110- "non_null": z.number(),
111- "null": z.number(),
110+ "non_null": z.number().int(),
111+ "null": z.number().int(),
112112 "smallest": z.string(),
113113 "sum": z.string().optional(),
114114 "top": z.array(TopSchema),
@@ -153,12 +153,12 @@ export const ColumnSchema = z.object({
153153 "fieldName": z.string(),
154154 "flags": z.array(z.string()).optional(),
155155 "format": FormatSchema,
156- "id": z.number(),
156+ "id": z.number().int(),
157157 "name": z.string(),
158- "position": z.number(),
158+ "position": z.number().int(),
159159 "renderTypeName": TypeNameSchema,
160- "tableColumnId": z.number().optional(),
161- "width": z.number().optional(),
160+ "tableColumnId": z.number().int().optional(),
161+ "width": z.number().int().optional(),
162162 });
163163 export type Column = z.infer<typeof ColumnSchema>;
164164
@@ -196,41 +196,41 @@ export type ViewMetadata = z.infer<typeof ViewMetadataSchema>;
196196
197197 export const ViewSchema = z.object({
198198 "attribution": z.string(),
199- "averageRating": z.number(),
199+ "averageRating": z.number().int(),
200200 "category": z.string(),
201201 "columns": z.array(ColumnSchema),
202- "createdAt": z.number(),
202+ "createdAt": z.number().int(),
203203 "description": z.string(),
204204 "displayType": z.string(),
205- "downloadCount": z.number(),
205+ "downloadCount": z.number().int(),
206206 "flags": z.array(z.string()),
207207 "grants": z.array(GrantSchema),
208208 "hideFromCatalog": z.boolean(),
209209 "hideFromDataJson": z.boolean(),
210210 "id": z.string(),
211- "indexUpdatedAt": z.number(),
211+ "indexUpdatedAt": z.number().int(),
212212 "locale": z.string(),
213213 "metadata": ViewMetadataSchema,
214214 "name": z.string(),
215215 "newBackend": z.boolean(),
216- "numberOfComments": z.number(),
217- "oid": z.number(),
216+ "numberOfComments": z.number().int(),
217+ "oid": z.number().int(),
218218 "owner": OwnerSchema,
219219 "provenance": z.string(),
220220 "publicationAppendEnabled": z.boolean(),
221- "publicationDate": z.number(),
222- "publicationGroup": z.number(),
221+ "publicationDate": z.number().int(),
222+ "publicationGroup": z.number().int(),
223223 "publicationStage": z.string(),
224224 "query": QuerySchema,
225225 "rights": z.array(z.string()),
226- "rowsUpdatedAt": z.number(),
226+ "rowsUpdatedAt": z.number().int(),
227227 "rowsUpdatedBy": z.string(),
228228 "tableAuthor": OwnerSchema,
229- "tableId": z.number(),
229+ "tableId": z.number().int(),
230230 "tags": z.array(z.string()),
231- "totalTimesRated": z.number(),
232- "viewCount": z.number(),
233- "viewLastModified": z.number(),
231+ "totalTimesRated": z.number().int(),
232+ "viewCount": z.number().int(),
233+ "viewLastModified": z.number().int(),
234234 "viewType": z.string(),
235235 });
236236 export type View = z.infer<typeof ViewSchema>;
@@ -241,7 +241,7 @@ export const MetaSchema = z.object({
241241 export type Meta = z.infer<typeof MetaSchema>;
242242
243243 export const TopLevelSchema = z.object({
244- "data": z.array(z.array(z.union([z.null(), z.number(), z.string()]))),
244+ "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))),
245245 "meta": MetaSchema,
246246 });
247247 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/misc/fd329.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -9,7 +9,7 @@ export type Datum = z.infer<typeof DatumSchema>;
99
1010 export const DescriptionSchema = z.object({
1111 "base_period": z.string(),
12- "missing": z.number(),
12+ "missing": z.number().int(),
1313 "title": z.string(),
1414 "units": z.string(),
1515 });
Test case

test/inputs/json/priority/bug790.json

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -14,12 +14,12 @@ export type TopLevel = {
1414 export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() =>
1515 z.object({
1616 "children_data": z.array(TopLevelSchema),
17- "id": z.number(),
17+ "id": z.number().int(),
1818 "is_active": z.boolean(),
19- "level": z.number(),
19+ "level": z.number().int(),
2020 "name": z.string(),
21- "parent_id": z.number(),
22- "position": z.number(),
23- "product_count": z.number(),
21+ "parent_id": z.number().int(),
22+ "position": z.number().int(),
23+ "product_count": z.number().int(),
2424 })
2525 );
Test case

test/inputs/json/priority/bug863.json

1 generated file · +35 −35
Mtypescript-zoddefault / TopLevel.ts+35 −35
@@ -47,62 +47,62 @@ export const SexSchema = z.enum([
4747 export type Sex = z.infer<typeof SexSchema>;
4848
4949 export const PurpleTopLevelSchema = z.object({
50- "ALIENLEVEL": z.number(),
50+ "ALIENLEVEL": z.number().int(),
5151 "BREED": BreedSchema,
52- "CHAR_DIMENSION": z.number(),
53- "CHAR_INSTANCE": z.number(),
52+ "CHAR_DIMENSION": z.number().int(),
53+ "CHAR_INSTANCE": z.number().int(),
5454 "DEFENDER_RANK_TITLE": z.string(),
5555 "FIRSTNAME": FirstnameSchema,
56- "HEADID": z.number(),
56+ "HEADID": z.number().int(),
5757 "LASTNAME": LastnameSchema,
58- "LEVELX": z.number(),
58+ "LEVELX": z.number().int(),
5959 "NAME": z.string(),
6060 "PROF": z.string(),
6161 "PROF_TITLE": z.string(),
62- "PVPRATING": z.number(),
62+ "PVPRATING": z.number().int(),
6363 "PVPTITLE": PvptitleSchema,
64- "RANK": z.number(),
64+ "RANK": z.number().int(),
6565 "RANK_TITLE": RankTitleSchema,
6666 "SEX": SexSchema,
6767 });
6868 export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>;
6969
7070 export const FluffyTopLevelSchema = z.object({
71- "ADVENTURERCOUNT": z.number(),
72- "AGENTCOUNT": z.number(),
73- "ATROXCOUNT": z.number(),
71+ "ADVENTURERCOUNT": z.number().int(),
72+ "AGENTCOUNT": z.number().int(),
73+ "ATROXCOUNT": z.number().int(),
7474 "AVGLVL": z.number(),
75- "BTCOUNT": z.number(),
75+ "BTCOUNT": z.number().int(),
7676 "DESCRIPTION": z.string(),
77- "DOCTORCOUNT": z.number(),
78- "ENFCOUNT": z.number(),
79- "ENGINEEERCOUNT": z.number(),
80- "FEMALECOUNT": z.number(),
81- "FIXERCOUNT": z.number(),
77+ "DOCTORCOUNT": z.number().int(),
78+ "ENFCOUNT": z.number().int(),
79+ "ENGINEEERCOUNT": z.number().int(),
80+ "FEMALECOUNT": z.number().int(),
81+ "FIXERCOUNT": z.number().int(),
8282 "GOVERNINGNAME": z.string(),
8383 "HISTORY": z.string(),
84- "KEEPERCOUNT": z.number(),
85- "MACOUNT": z.number(),
86- "MALECOUNT": z.number(),
87- "MAXLVL": z.number(),
88- "METACOUNT": z.number(),
89- "MINLVL": z.number(),
90- "MONSTERCOUNT": z.number(),
84+ "KEEPERCOUNT": z.number().int(),
85+ "MACOUNT": z.number().int(),
86+ "MALECOUNT": z.number().int(),
87+ "MAXLVL": z.number().int(),
88+ "METACOUNT": z.number().int(),
89+ "MINLVL": z.number().int(),
90+ "MONSTERCOUNT": z.number().int(),
9191 "NAME": z.string(),
92- "NANOCOUNT": z.number(),
93- "NANORACECOUNT": z.number(),
94- "NEUTERCOUNT": z.number(),
95- "NUMMEMBERS": z.number(),
92+ "NANOCOUNT": z.number().int(),
93+ "NANORACECOUNT": z.number().int(),
94+ "NEUTERCOUNT": z.number().int(),
95+ "NUMMEMBERS": z.number().int(),
9696 "OBJECTIVE": z.string(),
97- "OPIFEXCOUNT": z.number(),
98- "ORG_DIMENSION": z.number(),
99- "ORG_INSTANCE": z.number(),
100- "SHADECOUNT": z.number(),
101- "SIDE": z.number(),
97+ "OPIFEXCOUNT": z.number().int(),
98+ "ORG_DIMENSION": z.number().int(),
99+ "ORG_INSTANCE": z.number().int(),
100+ "SHADECOUNT": z.number().int(),
101+ "SIDE": z.number().int(),
102102 "SIDE_NAME": z.string(),
103- "SOLIDERCOUNT": z.number(),
104- "SOLITUSCOUNT": z.number(),
105- "TRADERCOUNT": z.number(),
103+ "SOLIDERCOUNT": z.number().int(),
104+ "SOLITUSCOUNT": z.number().int(),
105+ "TRADERCOUNT": z.number().int(),
106106 });
107107 export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>;
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -2,11 +2,11 @@ import * as z from "zod";
22
33
44 export const PairSchema = z.object({
5- "decimal_places": z.number(),
5+ "decimal_places": z.number().int(),
66 "fee": z.number(),
7- "hidden": z.number(),
8- "max_amount": z.number(),
9- "max_price": z.number(),
7+ "hidden": z.number().int(),
8+ "max_amount": z.number().int(),
9+ "max_price": z.number().int(),
1010 "min_amount": z.number(),
1111 "min_price": z.number(),
1212 "min_total": z.number(),
@@ -15,6 +15,6 @@ export type Pair = z.infer<typeof PairSchema>;
1515
1616 export const TopLevelSchema = z.object({
1717 "pairs": z.record(z.string(), PairSchema),
18- "server_time": z.number(),
18+ "server_time": z.number().int(),
1919 });
2020 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/combinations1.json

1 generated file · +29 −29
Mtypescript-zoddefault / TopLevel.ts+29 −29
@@ -32,7 +32,7 @@ export const ChemotherapeuticClassSchema = z.object({
3232 "catharticalness": z.number().optional(),
3333 "caulis": z.null().optional(),
3434 "chalcus": z.null().optional(),
35- "Chirotherium": z.number().optional(),
35+ "Chirotherium": z.number().int().optional(),
3636 "disdiapason": z.string().optional(),
3737 "enteradenological": z.null().optional(),
3838 "homocerc": z.boolean().optional(),
@@ -56,7 +56,7 @@ export type ChemotherapeuticClass = z.infer<typeof ChemotherapeuticClassSchema>;
5656
5757 export const CimeliaClassSchema = z.object({
5858 "catharticalness": z.number(),
59- "Chirotherium": z.number(),
59+ "Chirotherium": z.number().int(),
6060 "disdiapason": z.string(),
6161 "homocerc": z.boolean(),
6262 "nonbookish": z.null(),
@@ -67,7 +67,7 @@ export const CoadjustClassSchema = z.object({
6767 "amidosulphonal": z.null().optional(),
6868 "Benny": z.null().optional(),
6969 "catharticalness": z.number().optional(),
70- "Chirotherium": z.number().optional(),
70+ "Chirotherium": z.number().int().optional(),
7171 "disdiapason": z.string().optional(),
7272 "ensnare": z.null().optional(),
7373 "homocerc": z.boolean().optional(),
@@ -266,7 +266,7 @@ export const HemocoeleClassSchema = z.object({
266266 "autobiographic": z.null().optional(),
267267 "berat": z.null().optional(),
268268 "catharticalness": z.number().optional(),
269- "Chirotherium": z.number().optional(),
269+ "Chirotherium": z.number().int().optional(),
270270 "disdiapason": z.string().optional(),
271271 "disproportionably": z.null().optional(),
272272 "erythrite": z.null().optional(),
@@ -293,7 +293,7 @@ export const InteracinarSchema = z.object({
293293 "assapan": z.number(),
294294 "benefactorship": z.boolean(),
295295 "triseriatim": z.string(),
296- "tubbing": z.number(),
296+ "tubbing": z.number().int(),
297297 "untrimmed": z.null(),
298298 });
299299 export type Interacinar = z.infer<typeof InteracinarSchema>;
@@ -301,46 +301,46 @@ export type Interacinar = z.infer<typeof InteracinarSchema>;
301301 export const TopLevelSchema = z.object({
302302 "centrodesmose": z.string(),
303303 "cerograph": z.array(z.union([z.null(), CerographClassSchema, z.string()])),
304- "chemotherapeutics": z.array(z.union([ChemotherapeuticClassSchema, z.number()])),
305- "cimelia": z.array(z.union([z.null(), z.array(z.number()), CimeliaClassSchema])),
306- "citrated": z.number(),
304+ "chemotherapeutics": z.array(z.union([ChemotherapeuticClassSchema, z.number().int()])),
305+ "cimelia": z.array(z.union([z.null(), z.array(z.number().int()), CimeliaClassSchema])),
306+ "citrated": z.number().int(),
307307 "clinodome": z.array(z.union([z.number(), z.string()])),
308308 "coadjust": z.array(z.union([CoadjustClassSchema, z.number()])),
309- "consilience": z.array(z.union([z.number(), z.record(z.string(), z.number())])),
310- "constructor": z.array(z.union([z.boolean(), z.record(z.string(), z.union([z.null(), z.number()]))])),
311- "continuative": z.array(z.union([z.record(z.string(), z.number()), z.string()])),
312- "credulity": z.array(z.union([CredulityClassSchema, z.number(), z.string()])),
313- "creviced": z.array(z.union([z.boolean(), z.record(z.string(), z.number()), z.string()])),
314- "cubiculum": z.array(z.array(z.union([z.null(), z.number()]))),
309+ "consilience": z.array(z.union([z.number(), z.record(z.string(), z.number().int())])),
310+ "constructor": z.array(z.union([z.boolean(), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
311+ "continuative": z.array(z.union([z.record(z.string(), z.number().int()), z.string()])),
312+ "credulity": z.array(z.union([CredulityClassSchema, z.number().int(), z.string()])),
313+ "creviced": z.array(z.union([z.boolean(), z.record(z.string(), z.number().int()), z.string()])),
314+ "cubiculum": z.array(z.array(z.union([z.null(), z.number().int()]))),
315315 "deruralize": z.array(z.union([z.array(z.null()), z.boolean(), DeruralizeClassSchema])),
316- "diaereses": z.array(z.union([z.array(z.number()), z.boolean(), DiaereseClassSchema])),
316+ "diaereses": z.array(z.union([z.array(z.number().int()), z.boolean(), DiaereseClassSchema])),
317317 "dissolution": z.array(z.union([z.null(), z.array(z.null())])),
318318 "downstroke": z.array(z.union([z.array(z.null()), z.boolean(), z.string()])),
319319 "electrotautomerism": z.array(z.union([z.null(), z.number()])),
320- "eleutheromania": z.array(z.union([z.number(), z.record(z.string(), z.number()), z.string()])),
320+ "eleutheromania": z.array(z.union([z.number(), z.record(z.string(), z.number().int()), z.string()])),
321321 "encrust": EncrustSchema,
322- "entomoid": z.array(z.union([CimeliaClassSchema, z.number()])),
323- "epipaleolithic": z.array(z.union([z.array(z.number()), z.number()])),
322+ "entomoid": z.array(z.union([CimeliaClassSchema, z.number().int()])),
323+ "epipaleolithic": z.array(z.union([z.array(z.number().int()), z.number()])),
324324 "expropriable": z.array(z.union([z.array(z.null()), CimeliaClassSchema, z.number()])),
325325 "faggingly": z.array(z.union([FagginglyClassSchema, z.number()])),
326326 "fenks": z.array(z.union([FenkClassSchema, z.string()])),
327327 "flagmaking": z.array(z.union([z.boolean(), FlagmakingClassSchema, z.number()])),
328- "fluorometer": z.array(z.union([z.null(), z.number(), z.string()])),
329- "fulsome": z.array(z.union([z.null(), z.number()])),
330- "fuzzy": z.array(z.union([z.number(), z.record(z.string(), z.union([z.null(), z.number()]))])),
331- "gardenwards": z.array(z.union([z.array(z.number()), z.boolean(), z.string()])),
332- "generalissimo": z.array(z.union([z.null(), z.boolean(), z.record(z.string(), z.number())])),
333- "habeas": z.array(z.union([z.null(), z.record(z.string(), z.number())])),
328+ "fluorometer": z.array(z.union([z.null(), z.number().int(), z.string()])),
329+ "fulsome": z.array(z.union([z.null(), z.number().int()])),
330+ "fuzzy": z.array(z.union([z.number().int(), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
331+ "gardenwards": z.array(z.union([z.array(z.number().int()), z.boolean(), z.string()])),
332+ "generalissimo": z.array(z.union([z.null(), z.boolean(), z.record(z.string(), z.number().int())])),
333+ "habeas": z.array(z.union([z.null(), z.record(z.string(), z.number().int())])),
334334 "hemicrystalline": z.array(z.union([CimeliaClassSchema, z.string()])),
335- "hemocoele": z.array(z.union([z.array(z.number()), HemocoeleClassSchema])),
335+ "hemocoele": z.array(z.union([z.array(z.number().int()), HemocoeleClassSchema])),
336336 "hoister": z.array(z.union([z.null(), CimeliaClassSchema, z.string()])),
337337 "hyperpiesis": z.array(z.union([z.null(), z.array(z.null()), CimeliaClassSchema])),
338338 "hyppish": z.array(z.union([z.null(), z.boolean(), z.string()])),
339- "idealizer": z.array(z.union([z.array(z.null()), CimeliaClassSchema, z.number()])),
340- "incrustator": z.array(z.union([z.array(z.number()), z.number(), z.string()])),
339+ "idealizer": z.array(z.union([z.array(z.null()), CimeliaClassSchema, z.number().int()])),
340+ "incrustator": z.array(z.union([z.array(z.number().int()), z.number().int(), z.string()])),
341341 "intentiveness": z.array(z.union([CimeliaClassSchema, z.number(), z.string()])),
342342 "interacinar": InteracinarSchema,
343- "intercorrelation": z.array(z.union([z.null(), z.array(z.number())])),
344- "jacutinga": z.array(z.union([z.array(z.number()), z.record(z.string(), z.union([z.null(), z.number()]))])),
343+ "intercorrelation": z.array(z.union([z.null(), z.array(z.number().int())])),
344+ "jacutinga": z.array(z.union([z.array(z.number().int()), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
345345 });
346346 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/combinations2.json

1 generated file · +93 −93
Mtypescript-zoddefault / TopLevel.ts+93 −93
@@ -27,7 +27,7 @@ export type AlleviateClass = z.infer<typeof AlleviateClassSchema>;
2727
2828 export const RebeccaSchema = z.object({
2929 "catharticalness": z.number(),
30- "Chirotherium": z.number(),
30+ "Chirotherium": z.number().int(),
3131 "disdiapason": z.string(),
3232 "homocerc": z.boolean(),
3333 "nonbookish": z.null(),
@@ -35,31 +35,31 @@ export const RebeccaSchema = z.object({
3535 export type Rebecca = z.infer<typeof RebeccaSchema>;
3636
3737 export const AmphithyronSchema = z.object({
38- "akroasis": z.number().optional(),
39- "antiphonical": z.number().optional(),
40- "basebred": z.number().optional(),
38+ "akroasis": z.number().int().optional(),
39+ "antiphonical": z.number().int().optional(),
40+ "basebred": z.number().int().optional(),
4141 "catharticalness": z.number().optional(),
42- "Chirotherium": z.number().optional(),
43- "conductometric": z.number().optional(),
42+ "Chirotherium": z.number().int().optional(),
43+ "conductometric": z.number().int().optional(),
4444 "disdiapason": z.string().optional(),
45- "ensilation": z.number().optional(),
46- "eyebolt": z.number().optional(),
47- "fistulated": z.number().optional(),
48- "heteropod": z.number().optional(),
45+ "ensilation": z.number().int().optional(),
46+ "eyebolt": z.number().int().optional(),
47+ "fistulated": z.number().int().optional(),
48+ "heteropod": z.number().int().optional(),
4949 "homocerc": z.boolean().optional(),
50- "Juniperus": z.number().optional(),
51- "labyrinthically": z.number().optional(),
52- "martyrization": z.number().optional(),
53- "mispolicy": z.number().optional(),
54- "multipara": z.number().optional(),
55- "Nazirite": z.number().optional(),
50+ "Juniperus": z.number().int().optional(),
51+ "labyrinthically": z.number().int().optional(),
52+ "martyrization": z.number().int().optional(),
53+ "mispolicy": z.number().int().optional(),
54+ "multipara": z.number().int().optional(),
55+ "Nazirite": z.number().int().optional(),
5656 "nonbookish": z.null().optional(),
57- "possessorial": z.number().optional(),
58- "shamed": z.number().optional(),
59- "shelfworn": z.number().optional(),
60- "stagnum": z.number().optional(),
61- "Those": z.number().optional(),
62- "undecimal": z.number().optional(),
57+ "possessorial": z.number().int().optional(),
58+ "shamed": z.number().int().optional(),
59+ "shelfworn": z.number().int().optional(),
60+ "stagnum": z.number().int().optional(),
61+ "Those": z.number().int().optional(),
62+ "undecimal": z.number().int().optional(),
6363 });
6464 export type Amphithyron = z.infer<typeof AmphithyronSchema>;
6565
@@ -136,31 +136,31 @@ export const ChytridiaceaeClassSchema = z.object({
136136 export type ChytridiaceaeClass = z.infer<typeof ChytridiaceaeClassSchema>;
137137
138138 export const DiscordiaClassSchema = z.object({
139- "Altaic": z.number().optional(),
140- "amoristic": z.number().optional(),
141- "blennophthalmia": z.number().optional(),
139+ "Altaic": z.number().int().optional(),
140+ "amoristic": z.number().int().optional(),
141+ "blennophthalmia": z.number().int().optional(),
142142 "catharticalness": z.number().optional(),
143- "Chirotherium": z.number().optional(),
144- "disciplinability": z.number().optional(),
143+ "Chirotherium": z.number().int().optional(),
144+ "disciplinability": z.number().int().optional(),
145145 "disdiapason": z.string().optional(),
146- "goofer": z.number().optional(),
146+ "goofer": z.number().int().optional(),
147147 "homocerc": z.boolean().optional(),
148- "laryngograph": z.number().optional(),
149- "leucitis": z.number().optional(),
150- "lymphocyst": z.number().optional(),
151- "microcosmology": z.number().optional(),
152- "nauseation": z.number().optional(),
148+ "laryngograph": z.number().int().optional(),
149+ "leucitis": z.number().int().optional(),
150+ "lymphocyst": z.number().int().optional(),
151+ "microcosmology": z.number().int().optional(),
152+ "nauseation": z.number().int().optional(),
153153 "nonbookish": z.null().optional(),
154- "Patarin": z.number().optional(),
155- "preliberal": z.number().optional(),
156- "prettifier": z.number().optional(),
157- "rangework": z.number().optional(),
158- "redient": z.number().optional(),
159- "subfusiform": z.number().optional(),
160- "suicidical": z.number().optional(),
161- "swow": z.number().optional(),
162- "wastrel": z.number().optional(),
163- "wingle": z.number().optional(),
154+ "Patarin": z.number().int().optional(),
155+ "preliberal": z.number().int().optional(),
156+ "prettifier": z.number().int().optional(),
157+ "rangework": z.number().int().optional(),
158+ "redient": z.number().int().optional(),
159+ "subfusiform": z.number().int().optional(),
160+ "suicidical": z.number().int().optional(),
161+ "swow": z.number().int().optional(),
162+ "wastrel": z.number().int().optional(),
163+ "wingle": z.number().int().optional(),
164164 });
165165 export type DiscordiaClass = z.infer<typeof DiscordiaClassSchema>;
166166
@@ -189,31 +189,31 @@ export const GryphosaurusClassSchema = z.object({
189189 export type GryphosaurusClass = z.infer<typeof GryphosaurusClassSchema>;
190190
191191 export const LaviniaClassSchema = z.object({
192- "agitable": z.number().optional(),
193- "asininity": z.number().optional(),
194- "benefiter": z.number().optional(),
195- "bronzelike": z.number().optional(),
192+ "agitable": z.number().int().optional(),
193+ "asininity": z.number().int().optional(),
194+ "benefiter": z.number().int().optional(),
195+ "bronzelike": z.number().int().optional(),
196196 "catharticalness": z.number().optional(),
197- "Chirotherium": z.number().optional(),
198- "cholesteatomatous": z.number().optional(),
199- "deprivement": z.number().optional(),
197+ "Chirotherium": z.number().int().optional(),
198+ "cholesteatomatous": z.number().int().optional(),
199+ "deprivement": z.number().int().optional(),
200200 "disdiapason": z.string().optional(),
201- "flippantness": z.number().optional(),
202- "fogproof": z.number().optional(),
201+ "flippantness": z.number().int().optional(),
202+ "fogproof": z.number().int().optional(),
203203 "homocerc": z.boolean().optional(),
204- "merrymeeting": z.number().optional(),
204+ "merrymeeting": z.number().int().optional(),
205205 "nonbookish": z.null().optional(),
206- "overcareful": z.number().optional(),
207- "panaris": z.number().optional(),
208- "preacceptance": z.number().optional(),
209- "quinoxaline": z.number().optional(),
210- "sig": z.number().optional(),
211- "superconfusion": z.number().optional(),
212- "Tacana": z.number().optional(),
213- "tillotter": z.number().optional(),
214- "tranquillize": z.number().optional(),
215- "unquestionable": z.number().optional(),
216- "uproute": z.number().optional(),
206+ "overcareful": z.number().int().optional(),
207+ "panaris": z.number().int().optional(),
208+ "preacceptance": z.number().int().optional(),
209+ "quinoxaline": z.number().int().optional(),
210+ "sig": z.number().int().optional(),
211+ "superconfusion": z.number().int().optional(),
212+ "Tacana": z.number().int().optional(),
213+ "tillotter": z.number().int().optional(),
214+ "tranquillize": z.number().int().optional(),
215+ "unquestionable": z.number().int().optional(),
216+ "uproute": z.number().int().optional(),
217217 });
218218 export type LaviniaClass = z.infer<typeof LaviniaClassSchema>;
219219
@@ -242,49 +242,49 @@ export const OskarClassSchema = z.object({
242242 export type OskarClass = z.infer<typeof OskarClassSchema>;
243243
244244 export const TopLevelSchema = z.object({
245- "Abranchiata": z.array(z.union([z.null(), z.array(z.number()), z.number()])),
246- "academe": z.array(z.union([z.array(z.number()), z.number(), z.record(z.string(), z.number())])),
247- "acquirable": z.array(z.union([z.array(z.union([z.null(), z.number()])), z.record(z.string(), z.number())])),
245+ "Abranchiata": z.array(z.union([z.null(), z.array(z.number().int()), z.number().int()])),
246+ "academe": z.array(z.union([z.array(z.number().int()), z.number().int(), z.record(z.string(), z.number().int())])),
247+ "acquirable": z.array(z.union([z.array(z.union([z.null(), z.number().int()])), z.record(z.string(), z.number().int())])),
248248 "aerometry": z.array(z.union([z.boolean(), z.number()])),
249- "alexin": z.array(z.union([z.array(z.number()), z.boolean()])),
250- "alleviate": z.array(z.union([z.array(z.union([z.null(), z.number()])), AlleviateClassSchema])),
251- "amaas": z.array(z.union([z.boolean(), RebeccaSchema, z.number()])),
249+ "alexin": z.array(z.union([z.array(z.number().int()), z.boolean()])),
250+ "alleviate": z.array(z.union([z.array(z.union([z.null(), z.number().int()])), AlleviateClassSchema])),
251+ "amaas": z.array(z.union([z.boolean(), RebeccaSchema, z.number().int()])),
252252 "ambassage": z.array(z.union([z.array(z.null()), z.string()])),
253253 "amphithyron": z.array(z.union([z.null(), AmphithyronSchema])),
254254 "Andriana": z.array(z.union([z.null(), z.string()])),
255- "ankee": z.array(z.union([z.array(z.number()), AnkeeClassSchema, z.number()])),
256- "annihilator": z.array(z.union([z.null(), z.record(z.string(), z.union([z.null(), z.number()]))])),
255+ "ankee": z.array(z.union([z.array(z.number().int()), AnkeeClassSchema, z.number().int()])),
256+ "annihilator": z.array(z.union([z.null(), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
257257 "annulose": z.null(),
258- "Ansarie": z.array(z.union([z.null(), z.array(z.number()), AnsarieClassSchema])),
259- "aphasia": z.array(z.union([z.array(z.number()), z.number()])),
258+ "Ansarie": z.array(z.union([z.null(), z.array(z.number().int()), AnsarieClassSchema])),
259+ "aphasia": z.array(z.union([z.array(z.number().int()), z.number().int()])),
260260 "asprawl": z.array(z.union([z.number(), z.string()])),
261261 "attractive": z.array(z.union([z.null(), z.boolean()])),
262- "barksome": z.record(z.string(), z.number()),
262+ "barksome": z.record(z.string(), z.number().int()),
263263 "bedesman": z.array(z.union([z.boolean(), z.number(), z.string()])),
264- "belard": z.array(z.union([z.array(z.number()), RebeccaSchema, z.number()])),
265- "bocking": z.array(z.union([z.array(z.number()), z.boolean(), z.record(z.string(), z.number())])),
266- "brawlingly": z.array(z.union([z.array(z.null()), z.record(z.string(), z.union([z.null(), z.number()]))])),
267- "brookie": z.array(z.union([z.array(z.number()), RebeccaSchema])),
264+ "belard": z.array(z.union([z.array(z.number().int()), RebeccaSchema, z.number()])),
265+ "bocking": z.array(z.union([z.array(z.number().int()), z.boolean(), z.record(z.string(), z.number().int())])),
266+ "brawlingly": z.array(z.union([z.array(z.null()), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
267+ "brookie": z.array(z.union([z.array(z.number().int()), RebeccaSchema])),
268268 "bumboatman": z.array(z.union([z.null(), z.array(z.null()), z.string()])),
269269 "bystreet": z.array(z.null()),
270- "calaverite": z.array(z.union([z.array(z.number()), z.string()])),
271- "catallactic": z.array(z.union([z.array(z.null()), z.boolean(), z.record(z.string(), z.number())])),
272- "cemental": z.array(z.union([z.array(z.number()), z.number(), z.record(z.string(), z.number())])),
270+ "calaverite": z.array(z.union([z.array(z.number().int()), z.string()])),
271+ "catallactic": z.array(z.union([z.array(z.null()), z.boolean(), z.record(z.string(), z.number().int())])),
272+ "cemental": z.array(z.union([z.array(z.number().int()), z.number(), z.record(z.string(), z.number().int())])),
273273 "Chytridiaceae": z.array(z.union([z.null(), z.boolean(), ChytridiaceaeClassSchema])),
274- "Discordia": z.array(z.union([z.array(z.number()), DiscordiaClassSchema])),
275- "Endomyces": z.array(z.union([z.number(), z.string()])),
276- "Epinephelidae": z.array(z.union([z.boolean(), z.number(), z.string()])),
277- "Eupatorium": z.array(z.union([z.array(z.null()), z.record(z.string(), z.number())])),
278- "Gryphosaurus": z.array(z.union([z.array(z.number()), GryphosaurusClassSchema, z.string()])),
279- "Koryak": z.array(z.union([z.record(z.string(), z.union([z.null(), z.number()])), z.string()])),
274+ "Discordia": z.array(z.union([z.array(z.number().int()), DiscordiaClassSchema])),
275+ "Endomyces": z.array(z.union([z.number().int(), z.string()])),
276+ "Epinephelidae": z.array(z.union([z.boolean(), z.number().int(), z.string()])),
277+ "Eupatorium": z.array(z.union([z.array(z.null()), z.record(z.string(), z.number().int())])),
278+ "Gryphosaurus": z.array(z.union([z.array(z.number().int()), GryphosaurusClassSchema, z.string()])),
279+ "Koryak": z.array(z.union([z.record(z.string(), z.union([z.null(), z.number().int()])), z.string()])),
280280 "Lavinia": z.array(z.union([LaviniaClassSchema, z.string()])),
281- "Oskar": z.array(z.union([z.array(z.number()), OskarClassSchema])),
282- "Rebecca": z.array(z.union([RebeccaSchema, z.number(), z.string()])),
283- "Rhomboganoidei": z.array(z.union([z.array(z.number()), RebeccaSchema, z.string()])),
281+ "Oskar": z.array(z.union([z.array(z.number().int()), OskarClassSchema])),
282+ "Rebecca": z.array(z.union([RebeccaSchema, z.number().int(), z.string()])),
283+ "Rhomboganoidei": z.array(z.union([z.array(z.number().int()), RebeccaSchema, z.string()])),
284284 "Rigsmal": z.boolean(),
285285 "Ruellia": z.array(z.union([z.boolean(), RebeccaSchema, z.string()])),
286- "School": z.array(z.union([z.null(), z.number(), z.record(z.string(), z.number())])),
287- "Shakespearolater": z.array(z.union([z.array(z.number()), z.number(), z.string()])),
286+ "School": z.array(z.union([z.null(), z.number().int(), z.record(z.string(), z.number().int())])),
287+ "Shakespearolater": z.array(z.union([z.array(z.number().int()), z.number(), z.string()])),
288288 "Svan": z.array(z.number()),
289289 "Wayao": z.record(z.string(), z.number()),
290290 });
Test case

test/inputs/json/priority/combinations3.json

1 generated file · +85 −85
Mtypescript-zoddefault / TopLevel.ts+85 −85
@@ -75,77 +75,77 @@ export type LandlubberlyClass = z.infer<typeof LandlubberlyClassSchema>;
7575
7676 export const LupusClassSchema = z.object({
7777 "catharticalness": z.number().optional(),
78- "Chirotherium": z.number().optional(),
79- "Chlorioninae": z.number().optional(),
80- "Corvinae": z.number().optional(),
81- "Crassina": z.number().optional(),
78+ "Chirotherium": z.number().int().optional(),
79+ "Chlorioninae": z.number().int().optional(),
80+ "Corvinae": z.number().int().optional(),
81+ "Crassina": z.number().int().optional(),
8282 "disdiapason": z.string().optional(),
83- "exiguity": z.number().optional(),
84- "farcist": z.number().optional(),
85- "holographical": z.number().optional(),
83+ "exiguity": z.number().int().optional(),
84+ "farcist": z.number().int().optional(),
85+ "holographical": z.number().int().optional(),
8686 "homocerc": z.boolean().optional(),
87- "ichthyophagan": z.number().optional(),
88- "implacable": z.number().optional(),
87+ "ichthyophagan": z.number().int().optional(),
88+ "implacable": z.number().int().optional(),
8989 "nonbookish": z.null().optional(),
90- "outshiner": z.number().optional(),
91- "overweather": z.number().optional(),
92- "protonegroid": z.number().optional(),
93- "shallowish": z.number().optional(),
94- "snoke": z.number().optional(),
95- "snout": z.number().optional(),
96- "surveillance": z.number().optional(),
97- "threshingtime": z.number().optional(),
98- "Thysanocarpus": z.number().optional(),
99- "unsignificantly": z.number().optional(),
100- "unsnap": z.number().optional(),
101- "vendible": z.number().optional(),
90+ "outshiner": z.number().int().optional(),
91+ "overweather": z.number().int().optional(),
92+ "protonegroid": z.number().int().optional(),
93+ "shallowish": z.number().int().optional(),
94+ "snoke": z.number().int().optional(),
95+ "snout": z.number().int().optional(),
96+ "surveillance": z.number().int().optional(),
97+ "threshingtime": z.number().int().optional(),
98+ "Thysanocarpus": z.number().int().optional(),
99+ "unsignificantly": z.number().int().optional(),
100+ "unsnap": z.number().int().optional(),
101+ "vendible": z.number().int().optional(),
102102 });
103103 export type LupusClass = z.infer<typeof LupusClassSchema>;
104104
105105 export const MaslinSchema = z.object({
106- "Alicant": z.number().optional(),
106+ "Alicant": z.number().int().optional(),
107107 "antiatonement": z.null().optional(),
108- "anticorrosive": z.number().optional(),
108+ "anticorrosive": z.number().int().optional(),
109109 "aphidozer": z.null().optional(),
110110 "Bakuninist": z.null().optional(),
111- "be": z.number().optional(),
111+ "be": z.number().int().optional(),
112112 "catharticalness": z.number().optional(),
113- "Chirotherium": z.number().optional(),
114- "chub": z.number().optional(),
115- "cuprosilicon": z.number().optional(),
116- "curtailedly": z.number().optional(),
117- "dellenite": z.number().optional(),
118- "Dimitry": z.number().optional(),
113+ "Chirotherium": z.number().int().optional(),
114+ "chub": z.number().int().optional(),
115+ "cuprosilicon": z.number().int().optional(),
116+ "curtailedly": z.number().int().optional(),
117+ "dellenite": z.number().int().optional(),
118+ "Dimitry": z.number().int().optional(),
119119 "disdiapason": z.string().optional(),
120120 "edifying": z.null().optional(),
121- "ethmoiditis": z.number().optional(),
121+ "ethmoiditis": z.number().int().optional(),
122122 "gastralgy": z.null().optional(),
123- "goatherd": z.number().optional(),
124- "hammerdress": z.number().optional(),
123+ "goatherd": z.number().int().optional(),
124+ "hammerdress": z.number().int().optional(),
125125 "hangfire": z.null().optional(),
126126 "homocerc": z.boolean().optional(),
127- "lacunosity": z.number().optional(),
127+ "lacunosity": z.number().int().optional(),
128128 "longiloquence": z.null().optional(),
129- "mameliere": z.number().optional(),
129+ "mameliere": z.number().int().optional(),
130130 "motherless": z.null().optional(),
131131 "nonbookish": z.null().optional(),
132132 "noncorrodible": z.null().optional(),
133133 "nonsensicality": z.null().optional(),
134- "oafishly": z.number().optional(),
134+ "oafishly": z.number().int().optional(),
135135 "pfund": z.null().optional(),
136136 "preadvisory": z.null().optional(),
137137 "retroflexed": z.null().optional(),
138- "saccharulmic": z.number().optional(),
139- "scowlful": z.number().optional(),
138+ "saccharulmic": z.number().int().optional(),
139+ "scowlful": z.number().int().optional(),
140140 "secluded": z.null().optional(),
141141 "slackage": z.null().optional(),
142- "sphaeridial": z.number().optional(),
142+ "sphaeridial": z.number().int().optional(),
143143 "spondulics": z.null().optional(),
144- "subsecive": z.number().optional(),
144+ "subsecive": z.number().int().optional(),
145145 "swellmobsman": z.null().optional(),
146- "trachyglossate": z.number().optional(),
146+ "trachyglossate": z.number().int().optional(),
147147 "trialogue": z.null().optional(),
148- "unassuaged": z.number().optional(),
148+ "unassuaged": z.number().int().optional(),
149149 "ungross": z.null().optional(),
150150 "unjudiciously": z.null().optional(),
151151 });
@@ -153,7 +153,7 @@ export type Maslin = z.infer<typeof MaslinSchema>;
153153
154154 export const MonaziteClassSchema = z.object({
155155 "catharticalness": z.number(),
156- "Chirotherium": z.number(),
156+ "Chirotherium": z.number().int(),
157157 "disdiapason": z.string(),
158158 "homocerc": z.boolean(),
159159 "nonbookish": z.null(),
@@ -164,7 +164,7 @@ export const MonotheisticallyClassSchema = z.object({
164164 "blaspheme": z.null().optional(),
165165 "catharticalness": z.number().optional(),
166166 "celiosalpingectomy": z.null().optional(),
167- "Chirotherium": z.number().optional(),
167+ "Chirotherium": z.number().int().optional(),
168168 "consummativeness": z.null().optional(),
169169 "disdiapason": z.string().optional(),
170170 "egestive": z.null().optional(),
@@ -192,7 +192,7 @@ export type MonotheisticallyClass = z.infer<typeof MonotheisticallyClassSchema>;
192192 export const NoncontributingSchema = z.object({
193193 "estevin": z.string(),
194194 "jolterhead": z.number(),
195- "sauternes": z.number(),
195+ "sauternes": z.number().int(),
196196 "sparsely": z.boolean(),
197197 "unrequested": z.null(),
198198 });
@@ -247,38 +247,38 @@ export const OutrivalClassSchema = z.object({
247247 export type OutrivalClass = z.infer<typeof OutrivalClassSchema>;
248248
249249 export const PiaculumClassSchema = z.object({
250- "alada": z.number().optional(),
251- "amphistomous": z.number().optional(),
252- "boysenberry": z.number().optional(),
250+ "alada": z.number().int().optional(),
251+ "amphistomous": z.number().int().optional(),
252+ "boysenberry": z.number().int().optional(),
253253 "catharticalness": z.number().optional(),
254- "Chirotherium": z.number().optional(),
255- "decardinalize": z.number().optional(),
256- "discouragement": z.number().optional(),
254+ "Chirotherium": z.number().int().optional(),
255+ "decardinalize": z.number().int().optional(),
256+ "discouragement": z.number().int().optional(),
257257 "disdiapason": z.string().optional(),
258- "doitrified": z.number().optional(),
259- "hexaspermous": z.number().optional(),
258+ "doitrified": z.number().int().optional(),
259+ "hexaspermous": z.number().int().optional(),
260260 "homocerc": z.boolean().optional(),
261- "insinking": z.number().optional(),
262- "loathfulness": z.number().optional(),
263- "miasmatical": z.number().optional(),
264- "neurofibril": z.number().optional(),
261+ "insinking": z.number().int().optional(),
262+ "loathfulness": z.number().int().optional(),
263+ "miasmatical": z.number().int().optional(),
264+ "neurofibril": z.number().int().optional(),
265265 "nonbookish": z.null().optional(),
266- "phonendoscope": z.number().optional(),
267- "pilferment": z.number().optional(),
268- "predismissory": z.number().optional(),
269- "preinscription": z.number().optional(),
270- "quotative": z.number().optional(),
271- "sienna": z.number().optional(),
272- "thorax": z.number().optional(),
273- "yachting": z.number().optional(),
274- "Zipper": z.number().optional(),
266+ "phonendoscope": z.number().int().optional(),
267+ "pilferment": z.number().int().optional(),
268+ "predismissory": z.number().int().optional(),
269+ "preinscription": z.number().int().optional(),
270+ "quotative": z.number().int().optional(),
271+ "sienna": z.number().int().optional(),
272+ "thorax": z.number().int().optional(),
273+ "yachting": z.number().int().optional(),
274+ "Zipper": z.number().int().optional(),
275275 });
276276 export type PiaculumClass = z.infer<typeof PiaculumClassSchema>;
277277
278278 export const PneumoceleSchema = z.object({
279279 "Carbonarism": z.null().optional(),
280280 "catharticalness": z.number().optional(),
281- "Chirotherium": z.number().optional(),
281+ "Chirotherium": z.number().int().optional(),
282282 "cineolic": z.null().optional(),
283283 "cobbly": z.null().optional(),
284284 "conchyliferous": z.null().optional(),
@@ -354,11 +354,11 @@ export type PrefreshmanClass = z.infer<typeof PrefreshmanClassSchema>;
354354
355355 export const TopLevelSchema = z.object({
356356 "juror": z.array(z.union([z.boolean(), JurorClassSchema])),
357- "kongoni": z.array(z.union([z.array(z.number()), z.record(z.string(), z.number())])),
357+ "kongoni": z.array(z.union([z.array(z.number().int()), z.record(z.string(), z.number().int())])),
358358 "ladronism": z.array(z.union([LadronismClassSchema, z.number(), z.string()])),
359- "landlubberly": z.array(z.union([z.boolean(), LandlubberlyClassSchema, z.number()])),
360- "listener": z.array(z.union([z.array(z.null()), z.number()])),
361- "lupus": z.array(z.union([LupusClassSchema, z.number()])),
359+ "landlubberly": z.array(z.union([z.boolean(), LandlubberlyClassSchema, z.number().int()])),
360+ "listener": z.array(z.union([z.array(z.null()), z.number().int()])),
361+ "lupus": z.array(z.union([LupusClassSchema, z.number().int()])),
362362 "maslin": z.array(MaslinSchema),
363363 "monazite": z.array(z.union([MonaziteClassSchema, z.number()])),
364364 "monoliteral": z.array(z.union([z.array(z.null()), z.boolean()])),
@@ -366,34 +366,34 @@ export const TopLevelSchema = z.object({
366366 "montage": z.array(z.union([z.array(z.null()), z.number(), z.string()])),
367367 "moralness": z.array(z.union([z.null(), z.array(z.null()), z.number()])),
368368 "mowra": z.array(z.union([z.null(), MonaziteClassSchema])),
369- "mulishly": z.array(z.union([z.null(), z.array(z.number()), z.number()])),
370- "myoscope": z.array(z.union([z.array(z.null()), z.boolean(), z.number()])),
371- "nach": z.array(z.union([z.null(), z.array(z.union([z.null(), z.number()]))])),
369+ "mulishly": z.array(z.union([z.null(), z.array(z.number().int()), z.number()])),
370+ "myoscope": z.array(z.union([z.array(z.null()), z.boolean(), z.number().int()])),
371+ "nach": z.array(z.union([z.null(), z.array(z.union([z.null(), z.number().int()]))])),
372372 "neuromastic": z.array(z.union([z.array(z.null()), z.number()])),
373373 "noncontributing": z.array(NoncontributingSchema),
374- "nonnervous": z.array(z.union([z.boolean(), z.number()])),
374+ "nonnervous": z.array(z.union([z.boolean(), z.number().int()])),
375375 "nonvaluation": z.array(z.union([z.array(z.null()), z.boolean(), z.number()])),
376376 "occupationalist": z.array(z.union([z.null(), z.array(z.null()), OccupationalistClassSchema])),
377377 "outrival": z.array(z.union([z.null(), OutrivalClassSchema, z.number()])),
378- "paleographically": z.array(z.union([z.number(), z.record(z.string(), z.union([z.null(), z.number()]))])),
379- "pamphletwise": z.array(z.union([z.number(), z.record(z.string(), z.number()), z.string()])),
378+ "paleographically": z.array(z.union([z.number(), z.record(z.string(), z.union([z.null(), z.number().int()]))])),
379+ "pamphletwise": z.array(z.union([z.number().int(), z.record(z.string(), z.number().int()), z.string()])),
380380 "pediatrics": z.array(z.union([z.null(), z.boolean(), z.number()])),
381381 "perceptive": z.array(z.boolean()),
382382 "piaculum": z.array(z.union([PiaculumClassSchema, z.number()])),
383383 "piccadilly": z.array(z.union([z.null(), z.number(), z.string()])),
384384 "piffler": z.array(z.union([z.array(z.null()), MonaziteClassSchema])),
385- "pithful": z.array(z.union([z.null(), z.boolean(), z.number()])),
386- "placuntitis": z.array(z.union([z.number(), z.record(z.string(), z.number())])),
387- "plectopterous": z.array(z.union([z.number(), z.record(z.string(), z.number())])),
385+ "pithful": z.array(z.union([z.null(), z.boolean(), z.number().int()])),
386+ "placuntitis": z.array(z.union([z.number().int(), z.record(z.string(), z.number().int())])),
387+ "plectopterous": z.array(z.union([z.number(), z.record(z.string(), z.number().int())])),
388388 "pneumocele": z.array(z.union([z.null(), PneumoceleSchema])),
389389 "poliorcetic": z.array(z.union([z.boolean(), MonaziteClassSchema])),
390- "poormaster": z.array(z.union([z.null(), z.array(z.number()), z.record(z.string(), z.number())])),
391- "potwhisky": z.array(z.union([z.null(), PotwhiskyClassSchema, z.number()])),
390+ "poormaster": z.array(z.union([z.null(), z.array(z.number().int()), z.record(z.string(), z.number().int())])),
391+ "potwhisky": z.array(z.union([z.null(), PotwhiskyClassSchema, z.number().int()])),
392392 "practicalizer": z.array(z.union([z.array(z.null()), MonaziteClassSchema, z.string()])),
393393 "prefreshman": z.array(z.union([z.array(z.null()), PrefreshmanClassSchema, z.string()])),
394394 "prehensility": z.array(z.union([z.array(z.null()), z.boolean(), MonaziteClassSchema])),
395- "prevoidance": z.array(z.union([z.array(z.number()), MonaziteClassSchema, z.number()])),
396- "probant": z.array(z.record(z.string(), z.union([z.null(), z.number()]))),
397- "protext": z.array(z.union([z.array(z.number()), z.boolean(), MonaziteClassSchema])),
395+ "prevoidance": z.array(z.union([z.array(z.number().int()), MonaziteClassSchema, z.number().int()])),
396+ "probant": z.array(z.record(z.string(), z.union([z.null(), z.number().int()]))),
397+ "protext": z.array(z.union([z.array(z.number().int()), z.boolean(), MonaziteClassSchema])),
398398 });
399399 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -12,7 +12,7 @@ export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() =>
1212 z.object({
1313 "also": TopLevelSchema.optional(),
1414 "bar": z.boolean(),
15- "foo": z.number(),
15+ "foo": z.number().int(),
1616 "moo": z.number(),
1717 "quux": z.string(),
1818 })
Test case

test/inputs/json/priority/issue2680-scalar-array.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -1,4 +1,4 @@
11 import * as z from "zod";
22
3-export const TopLevelSchema = z.array(z.number());
3+export const TopLevelSchema = z.array(z.number().int());
44 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/list.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -7,7 +7,7 @@ export type TopLevel = {
77 };
88 export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() =>
99 z.object({
10- "data": z.number(),
10+ "data": z.number().int(),
1111 "next": z.union([z.null(), TopLevelSchema]),
1212 })
1313 );
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "anEasyOne": z.number(),
5+ "anEasyOne": z.number().int(),
66 "isMNISTLetter": z.boolean(),
77 "JSONString": z.string(),
88 "PrettyEasyToo": z.boolean(),
Test case

test/inputs/json/priority/nested-objects.json

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "a": z.record(z.string(), z.number()),
6- "b": z.record(z.string(), z.number()),
5+ "a": z.record(z.string(), z.number().int()),
6+ "b": z.record(z.string(), z.number().int()),
77 });
88 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/no-classes.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -1,4 +1,4 @@
11 import * as z from "zod";
22
3-export const TopLevelSchema = z.number();
3+export const TopLevelSchema = z.number().int();
44 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const ResultSchema = z.object({
5- "age": z.number(),
5+ "age": z.number().int(),
66 "name": z.null().optional(),
77 });
88 export type Result = z.infer<typeof ResultSchema>;
Test case

test/inputs/json/priority/optional-union.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelElementSchema = z.object({
5- "a": z.union([z.number(), z.string()]).optional(),
5+ "a": z.union([z.number().int(), z.string()]).optional(),
66 });
77 export type TopLevelElement = z.infer<typeof TopLevelElementSchema>;
Test case

test/inputs/json/priority/php-mixed-union.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -7,6 +7,6 @@ export const MixedClassSchema = z.object({
77 export type MixedClass = z.infer<typeof MixedClassSchema>;
88
99 export const TopLevelSchema = z.object({
10- "mixed": z.array(z.union([z.null(), z.boolean(), MixedClassSchema, z.number(), z.string()])),
10+ "mixed": z.array(z.union([z.null(), z.boolean(), MixedClassSchema, z.number().int(), z.string()])),
1111 });
1212 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -3,8 +3,8 @@ import * as z from "zod";
33
44 export const TopLevelSchema = z.object({
55 "boolean": z.boolean(),
6- "integer": z.number(),
7- "integers": z.array(z.number()),
6+ "integer": z.number().int(),
7+ "integers": z.array(z.number().int()),
88 "number": z.number(),
99 "string": z.string(),
1010 });
Test case

test/inputs/json/priority/recursive.json

1 generated file · +26 −26
Mtypescript-zoddefault / TopLevel.ts+26 −26
@@ -19,9 +19,9 @@ export type FormatsClass = {
1919 export const FormatsClassSchema: z.ZodType<FormatsClass> = z.lazy(() =>
2020 z.object({
2121 "formats": z.array(FormatSchema).optional(),
22- "height": z.number(),
22+ "height": z.number().int(),
2323 "url": z.string(),
24- "width": z.number(),
24+ "width": z.number().int(),
2525 })
2626 );
2727
@@ -37,7 +37,7 @@ export const CategoryThumbnailSchema = z.object({
3737 export type CategoryThumbnail = z.infer<typeof CategoryThumbnailSchema>;
3838
3939 export const EonandyearSchema = z.object({
40- "lowestsetbit": z.number(),
40+ "lowestsetbit": z.number().int(),
4141 });
4242 export type Eonandyear = z.infer<typeof EonandyearSchema>;
4343
@@ -59,23 +59,23 @@ export const LinkElementSchema = z.object({
5959 export type LinkElement = z.infer<typeof LinkElementSchema>;
6060
6161 export const DateClassSchema = z.object({
62- "day": z.number(),
62+ "day": z.number().int(),
6363 "eonandyear": EonandyearSchema,
64- "hour": z.number(),
65- "millisecond": z.number(),
66- "minute": z.number(),
67- "month": z.number(),
68- "second": z.number(),
69- "timezone": z.number(),
64+ "hour": z.number().int(),
65+ "millisecond": z.number().int(),
66+ "minute": z.number().int(),
67+ "month": z.number().int(),
68+ "second": z.number().int(),
69+ "timezone": z.number().int(),
7070 "valid": z.boolean(),
7171 "xmlschematype": XmlschematypeSchema,
72- "year": z.number(),
72+ "year": z.number().int(),
7373 });
7474 export type DateClass = z.infer<typeof DateClassSchema>;
7575
7676 export const UseraverageratingSchema = z.object({
7777 "links": z.array(LinkElementSchema),
78- "numcomments": z.number(),
78+ "numcomments": z.number().int(),
7979 "rating": z.string(),
8080 });
8181 export type Useraveragerating = z.infer<typeof UseraverageratingSchema>;
@@ -88,11 +88,11 @@ export type Specification = z.infer<typeof SpecificationSchema>;
8888 export const CategorySchema = z.object({
8989 "concatenatecategoryname": z.boolean(),
9090 "hasoffer": z.boolean(),
91- "id": z.number(),
91+ "id": z.number().int(),
9292 "isfinal": z.boolean(),
9393 "links": z.array(LinkElementSchema),
9494 "name": z.string(),
95- "parentcategoryid": z.number(),
95+ "parentcategoryid": z.number().int(),
9696 "thumbnail": CategoryThumbnailSchema,
9797 });
9898 export type Category = z.infer<typeof CategorySchema>;
@@ -100,9 +100,9 @@ export type Category = z.infer<typeof CategorySchema>;
100100 export const DetailsSchema = z.object({
101101 "applicationid": z.string(),
102102 "applicationversion": z.string(),
103- "code": z.number(),
103+ "code": z.number().int(),
104104 "date": DateClassSchema,
105- "elapsedtime": z.number(),
105+ "elapsedtime": z.number().int(),
106106 "message": z.string(),
107107 "status": z.string(),
108108 });
@@ -114,22 +114,22 @@ export const RatingSchema = z.object({
114114 export type Rating = z.infer<typeof RatingSchema>;
115115
116116 export const ProductProductSchema = z.object({
117- "categoryid": z.number(),
117+ "categoryid": z.number().int(),
118118 "currency": CurrencySchema,
119119 "eco": z.boolean(),
120120 "fulldescription": z.boolean(),
121121 "hasmetasearch": z.boolean(),
122- "id": z.number(),
122+ "id": z.number().int(),
123123 "links": z.array(LinkElementSchema),
124- "numoffers": z.number(),
124+ "numoffers": z.number().int(),
125125 "pricemax": z.string(),
126126 "pricemin": z.string(),
127127 "productname": z.string(),
128- "quantity": z.number(),
128+ "quantity": z.number().int(),
129129 "rating": RatingSchema,
130130 "specification": SpecificationSchema,
131131 "thumbnail": FormatsClassSchema,
132- "totalsellers": z.number(),
132+ "totalsellers": z.number().int(),
133133 });
134134 export type ProductProduct = z.infer<typeof ProductProductSchema>;
135135
@@ -142,12 +142,12 @@ export const TopLevelSchema = z.object({
142142 "category": CategorySchema,
143143 "details": DetailsSchema,
144144 "match": z.string(),
145- "page": z.number(),
145+ "page": z.number().int(),
146146 "product": z.array(ProductElementSchema),
147147 "schk": z.boolean(),
148- "totallooseoffers": z.number(),
149- "totalpages": z.number(),
150- "totalresultsavailable": z.number(),
151- "totalresultsreturned": z.number(),
148+ "totallooseoffers": z.number().int(),
149+ "totalpages": z.number().int(),
150+ "totalresultsavailable": z.number().int(),
151+ "totalresultsreturned": z.number().int(),
152152 });
153153 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/union-constructor-clash.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -8,6 +8,6 @@ export type BoolInUnion = z.infer<typeof BoolInUnionSchema>;
88
99 export const TopLevelSchema = z.object({
1010 "BoolInUnion": BoolInUnionSchema,
11- "union": z.array(z.union([z.boolean(), z.number()])),
11+ "union": z.array(z.union([z.boolean(), z.number().int()])),
1212 });
1313 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/unions.json

1 generated file · +3 −3
Mtypescript-zoddefault / TopLevel.ts+3 −3
@@ -7,8 +7,8 @@ export const ZClassSchema = z.object({
77 export type ZClass = z.infer<typeof ZClassSchema>;
88
99 export const TopLevelSchema = z.object({
10- "x": z.array(z.union([z.null(), z.number(), z.string()])),
11- "y": z.array(z.union([z.null(), z.number()])),
12- "z": z.array(z.union([z.array(z.number()), ZClassSchema, z.number()])),
10+ "x": z.array(z.union([z.null(), z.number().int(), z.string()])),
11+ "y": z.array(z.union([z.null(), z.number().int()])),
12+ "z": z.array(z.union([z.array(z.number().int()), ZClassSchema, z.number().int()])),
1313 });
1414 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/json/priority/uuids.json

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -4,7 +4,7 @@ import * as z from "zod";
44 export const TopLevelSchema = z.object({
55 "booleanValue": z.boolean(),
66 "doubleValue": z.number(),
7- "intValue": z.number(),
7+ "intValue": z.number().int(),
88 "stringValue": z.string(),
99 "uuidValue": z.string(),
1010 "uuidValues": z.array(z.string()),
Test case

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

1 generated file · +4 −4
Mtypescript-zoddefault / TopLevel.ts+4 −4
@@ -2,10 +2,10 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "block_index": z.number(),
5+ "block_index": z.number().int(),
66 "hash": z.string(),
7- "height": z.number(),
8- "time": z.number(),
9- "txIndexes": z.array(z.number()),
7+ "height": z.number().int(),
8+ "time": z.number().int(),
9+ "txIndexes": z.array(z.number().int()),
1010 });
1111 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +7 −7
Mtypescript-zoddefault / TopLevel.ts+7 −7
@@ -7,14 +7,14 @@ export const DifferentThingClassSchema = z.object({
77 export type DifferentThingClass = z.infer<typeof DifferentThingClassSchema>;
88
99 export const PersonElementSchema = z.object({
10- "intOrString": z.union([z.number(), z.string()]),
10+ "intOrString": z.union([z.number().int(), z.string()]),
1111 "name": z.string(),
1212 "optionalValue": z.boolean().optional(),
1313 });
1414 export type PersonElement = z.infer<typeof PersonElementSchema>;
1515
1616 export const PurplePersonSchema = z.object({
17- "intOrString": z.number(),
17+ "intOrString": z.number().int(),
1818 "name": z.string(),
1919 });
2020 export type PurplePerson = z.infer<typeof PurplePersonSchema>;
@@ -22,17 +22,17 @@ export type PurplePerson = z.infer<typeof PurplePersonSchema>;
2222 export const TopLevelSchema = z.object({
2323 "booleanValue": z.boolean(),
2424 "dateValue": z.string(),
25- "differentThings": z.array(z.union([DifferentThingClassSchema, z.number(), z.string()])),
25+ "differentThings": z.array(z.union([DifferentThingClassSchema, z.number().int(), z.string()])),
2626 "doubleValue": z.number(),
27- "intValue": z.number(),
28- "mapValue": z.record(z.string(), z.union([z.null(), z.number()])),
27+ "intValue": z.number().int(),
28+ "mapValue": z.record(z.string(), z.union([z.null(), z.number().int()])),
2929 "name with spaces": z.null(),
3030 "nullValue": z.null(),
31- "nullableMapValue": z.record(z.string(), z.union([z.null(), z.number()])),
31+ "nullableMapValue": z.record(z.string(), z.union([z.null(), z.number().int()])),
3232 "people": z.array(PersonElementSchema),
3333 "person": PurplePersonSchema,
3434 "stringValue": z.string(),
35- "tuples": z.array(z.array(z.union([z.number(), z.string()]))),
35+ "tuples": z.array(z.array(z.union([z.number().int(), z.string()]))),
3636 "uuidValue": z.string(),
3737 });
3838 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -12,7 +12,7 @@ export const ItemSchema = z.object({
1212 "address": AddressSchema.optional(),
1313 "created_at": z.coerce.date().optional(),
1414 "name": z.string(),
15- "sex": z.union([z.null(), z.number()]),
15+ "sex": z.union([z.null(), z.number().int()]),
1616 });
1717 export type Item = z.infer<typeof ItemSchema>;
Test case

test/inputs/json/samples/pokedex.json

1 generated file · +2 −2
Mtypescript-zoddefault / TopLevel.ts+2 −2
@@ -42,10 +42,10 @@ export type Evolution = z.infer<typeof EvolutionSchema>;
4242 export const PokemonSchema = z.object({
4343 "avg_spawns": z.number(),
4444 "candy": z.string(),
45- "candy_count": z.number().optional(),
45+ "candy_count": z.number().int().optional(),
4646 "egg": EggSchema,
4747 "height": z.string(),
48- "id": z.number(),
48+ "id": z.number().int(),
4949 "img": z.string(),
5050 "multipliers": z.union([z.null(), z.array(z.number())]),
5151 "name": z.string(),
Test case

test/inputs/json/samples/reddit.json

1 generated file · +11 −11
Mtypescript-zoddefault / TopLevel.ts+11 −11
@@ -57,9 +57,9 @@ export const MediaEmbedSchema = z.object({
5757 export type MediaEmbed = z.infer<typeof MediaEmbedSchema>;
5858
5959 export const SourceSchema = z.object({
60- "height": z.number(),
60+ "height": z.number().int(),
6161 "url": z.string(),
62- "width": z.number(),
62+ "width": z.number().int(),
6363 });
6464 export type Source = z.infer<typeof SourceSchema>;
6565
@@ -103,13 +103,13 @@ export const ChildDataSchema = z.object({
103103 "can_mod_post": z.boolean(),
104104 "clicked": z.boolean(),
105105 "contest_mode": z.boolean(),
106- "created": z.number(),
107- "created_utc": z.number(),
106+ "created": z.number().int(),
107+ "created_utc": z.number().int(),
108108 "distinguished": z.union([z.null(), z.string()]),
109109 "domain": DomainSchema,
110- "downs": z.number(),
110+ "downs": z.number().int(),
111111 "edited": z.boolean(),
112- "gilded": z.number(),
112+ "gilded": z.number().int(),
113113 "hidden": z.boolean(),
114114 "hide_score": z.boolean(),
115115 "id": z.string(),
@@ -123,7 +123,7 @@ export const ChildDataSchema = z.object({
123123 "media_embed": MediaEmbedSchema,
124124 "mod_reports": z.array(z.any()),
125125 "name": z.string(),
126- "num_comments": z.number(),
126+ "num_comments": z.number().int(),
127127 "num_reports": z.null(),
128128 "over_18": z.boolean(),
129129 "parent_whitelist_status": WhitelistStatusSchema,
@@ -134,7 +134,7 @@ export const ChildDataSchema = z.object({
134134 "removal_reason": z.null(),
135135 "report_reasons": z.null(),
136136 "saved": z.boolean(),
137- "score": z.number(),
137+ "score": z.number().int(),
138138 "secure_media": z.null(),
139139 "secure_media_embed": MediaEmbedSchema,
140140 "selftext": z.string(),
@@ -147,10 +147,10 @@ export const ChildDataSchema = z.object({
147147 "subreddit_type": SubredditTypeSchema,
148148 "suggested_sort": z.null(),
149149 "thumbnail": z.string(),
150- "thumbnail_height": z.number(),
151- "thumbnail_width": z.number(),
150+ "thumbnail_height": z.number().int(),
151+ "thumbnail_width": z.number().int(),
152152 "title": z.string(),
153- "ups": z.number(),
153+ "ups": z.number().int(),
154154 "url": z.string(),
155155 "user_reports": z.array(z.any()),
156156 "view_count": z.null(),
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "date": z.number(),
5+ "date": z.number().int(),
66 "title": z.string(),
77 "validity": z.boolean(),
88 });
Test case

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

1 generated file · +9 −9
Mtypescript-zoddefault / TopLevel.ts+9 −9
@@ -18,9 +18,9 @@ export const ExternalIdsSchema = z.object({
1818 export type ExternalIds = z.infer<typeof ExternalIdsSchema>;
1919
2020 export const ImageSchema = z.object({
21- "height": z.number(),
21+ "height": z.number().int(),
2222 "url": z.string(),
23- "width": z.number(),
23+ "width": z.number().int(),
2424 });
2525 export type Image = z.infer<typeof ImageSchema>;
2626
@@ -37,15 +37,15 @@ export type Artist = z.infer<typeof ArtistSchema>;
3737 export const ItemSchema = z.object({
3838 "artists": z.array(ArtistSchema),
3939 "available_markets": z.array(z.string()),
40- "disc_number": z.number(),
41- "duration_ms": z.number(),
40+ "disc_number": z.number().int(),
41+ "duration_ms": z.number().int(),
4242 "explicit": z.boolean(),
4343 "external_urls": ExternalUrlsSchema,
4444 "href": z.string(),
4545 "id": z.string(),
4646 "name": z.string(),
4747 "preview_url": z.string(),
48- "track_number": z.number(),
48+ "track_number": z.number().int(),
4949 "type": z.string(),
5050 "uri": z.string(),
5151 });
@@ -54,11 +54,11 @@ export type Item = z.infer<typeof ItemSchema>;
5454 export const TracksSchema = z.object({
5555 "href": z.string(),
5656 "items": z.array(ItemSchema),
57- "limit": z.number(),
57+ "limit": z.number().int(),
5858 "next": z.null(),
59- "offset": z.number(),
59+ "offset": z.number().int(),
6060 "previous": z.null(),
61- "total": z.number(),
61+ "total": z.number().int(),
6262 });
6363 export type Tracks = z.infer<typeof TracksSchema>;
6464
@@ -74,7 +74,7 @@ export const TopLevelSchema = z.object({
7474 "id": z.string(),
7575 "images": z.array(ImageSchema),
7676 "name": z.string(),
77- "popularity": z.number(),
77+ "popularity": z.number().int(),
7878 "release_date": z.string(),
7979 "release_date_precision": z.string(),
8080 "tracks": TracksSchema,
Test case

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

1 generated file · +1 −1
Mtypescript-zoddefault / TopLevel.ts+1 −1
@@ -9,7 +9,7 @@ export type Datum = z.infer<typeof DatumSchema>;
99
1010 export const DescriptionSchema = z.object({
1111 "base_period": z.string(),
12- "missing": z.number(),
12+ "missing": z.number().int(),
1313 "title": z.string(),
1414 "units": z.string(),
1515 });
Test case

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

1 generated file · +5 −5
Mtypescript-zoddefault / TopLevel.ts+5 −5
@@ -79,9 +79,9 @@ export const TitleSchema = z.enum([
7979 export type Title = z.infer<typeof TitleSchema>;
8080
8181 export const MetaSchema = z.object({
82- "limit": z.number(),
83- "offset": z.number(),
84- "total_count": z.number(),
82+ "limit": z.number().int(),
83+ "offset": z.number().int(),
84+ "total_count": z.number().int(),
8585 });
8686 export type Meta = z.infer<typeof MetaSchema>;
8787
@@ -97,7 +97,7 @@ export type Extra = z.infer<typeof ExtraSchema>;
9797 export const PersonSchema = z.object({
9898 "bioguideid": z.string(),
9999 "birthday": z.string(),
100- "cspanid": z.number(),
100+ "cspanid": z.number().int(),
101101 "firstname": z.string(),
102102 "gender": GenderSchema,
103103 "gender_label": GenderLabelSchema,
@@ -117,7 +117,7 @@ export type Person = z.infer<typeof PersonSchema>;
117117
118118 export const ObjectElementSchema = z.object({
119119 "caucus": z.union([z.null(), PartySchema]),
120- "congress_numbers": z.array(z.number()),
120+ "congress_numbers": z.array(z.number().int()),
121121 "current": z.boolean(),
122122 "description": z.string(),
123123 "district": z.null(),
Test case

test/inputs/schema/cut-enum.schema

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,6 +2,6 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "foo": z.number(),
5+ "foo": z.number().int(),
66 });
77 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,6 +2,6 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "item": z.number(),
5+ "item": z.number().int(),
66 });
77 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/id-root.schema

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,6 +2,6 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "bar": z.number(),
5+ "bar": z.number().int(),
66 });
77 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "foo": z.number(),
5+ "foo": z.number().int(),
66 "bar": z.boolean(),
77 "quux": z.string(),
88 });
Test case

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

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "foo": z.number(),
5+ "foo": z.number().int(),
66 "bar": z.boolean().optional(),
77 "quux": z.string().optional(),
88 });
Test case

test/inputs/schema/integer-string.schema

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -7,7 +7,7 @@ export const TopLevelSchema = z.object({
77 "nullable": z.union([z.null(), z.string()]),
88 "one": z.string(),
99 "optional": z.string().optional(),
10- "unionWithInt": z.union([z.number(), z.string()]),
11- "unionWithIntAndEnum": z.union([z.number(), z.string()]),
10+ "unionWithInt": z.union([z.number().int(), z.string()]),
11+ "unionWithIntAndEnum": z.union([z.number().int(), z.string()]),
1212 });
1313 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/integer-type.schema

1 generated file · +9 −9
Mschema-typescript-zoddefault / TopLevel.ts+9 −9
@@ -2,14 +2,14 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "above_i32_max": z.number(),
6- "below_i32_min": z.number(),
7- "i32_range": z.number(),
8- "large_bounds": z.number(),
9- "only_maximum": z.number(),
10- "only_minimum": z.number(),
11- "small_negative": z.number(),
12- "small_positive": z.number(),
13- "unbounded": z.number(),
5+ "above_i32_max": z.number().int(),
6+ "below_i32_min": z.number().int(),
7+ "i32_range": z.number().int(),
8+ "large_bounds": z.number().int(),
9+ "only_maximum": z.number().int(),
10+ "only_minimum": z.number().int(),
11+ "small_negative": z.number().int(),
12+ "small_positive": z.number().int(),
13+ "unbounded": z.number().int(),
1414 });
1515 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/issue2680-top-level-array.schema

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -1,4 +1,4 @@
11 import * as z from "zod";
22
3-export const TopLevelSchema = z.array(z.number());
3+export const TopLevelSchema = z.array(z.number().int());
44 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/min-max-items.schema

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -2,10 +2,10 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "maxOnly": z.array(z.number()).max(3),
5+ "maxOnly": z.array(z.number().int()).max(3),
66 "minAndMax": z.array(z.number()).min(1).max(4),
77 "minOnly": z.array(z.string()).min(2),
88 "plain": z.array(z.string()),
9- "unionItems": z.array(z.union([z.number(), z.string()])).min(2),
9+ "unionItems": z.array(z.union([z.number().int(), z.string()])).min(2),
1010 });
1111 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/minmax-integer.schema

1 generated file · +8 −8
Mschema-typescript-zoddefault / TopLevel.ts+8 −8
@@ -2,13 +2,13 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "free": z.number(),
6- "intersection": z.number(),
7- "max": z.number(),
8- "min": z.number(),
9- "minmax": z.number(),
10- "minMaxIntersection": z.number(),
11- "minMaxUnion": z.number(),
12- "union": z.number(),
5+ "free": z.number().int(),
6+ "intersection": z.number().int(),
7+ "max": z.number().int(),
8+ "min": z.number().int(),
9+ "minmax": z.number().int(),
10+ "minMaxIntersection": z.number().int(),
11+ "minMaxUnion": z.number().int(),
12+ "union": z.number().int(),
1313 });
1414 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -2,8 +2,8 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "bar": z.number(),
6- "foo": z.number(),
5+ "bar": z.number().int(),
6+ "foo": z.number().int(),
77 "quux": z.boolean(),
88 });
99 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -9,10 +9,10 @@ export type Coordinate = z.infer<typeof CoordinateSchema>;
99
1010 export const TopLevelSchema = z.object({
1111 "coordinates": z.array(CoordinateSchema).optional(),
12- "count": z.number().optional(),
12+ "count": z.number().int().optional(),
1313 "label": z.string().optional(),
1414 "requiredCoordinates": z.array(CoordinateSchema),
15- "requiredCount": z.number(),
15+ "requiredCount": z.number().int(),
1616 "requiredLabel": z.string(),
1717 "weight": z.number().optional(),
1818 });
Test case

test/inputs/schema/optional-constraints.schema

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -3,9 +3,9 @@ import * as z from "zod";
33
44 export const TopLevelSchema = z.object({
55 "optDouble": z.number().optional(),
6- "optInt": z.number().optional(),
6+ "optInt": z.number().int().optional(),
77 "optPattern": z.string().optional(),
88 "optString": z.string().optional(),
9- "reqZeroMin": z.number(),
9+ "reqZeroMin": z.number().int(),
1010 });
1111 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/prefix-items.schema

1 generated file · +2 −2
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "open": z.array(z.union([z.boolean(), z.number()])),
6- "tuple": z.array(z.union([z.boolean(), z.number()])),
5+ "open": z.array(z.union([z.boolean(), z.number().int()])),
6+ "tuple": z.array(z.union([z.boolean(), z.number().int()])),
77 });
88 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

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

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,6 +2,6 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "foo": z.number(),
5+ "foo": z.number().int(),
66 });
77 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/tuple.schema

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,6 +2,6 @@ import * as z from "zod";
22
33
44 export const TopLevelSchema = z.object({
5- "tuple": z.array(z.union([z.boolean(), z.number()])),
5+ "tuple": z.array(z.union([z.boolean(), z.number().int()])),
66 });
77 export type TopLevel = z.infer<typeof TopLevelSchema>;
Test case

test/inputs/schema/union.schema

1 generated file · +1 −1
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
@@ -2,7 +2,7 @@ import * as z from "zod";
22
33
44 export const TopLevelElementSchema = z.object({
5- "one": z.number().optional(),
5+ "one": z.number().int().optional(),
66 "two": z.boolean(),
77 "three": z.number().optional(),
88 });
No generated files match these filters.