Skip to content

Commit 0ca06cd

Browse files
authored
Merge branch 'master' into make-v27
2 parents a14a9fa + 71d5172 commit 0ca06cd

File tree

10 files changed

+142
-76
lines changed

10 files changed

+142
-76
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Anna Bocharova
3+
Copyright (c) 2026 Anna Bocharova
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

example/example.documentation.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ paths:
132132
required: true
133133
description: PATCH /v1/user/:id Parameter
134134
schema:
135-
examples:
136-
- "1234567890"
137135
type: string
138136
minLength: 1
137+
examples:
138+
- "1234567890"
139139
examples:
140140
example1:
141141
value: "1234567890"
@@ -144,9 +144,9 @@ paths:
144144
required: true
145145
description: PATCH /v1/user/:id Parameter
146146
schema:
147+
type: string
147148
examples:
148149
- "12"
149-
type: string
150150
examples:
151151
example1:
152152
value: "12"
@@ -158,15 +158,15 @@ paths:
158158
type: object
159159
properties:
160160
key:
161+
type: string
162+
minLength: 1
161163
examples:
162164
- 1234-5678-90
165+
name:
163166
type: string
164167
minLength: 1
165-
name:
166168
examples:
167169
- John Doe
168-
type: string
169-
minLength: 1
170170
birthday:
171171
description: the day of birth
172172
type: string
@@ -205,9 +205,9 @@ paths:
205205
type: object
206206
properties:
207207
name:
208+
type: string
208209
examples:
209210
- John Doe
210-
type: string
211211
createdAt:
212212
description: account creation date
213213
type: string
@@ -275,11 +275,11 @@ paths:
275275
type: object
276276
properties:
277277
name:
278+
type: string
279+
pattern: ^\w+ \w+$
278280
description: first name and last name
279281
examples:
280282
- John Doe
281-
type: string
282-
pattern: ^\w+ \w+$
283283
required:
284284
- name
285285
examples:
@@ -868,7 +868,6 @@ paths:
868868
components:
869869
schemas:
870870
Feature:
871-
id: Feature
872871
type: object
873872
properties:
874873
title:
@@ -880,6 +879,7 @@ components:
880879
required:
881880
- title
882881
additionalProperties: false
882+
id: Feature
883883
responses: {}
884884
parameters: {}
885885
examples: {}

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/swagger-ui-express": "^4.1.8",
1717
"express-zod-api": "workspace:*",
1818
"http-errors": "catalog:dev",
19-
"qs": "^6.14.0",
19+
"qs": "^6.14.1",
2020
"swagger-ui-express": "^5.0.0",
2121
"typescript": "catalog:dev",
2222
"zod": "catalog:dev"

