Skip to content

Commit 35791bc

Browse files
authored
Merge pull request #4588 from reduxjs/bugfix/rtkqcg-oazapfts-6.1
2 parents ac4d85e + 6d4563d commit 35791bc

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

packages/rtk-query-codegen-openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@apidevtools/swagger-parser": "^10.0.2",
6262
"commander": "^6.2.0",
6363
"lodash": "^4.17.21",
64-
"oazapfts": "^6.0.2",
64+
"oazapfts": "^6.1.0",
6565
"prettier": "^3.2.5",
6666
"semver": "^7.3.5",
6767
"swagger2openapi": "^7.0.4",

packages/rtk-query-codegen-openapi/src/generate.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ export async function generateApi(
299299
const schema = apiGen.getSchemaFromContent(body.content);
300300
const type = apiGen.getTypeFromSchema(schema);
301301
const schemaName = camelCase(
302-
(type as any).name || getReferenceName(schema) || ('title' in schema && schema.title) || 'body'
302+
(type as any).name ||
303+
getReferenceName(schema) ||
304+
(typeof schema === 'object' && 'title' in schema && schema.title) ||
305+
'body'
303306
);
304307
const name = generateName(schemaName in queryArg ? 'body' : schemaName, 'body');
305308

yarn.lock

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8251,7 +8251,7 @@ __metadata:
82518251
lodash: "npm:^4.17.21"
82528252
msw: "npm:^2.1.5"
82538253
node-fetch: "npm:^3.3.2"
8254-
oazapfts: "npm:^6.0.2"
8254+
oazapfts: "npm:^6.1.0"
82558255
openapi-types: "npm:^9.1.0"
82568256
prettier: "npm:^3.2.5"
82578257
pretty-quick: "npm:^4.0.0"
@@ -22292,20 +22292,21 @@ __metadata:
2229222292
languageName: node
2229322293
linkType: hard
2229422294

22295-
"oazapfts@npm:^6.0.2":
22296-
version: 6.0.2
22297-
resolution: "oazapfts@npm:6.0.2"
22295+
"oazapfts@npm:^6.1.0":
22296+
version: 6.1.0
22297+
resolution: "oazapfts@npm:6.1.0"
2229822298
dependencies:
2229922299
"@apidevtools/swagger-parser": "npm:^10.1.0"
2230022300
lodash: "npm:^4.17.21"
2230122301
minimist: "npm:^1.2.8"
2230222302
swagger2openapi: "npm:^7.0.8"
22303-
typescript: "npm:^5.3.3"
22303+
tapable: "npm:^2.2.1"
22304+
typescript: "npm:^5.4.5"
2230422305
peerDependencies:
2230522306
"@oazapfts/runtime": "*"
2230622307
bin:
22307-
oazapfts: dist/cli.js
22308-
checksum: 10/9132e4bbc589cefba2b93a2421309c89e7685cf75108ac8611d93f78c4e985a0d95829feb2f2b109fa22cb6feb12a6a1e03a679bba9892633c22fe9fb21bd91c
22308+
oazapfts: cli.js
22309+
checksum: 10/804c3936702acf66bb9bcff6bdcdce2708783b31c83262d7097fb04a53d3720d96114cec345408cbf3f933f9c5d198815457853a07362796c6a6d5db7a31d150
2230922310
languageName: node
2231022311
linkType: hard
2231122312

@@ -28272,6 +28273,13 @@ __metadata:
2827228273
languageName: node
2827328274
linkType: hard
2827428275

28276+
"tapable@npm:^2.2.1":
28277+
version: 2.2.1
28278+
resolution: "tapable@npm:2.2.1"
28279+
checksum: 10/1769336dd21481ae6347611ca5fca47add0962fd8e80466515032125eca0084a4f0ede11e65341b9c0018ef4e1cf1ad820adbb0fba7cc99865c6005734000b0a
28280+
languageName: node
28281+
linkType: hard
28282+
2827528283
"tar@npm:^6.0.2, tar@npm:^6.1.0":
2827628284
version: 6.1.0
2827728285
resolution: "tar@npm:6.1.0"
@@ -29157,7 +29165,7 @@ __metadata:
2915729165
languageName: node
2915829166
linkType: hard
2915929167

29160-
"typescript@npm:^5.3.3, typescript@npm:^5.5.4":
29168+
"typescript@npm:^5.3.3, typescript@npm:^5.4.5, typescript@npm:^5.5.4":
2916129169
version: 5.5.4
2916229170
resolution: "typescript@npm:5.5.4"
2916329171
bin:
@@ -29217,7 +29225,7 @@ __metadata:
2921729225
languageName: node
2921829226
linkType: hard
2921929227

29220-
"typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
29228+
"typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.4.5#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
2922129229
version: 5.5.4
2922229230
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=d69c25"
2922329231
bin:

0 commit comments

Comments
 (0)