@pikku/openapi-parser 0.12.10 → 0.12.11
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/CHANGELOG.md +8 -1
- package/package.json +2 -2
- package/src/parse-openapi.test.ts +23 -8
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# @pikku/openapi-parser
|
|
2
2
|
|
|
3
|
+
## 0.12.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
|
|
8
|
+
|
|
9
|
+
All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.
|
|
10
|
+
|
|
3
11
|
## 0.12.10
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
6
14
|
|
|
7
15
|
- 02fca80: Fix OpenAPI-to-addon codegen robustness across 2521 real-world specs (77% → 97.8% pass rate).
|
|
8
|
-
|
|
9
16
|
- Cycle detection and depth limits in schema generation to prevent stack overflows
|
|
10
17
|
- Schema partitioning: shared types file for multi-referenced schemas, inline for single-use (fixes crash on large specs)
|
|
11
18
|
- Topological sort with z.lazy() for circular schema references
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/openapi-parser",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.11",
|
|
4
4
|
"description": "OpenAPI spec parser and code generator for Pikku",
|
|
5
5
|
"author": "yasser.fadl@gmail.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"yaml": "^2.7.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"typescript": "^
|
|
24
|
+
"typescript": "^6.0.3"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -166,7 +166,11 @@ describe('parseOpenAPISpec — Swagger 2.0', () => {
|
|
|
166
166
|
properties: {
|
|
167
167
|
id: { type: 'integer', format: 'int64' },
|
|
168
168
|
name: { type: 'string' },
|
|
169
|
-
status: {
|
|
169
|
+
status: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
enum: ['available', 'sold'],
|
|
172
|
+
description: 'pet status',
|
|
173
|
+
},
|
|
170
174
|
},
|
|
171
175
|
},
|
|
172
176
|
},
|
|
@@ -179,7 +183,12 @@ describe('parseOpenAPISpec — Swagger 2.0', () => {
|
|
|
179
183
|
operationId: 'listPets',
|
|
180
184
|
summary: 'List all pets',
|
|
181
185
|
parameters: [
|
|
182
|
-
{
|
|
186
|
+
{
|
|
187
|
+
in: 'query',
|
|
188
|
+
name: 'status',
|
|
189
|
+
type: 'string',
|
|
190
|
+
description: 'Filter by status',
|
|
191
|
+
},
|
|
183
192
|
],
|
|
184
193
|
responses: {
|
|
185
194
|
'200': {
|
|
@@ -254,7 +263,9 @@ describe('parseOpenAPISpec — Swagger 2.0', () => {
|
|
|
254
263
|
|
|
255
264
|
test('extracts requestBody from body parameter', async () => {
|
|
256
265
|
const spec = await parseOpenAPISpec(specPath)
|
|
257
|
-
const createPet = spec.operations.find(
|
|
266
|
+
const createPet = spec.operations.find(
|
|
267
|
+
(op) => op.operationId === 'createPet'
|
|
268
|
+
)
|
|
258
269
|
assert.ok(createPet?.requestBody)
|
|
259
270
|
assert.equal(createPet.requestBody.type, 'object')
|
|
260
271
|
assert.ok(createPet.requestBody.properties?.name)
|
|
@@ -264,25 +275,27 @@ describe('parseOpenAPISpec — Swagger 2.0', () => {
|
|
|
264
275
|
|
|
265
276
|
test('extracts responseSchema from Swagger 2.0 response', async () => {
|
|
266
277
|
const spec = await parseOpenAPISpec(specPath)
|
|
267
|
-
const createPet = spec.operations.find(
|
|
278
|
+
const createPet = spec.operations.find(
|
|
279
|
+
(op) => op.operationId === 'createPet'
|
|
280
|
+
)
|
|
268
281
|
assert.ok(createPet?.responseSchema)
|
|
269
282
|
assert.equal(createPet.responseSchema.type, 'object')
|
|
270
283
|
|
|
271
|
-
const listPets = spec.operations.find(op => op.operationId === 'listPets')
|
|
284
|
+
const listPets = spec.operations.find((op) => op.operationId === 'listPets')
|
|
272
285
|
assert.ok(listPets?.responseSchema)
|
|
273
286
|
assert.equal(listPets.responseSchema.type, 'array')
|
|
274
287
|
})
|
|
275
288
|
|
|
276
289
|
test('extracts query params', async () => {
|
|
277
290
|
const spec = await parseOpenAPISpec(specPath)
|
|
278
|
-
const listPets = spec.operations.find(op => op.operationId === 'listPets')
|
|
291
|
+
const listPets = spec.operations.find((op) => op.operationId === 'listPets')
|
|
279
292
|
assert.equal(listPets?.queryParams.length, 1)
|
|
280
293
|
assert.equal(listPets?.queryParams[0].name, 'status')
|
|
281
294
|
})
|
|
282
295
|
|
|
283
296
|
test('extracts path params', async () => {
|
|
284
297
|
const spec = await parseOpenAPISpec(specPath)
|
|
285
|
-
const getPet = spec.operations.find(op => op.operationId === 'getPet')
|
|
298
|
+
const getPet = spec.operations.find((op) => op.operationId === 'getPet')
|
|
286
299
|
assert.equal(getPet?.pathParams.length, 1)
|
|
287
300
|
assert.equal(getPet?.pathParams[0].name, 'petId')
|
|
288
301
|
assert.equal(getPet?.pathParams[0].required, true)
|
|
@@ -290,7 +303,9 @@ describe('parseOpenAPISpec — Swagger 2.0', () => {
|
|
|
290
303
|
|
|
291
304
|
test('extracts error responses', async () => {
|
|
292
305
|
const spec = await parseOpenAPISpec(specPath)
|
|
293
|
-
const createPet = spec.operations.find(
|
|
306
|
+
const createPet = spec.operations.find(
|
|
307
|
+
(op) => op.operationId === 'createPet'
|
|
308
|
+
)
|
|
294
309
|
assert.equal(createPet?.errorResponses.length, 1)
|
|
295
310
|
assert.equal(createPet?.errorResponses[0].statusCode, 400)
|
|
296
311
|
})
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/codegen.ts","./src/index.ts","./src/naming.ts","./src/openapi-to-zod-schema.ts","./src/parse-openapi.ts","./src/zod-codegen.ts"],"version":"
|
|
1
|
+
{"root":["./src/codegen.ts","./src/index.ts","./src/naming.ts","./src/openapi-to-zod-schema.ts","./src/parse-openapi.ts","./src/zod-codegen.ts"],"version":"6.0.3"}
|