express-zod-api/tests/__snapshots__/documentation.spec.ts.snap

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,6 +2072,8 @@ paths:
20722072
const: only
20732073
additionalProperties:
20742074
type: boolean
2075+
required:
2076+
- only
20752077
union:
20762078
type: object
20772079
propertyNames:
@@ -2082,6 +2084,9 @@ paths:
20822084
const: option2
20832085
additionalProperties:
20842086
type: boolean
2087+
required:
2088+
- option1
2089+
- option2
20852090
enum:
20862091
type: object
20872092
propertyNames:
@@ -2091,6 +2096,9 @@ paths:
20912096
- option2
20922097
additionalProperties:
20932098
type: boolean
2099+
required:
2100+
- option1
2101+
- option2
20942102
required:
20952103
- simple
20962104
- stringy
@@ -3594,8 +3602,8 @@ paths:
35943602
required: true
35953603
description: GET /v1/getSomething Parameter
35963604
schema:
3597-
deprecated: true
35983605
type: string
3606+
deprecated: true
35993607
responses:
36003608
"200":
36013609
description: GET /v1/getSomething Positive response
@@ -3653,8 +3661,8 @@ paths:
36533661
required: true
36543662
description: HEAD /v1/getSomething Parameter
36553663
schema:
3656-
deprecated: true
36573664
type: string
3665+
deprecated: true
36583666
responses:
36593667
"200":
36603668
description: HEAD /v1/getSomething Positive response
@@ -3713,11 +3721,6 @@ paths:
37133721
type: string
37143722
const: success
37153723
data:
3716-
examples:
3717-
- a: first
3718-
b: prefix_first
3719-
- a: second
3720-
b: prefix_second
37213724
type: object
37223725
properties:
37233726
a:
@@ -3728,6 +3731,11 @@ paths:
37283731
- a
37293732
- b
37303733
additionalProperties: false
3734+
examples:
3735+
- a: first
3736+
b: prefix_first
3737+
- a: second
3738+
b: prefix_second
37313739
required:
37323740
- status
37333741
- data
@@ -3933,15 +3941,15 @@ paths:
39333941
type: string
39343942
const: success
39353943
data:
3936-
examples:
3937-
- num: 123
39383944
type: object
39393945
properties:
39403946
num:
39413947
type: number
39423948
required:
39433949
- num
39443950
additionalProperties: false
3951+
examples:
3952+
- num: 123
39453953
required:
39463954
- status
39473955
- data
@@ -4013,13 +4021,13 @@ paths:
40134021
type: object
40144022
properties:
40154023
key:
4024+
type: string
40164025
examples:
40174026
- 1234-56789-01
4018-
type: string
40194027
str:
4028+
type: string
40204029
examples:
40214030
- test
4022-
type: string
40234031
required:
40244032
- key
40254033
- str
@@ -4044,9 +4052,9 @@ paths:
40444052
type: object
40454053
properties:
40464054
num:
4055+
type: number
40474056
examples:
40484057
- 123
4049-
type: number
40504058
required:
40514059
- num
40524060
additionalProperties: false
@@ -4137,15 +4145,15 @@ paths:
41374145
type: string
41384146
const: success
41394147
data:
4140-
examples:
4141-
- numericStr: "123"
41424148
type: object
41434149
properties:
41444150
numericStr:
41454151
type: string
41464152
required:
41474153
- numericStr
41484154
additionalProperties: false
4155+
examples:
4156+
- numericStr: "123"
41494157
required:
41504158
- status
41514159
- data
@@ -4254,15 +4262,15 @@ paths:
42544262
type: string
42554263
const: success
42564264
data:
4257-
examples:
4258-
- numericStr: "123"
42594265
type: object
42604266
properties:
42614267
numericStr:
42624268
type: string
42634269
required:
42644270
- numericStr
42654271
additionalProperties: false
4272+
examples:
4273+
- numericStr: "123"
42664274
required:
42674275
- status
42684276
- data
@@ -4332,9 +4340,9 @@ paths:
43324340
required: true
43334341
description: GET /v1/getSomething Parameter
43344342
schema:
4343+
type: string
43354344
examples:
43364345
- "123"
4337-
type: string
43384346
examples:
43394347
example1:
43404348
value: "123"
@@ -4407,9 +4415,9 @@ paths:
44074415
required: true
44084416
description: HEAD /v1/getSomething Parameter
44094417
schema:
4418+
type: string
44104419
examples:
44114420
- "123"
4412-
type: string
44134421
examples:
44144422
example1:
44154423
value: "123"
@@ -4451,9 +4459,9 @@ paths:
44514459
type: object
44524460
properties:
44534461
strNum:
4462+
type: string
44544463
examples:
44554464
- "123"
4456-
type: string
44574465
required:
44584466
- strNum
44594467
examples:
@@ -4553,8 +4561,8 @@ paths:
45534561
required: true
45544562
description: here is the test
45554563
schema:
4556-
description: here is the test
45574564
type: string
4565+
description: here is the test
45584566
responses:
45594567
"200":
45604568
description: GET /v1/getSomething Positive response
@@ -4570,10 +4578,10 @@ paths:
45704578
type: object
45714579
properties:
45724580
result:
4573-
description: some positive integer
45744581
type: integer
45754582
exclusiveMinimum: 0
45764583
maximum: 9007199254740991
4584+
description: some positive integer
45774585
required:
45784586
- result
45794587
additionalProperties: false
@@ -4617,8 +4625,8 @@ paths:
46174625
required: true
46184626
description: here is the test
46194627
schema:
4620-
description: here is the test
46214628
type: string
4629+
description: here is the test
46224630
responses:
46234631
"200":
46244632
description: HEAD /v1/getSomething Positive response
@@ -5029,12 +5037,12 @@ paths:
50295037
components:
50305038
schemas:
50315039
NameParam:
5032-
id: NameParam
50335040
anyOf:
50345041
- type: string
50355042
const: John
50365043
- type: string
50375044
const: Jane
5045+
id: NameParam
50385046
responses: {}
50395047
parameters: {}
50405048
examples: {}

express-zod-api/tests/__snapshots__/env.spec.ts.snap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
6161
"type": "number",
6262
},
6363
"deferred": [],
64+
"parent": {
65+
"$schema": "https://json-schema.org/draft/2020-12/schema",
66+
"type": "number",
67+
},
6468
"parse": [Function],
6569
"pattern": /\\^-\\?\\\\d\\+\\$/,
6670
"processJSONSchema": [Function],
@@ -171,6 +175,12 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodNumb
171175
"onattach": [
172176
[Function],
173177
],
178+
"parent": {
179+
"$schema": "https://json-schema.org/draft/2020-12/schema",
180+
"maximum": 9007199254740991,
181+
"minimum": -9007199254740991,
182+
"type": "integer",
183+
},
174184
"parse": [Function],
175185
"pattern": /\\^-\\?\\\\d\\+\\$/,
176186
"processJSONSchema": [Function],
@@ -209,6 +219,10 @@ exports[`Environment checks > Zod checks/refinements > Snapshot control 'ZodStri
209219
"type": "string",
210220
},
211221
"deferred": [],
222+
"parent": {
223+
"$schema": "https://json-schema.org/draft/2020-12/schema",
224+
"type": "string",
225+
},
212226
"parse": [Function],
213227
"pattern": /\\^\\(\\?!\\\\\\.\\)\\(\\?!\\.\\*\\\\\\.\\\\\\.\\)\\(\\[A-Za-z0-9_'\\+\\\\-\\\\\\.\\]\\*\\)\\[A-Za-z0-9_\\+-\\]@\\(\\[A-Za-z0-9\\]\\[A-Za-z0-9\\\\-\\]\\*\\\\\\.\\)\\+\\[A-Za-z\\]\\{2,\\}\\$/,
214228
"processJSONSchema": [Function],

0 commit comments

Comments
 (0)