Skip to content

Commit

Permalink
Merge pull request #4588 from reduxjs/bugfix/rtkqcg-oazapfts-6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Aug 30, 2024
2 parents ac4d85e + 6d4563d commit 35791bc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/rtk-query-codegen-openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@apidevtools/swagger-parser": "^10.0.2",
"commander": "^6.2.0",
"lodash": "^4.17.21",
"oazapfts": "^6.0.2",
"oazapfts": "^6.1.0",
"prettier": "^3.2.5",
"semver": "^7.3.5",
"swagger2openapi": "^7.0.4",
Expand Down
5 changes: 4 additions & 1 deletion packages/rtk-query-codegen-openapi/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ export async function generateApi(
const schema = apiGen.getSchemaFromContent(body.content);
const type = apiGen.getTypeFromSchema(schema);
const schemaName = camelCase(
(type as any).name || getReferenceName(schema) || ('title' in schema && schema.title) || 'body'
(type as any).name ||
getReferenceName(schema) ||
(typeof schema === 'object' && 'title' in schema && schema.title) ||
'body'
);
const name = generateName(schemaName in queryArg ? 'body' : schemaName, 'body');

Expand Down
26 changes: 17 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8251,7 +8251,7 @@ __metadata:
lodash: "npm:^4.17.21"
msw: "npm:^2.1.5"
node-fetch: "npm:^3.3.2"
oazapfts: "npm:^6.0.2"
oazapfts: "npm:^6.1.0"
openapi-types: "npm:^9.1.0"
prettier: "npm:^3.2.5"
pretty-quick: "npm:^4.0.0"
Expand Down Expand Up @@ -22292,20 +22292,21 @@ __metadata:
languageName: node
linkType: hard

"oazapfts@npm:^6.0.2":
version: 6.0.2
resolution: "oazapfts@npm:6.0.2"
"oazapfts@npm:^6.1.0":
version: 6.1.0
resolution: "oazapfts@npm:6.1.0"
dependencies:
"@apidevtools/swagger-parser": "npm:^10.1.0"
lodash: "npm:^4.17.21"
minimist: "npm:^1.2.8"
swagger2openapi: "npm:^7.0.8"
typescript: "npm:^5.3.3"
tapable: "npm:^2.2.1"
typescript: "npm:^5.4.5"
peerDependencies:
"@oazapfts/runtime": "*"
bin:
oazapfts: dist/cli.js
checksum: 10/9132e4bbc589cefba2b93a2421309c89e7685cf75108ac8611d93f78c4e985a0d95829feb2f2b109fa22cb6feb12a6a1e03a679bba9892633c22fe9fb21bd91c
oazapfts: cli.js
checksum: 10/804c3936702acf66bb9bcff6bdcdce2708783b31c83262d7097fb04a53d3720d96114cec345408cbf3f933f9c5d198815457853a07362796c6a6d5db7a31d150
languageName: node
linkType: hard

Expand Down Expand Up @@ -28272,6 +28273,13 @@ __metadata:
languageName: node
linkType: hard

"tapable@npm:^2.2.1":
version: 2.2.1
resolution: "tapable@npm:2.2.1"
checksum: 10/1769336dd21481ae6347611ca5fca47add0962fd8e80466515032125eca0084a4f0ede11e65341b9c0018ef4e1cf1ad820adbb0fba7cc99865c6005734000b0a
languageName: node
linkType: hard

"tar@npm:^6.0.2, tar@npm:^6.1.0":
version: 6.1.0
resolution: "tar@npm:6.1.0"
Expand Down Expand Up @@ -29157,7 +29165,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.3.3, typescript@npm:^5.5.4":
"typescript@npm:^5.3.3, typescript@npm:^5.4.5, typescript@npm:^5.5.4":
version: 5.5.4
resolution: "typescript@npm:5.5.4"
bin:
Expand Down Expand Up @@ -29217,7 +29225,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
"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>":
version: 5.5.4
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=d69c25"
bin:
Expand Down

0 comments on commit 35791bc

Please sign in to comment.