File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed
packages/rtk-query-codegen-openapi Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 6363 "docs/react-dom" : " npm:17.0.2" ,
6464 "docs/@types/react-dom" : " npm:17.0.11" ,
6565 "docs/@types/react" : " npm:17.0.11" ,
66- "type-fest" : " 2.19.0" ,
67- "oazapfts" : " 4.8.0"
66+ "type-fest" : " 2.19.0"
6867 },
6968 "scripts" : {
7069 "build" : " yarn build:packages" ,
Original file line number Diff line number Diff line change @@ -103,6 +103,11 @@ export async function generateApi(
103103 useEnumType,
104104 } ) ;
105105
106+ // temporary workaround for https://github.com/oazapfts/oazapfts/issues/491
107+ if ( apiGen . spec . components ?. schemas ) {
108+ apiGen . preprocessComponents ( apiGen . spec . components . schemas ) ;
109+ }
110+
106111 const operationDefinitions = getOperationDefinitions ( v3Doc ) . filter ( operationMatches ( filterEndpoints ) ) ;
107112
108113 const resultFile = ts . createSourceFile (
Original file line number Diff line number Diff line change @@ -773,17 +773,21 @@ export type GetApiV1AnimalsApiArg = {
773773 type?: AnimalType;
774774};
775775export type AnimalType = 'All' | 'Cats' | 'Dogs';
776- export type Animal = {
776+ export type AnimalBase = {
777777 type: AnimalType;
778778 id?: number;
779779 name?: string | null;
780780};
781- export type Dog = Animal & {
782- dogUniqueProp?: string | null;
783- };
784- export type Cat = Animal & {
785- catUniqueProp?: string | null;
786- };
781+ export type Dog = {
782+ type: 'Dog';
783+ } & AnimalBase & {
784+ dogUniqueProp?: string | null;
785+ };
786+ export type Cat = {
787+ type: 'Cat';
788+ } & AnimalBase & {
789+ catUniqueProp?: string | null;
790+ };
787791export const { useGetApiV1AnimalsQuery } = injectedRtkApi;
788792
789793`;
Original file line number Diff line number Diff line change @@ -20493,9 +20493,9 @@ fsevents@^1.2.7:
2049320493 languageName: node
2049420494 linkType: hard
2049520495
20496- "oazapfts@npm:4.8.0":
20497- version: 4.8 .0
20498- resolution: "oazapfts@npm:4.8 .0"
20496+ "oazapfts@npm:^ 4.8.0":
20497+ version: 4.10 .0
20498+ resolution: "oazapfts@npm:4.10 .0"
2049920499 dependencies:
2050020500 "@apidevtools/swagger-parser": ^10.1.0
2050120501 lodash: ^4.17.21
@@ -20504,7 +20504,7 @@ fsevents@^1.2.7:
2050420504 typescript: ^5.2.2
2050520505 bin:
2050620506 oazapfts: lib/codegen/cli.js
20507- checksum: 0f3850767a1c18c02a2c002981f3d89304643ecd425d4723f0d73efebddaa3a13d9e7436a070cdd211b24a5fecd270e03686de91d316b3361de64413d2c2a7ee
20507+ checksum: dbed3d73ba2c3a758b3e5a9ffb62486c628f020232ad513bceb0562a437a45350cc5262689191c664423980421d9f2690b9574a56f75bdaf1375772d179b1210
2050820508 languageName: node
2050920509 linkType: hard
2051020510
You can’t perform that action at this time.
0 commit comments