@kubb/adapter-oas 5.20.1 → 5.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/docs/options.md +92 -151
- package/docs/overview.md +33 -16
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/docs/options.md
CHANGED
|
@@ -4,25 +4,30 @@ Pass these options to `adapterOas()`. All of them are optional.
|
|
|
4
4
|
|
|
5
5
|
## Options overview
|
|
6
6
|
|
|
7
|
-
| Option | Purpose
|
|
8
|
-
| --------------------------------------- |
|
|
9
|
-
|
|
|
10
|
-
| [`
|
|
11
|
-
| [`
|
|
12
|
-
| [`
|
|
13
|
-
|
|
|
14
|
-
| [`
|
|
15
|
-
| [`
|
|
16
|
-
| [`
|
|
17
|
-
| [`
|
|
18
|
-
|
|
|
19
|
-
| [`
|
|
7
|
+
| Option | Purpose | Default |
|
|
8
|
+
| --------------------------------------- | ------------------------------------ | --------------------- |
|
|
9
|
+
| **Reading the spec** | | |
|
|
10
|
+
| [`validate`](#validate) | Validate the spec. | `true` |
|
|
11
|
+
| [`contentType`](#contenttype) | Media type to keep. | Every media type |
|
|
12
|
+
| [`server`](#server) | Server that sets `baseURL`. | None |
|
|
13
|
+
| **Schema shape** | | |
|
|
14
|
+
| [`discriminator`](#discriminator) | How discriminators apply. | `'preserve'` |
|
|
15
|
+
| [`enums`](#enums) | Where inline enums live. | `'inline'` |
|
|
16
|
+
| [`enumSuffix`](#enumsuffix) | Suffix of enum names. | `'enum'` |
|
|
17
|
+
| [`pathParamsCasing`](#pathparamscasing) | Rename path parameters to camelCase. | None |
|
|
18
|
+
| **Type mapping** | | |
|
|
19
|
+
| [`dateType`](#datetype) | Type of date and time fields. | `'string'` |
|
|
20
|
+
| [`integerType`](#integertype) | Type of `int64` and `uint64` fields. | `'bigint'` |
|
|
21
|
+
| [`unknownType`](#unknowntype) | Type of open values. | `'unknown'` |
|
|
22
|
+
| [`emptySchemaType`](#emptyschematype) | Type of empty schemas. | Same as `unknownType` |
|
|
20
23
|
|
|
21
24
|
## Option details
|
|
22
25
|
|
|
23
|
-
###
|
|
26
|
+
### Reading the spec
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
#### validate
|
|
29
|
+
|
|
30
|
+
Reports each spec problem as a [`KUBB_INVALID_SPEC`](https://kubb.dev/docs/5.x/reference/diagnostics#kubb-invalid-spec) warning, and generation continues. Set it to `false` to speed up a large spec. [`kubb validate`](https://kubb.dev/docs/5.x/reference/commands/validate) lists every error.
|
|
26
31
|
|
|
27
32
|
| | |
|
|
28
33
|
| -------- | --------- |
|
|
@@ -30,31 +35,46 @@ Validates the OpenAPI spec with `@readme/openapi-parser` before parsing. Each pr
|
|
|
30
35
|
| Required | `false` |
|
|
31
36
|
| Default | `true` |
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
> [!NOTE]
|
|
39
|
+
> OpenAPI 3.2 documents are not validated yet, and get one warning that says so.
|
|
40
|
+
|
|
41
|
+
#### contentType
|
|
34
42
|
|
|
35
|
-
Media type to keep when an operation declares
|
|
43
|
+
Media type to keep for request bodies and responses, also when an operation declares only one. A request body in another media type is dropped. A response in another media type gets [`emptySchemaType`](#emptyschematype).
|
|
36
44
|
|
|
37
45
|
| | |
|
|
38
46
|
| -------- | ------------------------------ |
|
|
39
47
|
| Type | `'application/json' \| string` |
|
|
40
48
|
| Required | `false` |
|
|
49
|
+
| Default | Every media type |
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
#### server
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
Picks the `servers` entry that becomes the document `baseURL`, and fills in its `{variable}` placeholders.
|
|
45
54
|
|
|
46
55
|
| | |
|
|
47
56
|
| -------- | -------------------------------------------------------- |
|
|
48
57
|
| Type | `{ index?: number, variables?: Record<string, string> }` |
|
|
49
58
|
| Required | `false` |
|
|
59
|
+
| Default | None, so `baseURL` is `null` |
|
|
50
60
|
|
|
51
|
-
|
|
61
|
+
- `index`: position in the `servers` array, usually `0`.
|
|
62
|
+
- `variables`: placeholder values. A variable you leave out uses its spec `default`.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// spec server: https://api.{env}.example.com
|
|
66
|
+
adapterOas({ server: { index: 0, variables: { env: 'prod' } } })
|
|
67
|
+
// baseURL: https://api.prod.example.com
|
|
68
|
+
```
|
|
52
69
|
|
|
53
|
-
|
|
70
|
+
> [!WARNING]
|
|
71
|
+
> Banners read this `baseURL` as `BannerMeta.baseURL`, but it does not set request URLs. For those, set `baseURL` on `@kubb/plugin-fetch`, `@kubb/plugin-axios`, or `@kubb/plugin-msw`.
|
|
54
72
|
|
|
55
|
-
###
|
|
73
|
+
### Schema shape
|
|
56
74
|
|
|
57
|
-
|
|
75
|
+
#### discriminator
|
|
76
|
+
|
|
77
|
+
How `discriminator` fields on `oneOf` and `anyOf` schemas apply.
|
|
58
78
|
|
|
59
79
|
| | |
|
|
60
80
|
| -------- | --------------------------- |
|
|
@@ -65,83 +85,18 @@ How `discriminator` fields on `oneOf`/`anyOf` schemas are interpreted.
|
|
|
65
85
|
::field-group
|
|
66
86
|
|
|
67
87
|
:::field{name="'preserve'"}
|
|
68
|
-
Keeps child schemas
|
|
88
|
+
Keeps child schemas as written. The parent union still narrows each branch.
|
|
69
89
|
:::
|
|
70
90
|
|
|
71
91
|
:::field{name="'propagate'"}
|
|
72
|
-
Also writes the discriminator
|
|
92
|
+
Also writes the discriminator literal into each child schema, so a child is narrowed on its own too.
|
|
73
93
|
:::
|
|
74
94
|
|
|
75
95
|
::
|
|
76
96
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```yaml [OpenAPI spec]
|
|
80
|
-
openapi: 3.0.3
|
|
81
|
-
components:
|
|
82
|
-
schemas:
|
|
83
|
-
Animal:
|
|
84
|
-
oneOf:
|
|
85
|
-
- $ref: '#/components/schemas/Cat'
|
|
86
|
-
- $ref: '#/components/schemas/Dog'
|
|
87
|
-
discriminator:
|
|
88
|
-
propertyName: type
|
|
89
|
-
mapping:
|
|
90
|
-
cat: '#/components/schemas/Cat'
|
|
91
|
-
dog: '#/components/schemas/Dog'
|
|
92
|
-
Cat:
|
|
93
|
-
type: object
|
|
94
|
-
properties:
|
|
95
|
-
type: { type: string }
|
|
96
|
-
indoor: { type: boolean }
|
|
97
|
-
Dog:
|
|
98
|
-
type: object
|
|
99
|
-
properties:
|
|
100
|
-
type: { type: string }
|
|
101
|
-
name: { type: string }
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
```typescript ['preserve' (default)]
|
|
105
|
-
export type Cat = {
|
|
106
|
-
type?: string;
|
|
107
|
-
indoor?: boolean;
|
|
108
|
-
};
|
|
97
|
+
#### enums
|
|
109
98
|
|
|
110
|
-
|
|
111
|
-
type?: string;
|
|
112
|
-
name?: string;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export type Animal = Cat & {
|
|
116
|
-
type: 'cat';
|
|
117
|
-
} | Dog & {
|
|
118
|
-
type: 'dog';
|
|
119
|
-
};
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
```typescript ['propagate']
|
|
123
|
-
export type Cat = {
|
|
124
|
-
type: 'cat';
|
|
125
|
-
indoor?: boolean;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export type Dog = {
|
|
129
|
-
type: 'dog';
|
|
130
|
-
name?: string;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export type Animal = Cat & {
|
|
134
|
-
type: 'cat';
|
|
135
|
-
} | Dog & {
|
|
136
|
-
type: 'dog';
|
|
137
|
-
};
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
::
|
|
141
|
-
|
|
142
|
-
### enums
|
|
143
|
-
|
|
144
|
-
Where inline enums live.
|
|
99
|
+
Where inline enums live. Names are the same in both modes.
|
|
145
100
|
|
|
146
101
|
| | |
|
|
147
102
|
| -------- | -------------------- |
|
|
@@ -156,12 +111,12 @@ Keeps each enum on the property that declares it.
|
|
|
156
111
|
:::
|
|
157
112
|
|
|
158
113
|
:::field{name="'root'"}
|
|
159
|
-
Lifts every inline enum to a top-level schema
|
|
114
|
+
Lifts every inline enum to a referenced top-level schema, such as `PetStatusEnum`. A plugin that writes one file per schema gives it its own file.
|
|
160
115
|
:::
|
|
161
116
|
|
|
162
117
|
::
|
|
163
118
|
|
|
164
|
-
|
|
119
|
+
For a `Pet.status` enum, `@kubb/plugin-ts` writes:
|
|
165
120
|
|
|
166
121
|
::code-group
|
|
167
122
|
|
|
@@ -198,9 +153,19 @@ export type Pet = {
|
|
|
198
153
|
|
|
199
154
|
::
|
|
200
155
|
|
|
201
|
-
|
|
156
|
+
#### enumSuffix
|
|
202
157
|
|
|
203
|
-
|
|
158
|
+
Suffix of inline enum names. The `status` enum on `Pet` becomes `PetStatusEnum`, or `PetStatusType` with `enumSuffix: 'type'`.
|
|
159
|
+
|
|
160
|
+
| | |
|
|
161
|
+
| -------- | -------- |
|
|
162
|
+
| Type | `string` |
|
|
163
|
+
| Required | `false` |
|
|
164
|
+
| Default | `'enum'` |
|
|
165
|
+
|
|
166
|
+
#### pathParamsCasing
|
|
167
|
+
|
|
168
|
+
Renames `path` parameters and their `{placeholder}` to camelCase, so `{pet-id}`, `{pet_id}`, and `{PetId}` become `petId` in clients, MSW routes, and query keys. The HTTP request and other parameters stay the same.
|
|
204
169
|
|
|
205
170
|
| | |
|
|
206
171
|
| -------- | ------------- |
|
|
@@ -208,8 +173,6 @@ Renames `path` parameters and their `{placeholder}` in the operation path. Omit
|
|
|
208
173
|
| Required | `false` |
|
|
209
174
|
| Default | `undefined` |
|
|
210
175
|
|
|
211
|
-
With `'camelcase'`, `{pet-id}`, `{pet_id}`, and `{PetId}` all become `petId`, and MSW routes and query keys use the same name. Names that collide get a counter suffix, so `{group-id}` and `{group.id}` become `groupId` and `groupId2`. Path parameter names never reach the wire, so the HTTP request stays the same. The one exception is the `matrix` style, which sends the name (`;group-id=42`), so an operation with a matrix path parameter keeps its spec names. Query, header, cookie, and body names are not changed.
|
|
212
|
-
|
|
213
176
|
For `GET /stores/{store-id}/pets/{pet-id}`, `@kubb/plugin-client` generates:
|
|
214
177
|
|
|
215
178
|
::code-group
|
|
@@ -224,9 +187,13 @@ await getPet({ path: { storeId, petId } })
|
|
|
224
187
|
|
|
225
188
|
::
|
|
226
189
|
|
|
227
|
-
|
|
190
|
+
An operation with a `matrix` path parameter keeps all its path parameter names, because a matrix value sends the name.
|
|
228
191
|
|
|
229
|
-
|
|
192
|
+
### Type mapping
|
|
193
|
+
|
|
194
|
+
#### dateType
|
|
195
|
+
|
|
196
|
+
How `date-time`, `date`, and `time` schemas are typed. One value sets all three.
|
|
230
197
|
|
|
231
198
|
| | |
|
|
232
199
|
| -------- | ----------------------------------------------------------------------------------------------- |
|
|
@@ -234,49 +201,35 @@ How `date-time`, `date`, and `time` schemas are represented downstream.
|
|
|
234
201
|
| Required | `false` |
|
|
235
202
|
| Default | `'string'` |
|
|
236
203
|
|
|
237
|
-
Pass a single value to apply it to all three formats:
|
|
238
|
-
|
|
239
204
|
::field-group
|
|
240
205
|
|
|
241
|
-
:::field{name="
|
|
242
|
-
|
|
206
|
+
:::field{name="'string'"}
|
|
207
|
+
Types all three as ISO 8601 strings.
|
|
243
208
|
:::
|
|
244
209
|
|
|
245
|
-
:::field{name="
|
|
246
|
-
|
|
210
|
+
:::field{name="false"}
|
|
211
|
+
Types all three as plain strings, with no format check.
|
|
247
212
|
:::
|
|
248
213
|
|
|
249
214
|
:::field{name="'stringOffset'"}
|
|
250
|
-
|
|
215
|
+
Like `'string'`, with a timezone offset on `date-time`.
|
|
251
216
|
:::
|
|
252
217
|
|
|
253
218
|
:::field{name="'stringLocal'"}
|
|
254
|
-
|
|
219
|
+
Like `'string'`, with no timezone on `date-time`.
|
|
255
220
|
:::
|
|
256
221
|
|
|
257
222
|
:::field{name="'date'"}
|
|
258
|
-
|
|
223
|
+
Types all three as a JavaScript `Date`, which needs parsing to revive from JSON.
|
|
259
224
|
:::
|
|
260
225
|
|
|
261
226
|
::
|
|
262
227
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Pass an object to set `dateTime`, `date`, and `time` independently. A key that is left out defaults to `'string'`, regardless of the other keys.
|
|
266
|
-
|
|
267
|
-
```ts
|
|
268
|
-
adapterOas({
|
|
269
|
-
dateType: {
|
|
270
|
-
dateTime: 'date', // Date object for timestamps
|
|
271
|
-
date: 'string',
|
|
272
|
-
time: 'string',
|
|
273
|
-
},
|
|
274
|
-
})
|
|
275
|
-
```
|
|
228
|
+
To type each format on its own, pass an object. `dateTime` takes every value above, `date` and `time` take `false`, `'string'`, or `'date'`, and a key you leave out is `'string'`.
|
|
276
229
|
|
|
277
|
-
|
|
230
|
+
#### integerType
|
|
278
231
|
|
|
279
|
-
How
|
|
232
|
+
How `format: int64` and `format: uint64` integers are typed. Other integers are always `number`.
|
|
280
233
|
|
|
281
234
|
| | |
|
|
282
235
|
| -------- | ---------------------- |
|
|
@@ -287,20 +240,18 @@ How a schema with `format: int64` or `format: uint64` maps to TypeScript. Other
|
|
|
287
240
|
::field-group
|
|
288
241
|
|
|
289
242
|
:::field{name="'bigint'"}
|
|
290
|
-
|
|
243
|
+
Keeps 64-bit IDs exact. `JSON.stringify` and `JSON.parse` cannot round-trip a bigint, so use it only when the app handles bigint serialization.
|
|
291
244
|
:::
|
|
292
245
|
|
|
293
246
|
:::field{name="'number'"}
|
|
294
|
-
Fits most JSON APIs.
|
|
247
|
+
Fits most JSON APIs. Loses precision above `Number.MAX_SAFE_INTEGER`.
|
|
295
248
|
:::
|
|
296
249
|
|
|
297
250
|
::
|
|
298
251
|
|
|
299
|
-
|
|
252
|
+
#### unknownType
|
|
300
253
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
AST type used where the spec allows any value but gives no schema for it: the values of `additionalProperties: {}`, a `patternProperties` entry set to `true` or `{}`, the extra items of an open `prefixItems` tuple, and a parameter without a `schema`. `additionalProperties: true` is not affected, and `@kubb/plugin-ts` always types its values as `unknown`.
|
|
254
|
+
Type of a value the spec leaves open, such as the values of `additionalProperties: {}` or a parameter without a `schema`.
|
|
304
255
|
|
|
305
256
|
| | |
|
|
306
257
|
| -------- | ------------------------------ |
|
|
@@ -311,38 +262,28 @@ AST type used where the spec allows any value but gives no schema for it: the va
|
|
|
311
262
|
::field-group
|
|
312
263
|
|
|
313
264
|
:::field{name="'unknown'"}
|
|
314
|
-
|
|
265
|
+
Callers must narrow the value before they use it.
|
|
315
266
|
:::
|
|
316
267
|
|
|
317
268
|
:::field{name="'any'"}
|
|
318
|
-
|
|
269
|
+
Callers can use the value without type checks.
|
|
319
270
|
:::
|
|
320
271
|
|
|
321
272
|
:::field{name="'void'"}
|
|
322
|
-
|
|
273
|
+
Marks a value callers should not use, to match a legacy API.
|
|
323
274
|
:::
|
|
324
275
|
|
|
325
276
|
::
|
|
326
277
|
|
|
327
|
-
|
|
278
|
+
#### emptySchemaType
|
|
328
279
|
|
|
329
|
-
|
|
280
|
+
Type of a schema with nothing to infer a type from, such as `{}` or a response without a schema. It takes the [`unknownType`](#unknowntype) values.
|
|
330
281
|
|
|
331
|
-
| |
|
|
332
|
-
| -------- |
|
|
333
|
-
| Type | `'any' \| 'unknown' \| 'void'`
|
|
334
|
-
| Required | `false`
|
|
335
|
-
| Default | `unknownType
|
|
282
|
+
| | |
|
|
283
|
+
| -------- | ---------------------------------------- |
|
|
284
|
+
| Type | `'any' \| 'unknown' \| 'void'` |
|
|
285
|
+
| Required | `false` |
|
|
286
|
+
| Default | `unknownType`, so `'unknown'` by default |
|
|
336
287
|
|
|
337
288
|
> [!TIP]
|
|
338
|
-
>
|
|
339
|
-
|
|
340
|
-
### enumSuffix
|
|
341
|
-
|
|
342
|
-
Suffix for the names Kubb gives inline enums: schema name, property name, and suffix, in PascalCase. The `status` enum on `Pet` becomes `PetStatusEnum`, or `PetStatusType` with `enumSuffix: 'type'`. Plugins derive their own names from it, such as `petStatusEnum` and `PetStatusEnumKey` in `@kubb/plugin-ts`.
|
|
343
|
-
|
|
344
|
-
| | |
|
|
345
|
-
| -------- | -------- |
|
|
346
|
-
| Type | `string` |
|
|
347
|
-
| Required | `false` |
|
|
348
|
-
| Default | `'enum'` |
|
|
289
|
+
> Pair `unknownType: 'unknown'` with `emptySchemaType: 'any'` to keep empty 204 bodies easy to use.
|
package/docs/overview.md
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
# OpenAPI
|
|
2
2
|
|
|
3
|
-
The OpenAPI adapter
|
|
3
|
+
The OpenAPI adapter reads an OpenAPI 2.0, 3.0, 3.1, or 3.2 spec and converts it into the AST that every plugin generates code from.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- It is the first step of every build, so its options apply to all plugins.
|
|
6
|
+
- It downloads a remote `input` URL and any remote `$ref` with a plain GET request, without credentials.
|
|
7
|
+
- It reads the local files that external `$ref`s point to, even outside the spec's folder, unless the host limits them, as a Kubb Studio agent does. See [External refs](https://kubb.dev/docs/5.x/reference/configuration#external-refs). It never writes files.
|
|
6
8
|
|
|
7
9
|
## Setup
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
No setup is needed. `defineConfig` uses `adapterOas()` by default. Set `adapter` only to change its options.
|
|
10
12
|
|
|
11
13
|
## Options worth knowing
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
| Option | Default | What it does |
|
|
16
|
+
| ------------------------------------------------------------------------------------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| [`validate`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#validate) | `true` | Checks the spec and reports each problem as a warning. Turn it off to speed up a large spec. |
|
|
18
|
+
| [`dateType`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#datetype) | `'string'` | Types `date-time`, `date`, and `time` as strings or as `Date` objects. |
|
|
19
|
+
| [`integerType`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#integertype) | `'bigint'` | Types `int64` and `uint64` as `bigint` or `number`. Choose `'number'` for most JSON APIs. |
|
|
20
|
+
| [`enums`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#enums) | `'inline'` | `'root'` lifts inline enums to top-level schemas, such as `PetStatusEnum`. |
|
|
21
|
+
| [`discriminator`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#discriminator) | `'preserve'` | `'propagate'` writes the discriminator value into each child schema. |
|
|
22
|
+
| [`pathParamsCasing`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#pathparamscasing) | None | `'camelcase'` renames path parameters, such as `{pet-id}` to `petId`. |
|
|
23
|
+
| [`server`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#server) | None | Picks the `servers` entry that becomes the document `baseURL`. It does not change where a client sends requests. |
|
|
24
|
+
| [`contentType`](https://kubb.dev/extensions/kubb-labs/adapter-oas/options#contenttype) | Every media type | Keeps one media type when an operation declares several. |
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
Run [`kubb validate`](https://kubb.dev/docs/5.x/reference/commands/validate) to list every spec error.
|
|
23
27
|
|
|
24
28
|
## Example
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
This config types dates as `Date` objects and 64-bit integers as numbers, so `@kubb/plugin-ts` writes this `Order` type:
|
|
31
|
+
|
|
32
|
+
::code-group
|
|
27
33
|
|
|
28
34
|
```typescript [kubb.config.ts]
|
|
29
35
|
import { defineConfig } from 'kubb/config'
|
|
@@ -34,8 +40,19 @@ export default defineConfig({
|
|
|
34
40
|
input: './petStore.yaml',
|
|
35
41
|
output: { path: './src/gen' },
|
|
36
42
|
adapter: adapterOas({ dateType: 'date', integerType: 'number' }),
|
|
37
|
-
plugins: [
|
|
38
|
-
pluginTs(),
|
|
39
|
-
],
|
|
43
|
+
plugins: [pluginTs()],
|
|
40
44
|
})
|
|
41
45
|
```
|
|
46
|
+
|
|
47
|
+
```typescript [src/gen/types/Order.ts]
|
|
48
|
+
// excerpt, without JSDoc
|
|
49
|
+
export type Order = {
|
|
50
|
+
id?: number // int64, `bigint` by default
|
|
51
|
+
petId?: number
|
|
52
|
+
quantity?: number // int32
|
|
53
|
+
shipDate?: Date // date-time, `string` by default
|
|
54
|
+
complete?: boolean
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
::
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/adapter-oas",
|
|
3
|
-
"version": "5.20.
|
|
3
|
+
"version": "5.20.2",
|
|
4
4
|
"description": "OpenAPI and Swagger adapter for Kubb. Parses and validates OAS 2.0/3.x specifications into a @kubb/ast RootNode for downstream code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"registry": "https://registry.npmjs.org/"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@kubb/core": "^5.20.
|
|
70
|
-
"@kubb/kit": "5.20.
|
|
69
|
+
"@kubb/core": "^5.20.2",
|
|
70
|
+
"@kubb/kit": "5.20.2",
|
|
71
71
|
"@readme/openapi-parser": "^10.0.0",
|
|
72
72
|
"@scalar/openapi-upgrader": "^0.4.7",
|
|
73
73
|
"api-ref-bundler": "0.5.1",
|