fork of hey-api/openapi-ts because I need some additional things
1{
2 "openapi": "3.1.0",
3 "info": {
4 "title": "swagger",
5 "version": "v1.0"
6 },
7 "servers": [
8 {
9 "url": "http://localhost:3000/base"
10 }
11 ],
12 "paths": {
13 "/api/model-with-dates": {
14 "post": {
15 "operationId": "parentModelWithDates",
16 "responses": {
17 "200": {
18 "description": "Success",
19 "content": {
20 "application/json; type=collection": {
21 "schema": {
22 "$ref": "#/components/schemas/ParentModelWithDates"
23 }
24 }
25 }
26 },
27 "201": {
28 "description": "Success",
29 "content": {
30 "application/json; type=collection": {
31 "schema": {
32 "$ref": "#/components/schemas/ParentModelWithDates"
33 }
34 }
35 }
36 }
37 }
38 },
39 "put": {
40 "operationId": "modelWithDates",
41 "responses": {
42 "200": {
43 "description": "Success",
44 "content": {
45 "application/json; type=collection": {
46 "schema": {
47 "$ref": "#/components/schemas/ModelWithDates"
48 }
49 }
50 }
51 }
52 }
53 }
54 },
55 "/api/model-with-dates-array": {
56 "put": {
57 "operationId": "modelWithDatesArray",
58 "responses": {
59 "200": {
60 "description": "Success",
61 "content": {
62 "application/json; type=collection": {
63 "schema": {
64 "type": "array",
65 "items": {
66 "$ref": "#/components/schemas/ModelWithDates"
67 }
68 }
69 }
70 }
71 }
72 }
73 }
74 },
75 "/api/array-of-dates": {
76 "put": {
77 "operationId": "arrayOfDates",
78 "responses": {
79 "200": {
80 "description": "Success",
81 "content": {
82 "application/json; type=collection": {
83 "schema": {
84 "type": "array",
85 "items": {
86 "type": "string",
87 "format": "date-time"
88 }
89 }
90 }
91 }
92 }
93 }
94 }
95 },
96 "/api/multiple-responses": {
97 "put": {
98 "operationId": "multiple-responses",
99 "responses": {
100 "200": {
101 "description": "Updated",
102 "content": {
103 "application/json; type=collection": {
104 "schema": {
105 "type": "array",
106 "items": {
107 "$ref": "#/components/schemas/ModelWithDates"
108 }
109 }
110 }
111 }
112 },
113 "201": {
114 "description": "Created",
115 "content": {
116 "application/json; type=collection": {
117 "schema": {
118 "type": "array",
119 "items": {
120 "$ref": "#/components/schemas/SimpleModel"
121 }
122 }
123 }
124 }
125 }
126 }
127 }
128 },
129 "/api/no-response-transformer": {
130 "put": {
131 "responses": {
132 "200": {
133 "description": "Updated",
134 "content": {
135 "application/json; type=collection": {
136 "schema": {
137 "type": "array",
138 "items": {
139 "$ref": "#/components/schemas/SimpleModel"
140 }
141 }
142 }
143 }
144 }
145 }
146 }
147 },
148 "/api/simple-date-response": {
149 "post": {
150 "responses": {
151 "200": {
152 "description": "Simple date string",
153 "content": {
154 "application/json": {
155 "schema": {
156 "type": "string",
157 "format": "date-time"
158 }
159 }
160 }
161 }
162 }
163 },
164 "put": {
165 "responses": {
166 "200": {
167 "description": "Simple date string ref",
168 "content": {
169 "application/json": {
170 "schema": {
171 "$ref": "#/components/schemas/DateString"
172 }
173 }
174 }
175 }
176 }
177 }
178 }
179 },
180 "components": {
181 "schemas": {
182 "DateString": {
183 "type": "string",
184 "format": "date-time"
185 },
186 "SimpleModel": {
187 "description": "This is a model that contains a some dates",
188 "type": "object",
189 "required": ["id", "name", "enabled"],
190 "properties": {
191 "id": {
192 "type": "number"
193 },
194 "name": {
195 "maxLength": 255,
196 "type": "string"
197 },
198 "enabled": {
199 "type": "boolean",
200 "readOnly": true
201 }
202 }
203 },
204 "ModelWithDates": {
205 "description": "This is a model that contains a some dates",
206 "type": "object",
207 "required": ["id", "name", "enabled", "modified"],
208 "properties": {
209 "id": {
210 "type": "number"
211 },
212 "name": {
213 "maxLength": 255,
214 "type": "string"
215 },
216 "enabled": {
217 "type": "boolean",
218 "readOnly": true
219 },
220 "modified": {
221 "type": "string",
222 "format": "date-time",
223 "readOnly": true
224 },
225 "expires": {
226 "type": "string",
227 "format": "date",
228 "readOnly": true
229 }
230 }
231 },
232 "ParentModelWithDates": {
233 "description": "This is a model that contains a some dates and arrays",
234 "type": "object",
235 "required": ["id", "name"],
236 "properties": {
237 "id": {
238 "type": "number"
239 },
240 "modified": {
241 "type": "string",
242 "format": "date-time",
243 "readOnly": true
244 },
245 "items": {
246 "type": "array",
247 "items": {
248 "$ref": "#/components/schemas/ModelWithDates"
249 }
250 },
251 "item": {
252 "$ref": "#/components/schemas/ModelWithDates"
253 },
254 "nullable-date": {
255 "type": "array",
256 "items": {
257 "anyOf": [
258 { "type": "string", "format": "date-time" },
259 { "type": "null" }
260 ]
261 }
262 },
263 "simpleItems": {
264 "type": "array",
265 "items": {
266 "$ref": "#/components/schemas/SimpleModel"
267 }
268 },
269 "simpleItem": {
270 "$ref": "#/components/schemas/SimpleModel"
271 },
272 "dates": {
273 "type": "array",
274 "items": {
275 "type": "string",
276 "format": "date-time"
277 }
278 },
279 "strings": {
280 "type": "array",
281 "items": {
282 "type": "string"
283 }
284 }
285 }
286 }
287 }
288 }
289}