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 63
63
"docs/react-dom" : " npm:17.0.2" ,
64
64
"docs/@types/react-dom" : " npm:17.0.11" ,
65
65
"docs/@types/react" : " npm:17.0.11" ,
66
- "type-fest" : " 2.19.0" ,
67
- "oazapfts" : " 4.8.0"
66
+ "type-fest" : " 2.19.0"
68
67
},
69
68
"scripts" : {
70
69
"build" : " yarn build:packages" ,
Original file line number Diff line number Diff line change @@ -103,6 +103,11 @@ export async function generateApi(
103
103
useEnumType,
104
104
} ) ;
105
105
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
+
106
111
const operationDefinitions = getOperationDefinitions ( v3Doc ) . filter ( operationMatches ( filterEndpoints ) ) ;
107
112
108
113
const resultFile = ts . createSourceFile (
Original file line number Diff line number Diff line change @@ -773,17 +773,21 @@ export type GetApiV1AnimalsApiArg = {
773
773
type?: AnimalType;
774
774
};
775
775
export type AnimalType = 'All' | 'Cats' | 'Dogs';
776
- export type Animal = {
776
+ export type AnimalBase = {
777
777
type: AnimalType;
778
778
id?: number;
779
779
name?: string | null;
780
780
};
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
+ };
787
791
export const { useGetApiV1AnimalsQuery } = injectedRtkApi;
788
792
789
793
`;
Original file line number Diff line number Diff line change @@ -20493,9 +20493,9 @@ fsevents@^1.2.7:
20493
20493
languageName: node
20494
20494
linkType: hard
20495
20495
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"
20499
20499
dependencies:
20500
20500
"@apidevtools/swagger-parser": ^10.1.0
20501
20501
lodash: ^4.17.21
@@ -20504,7 +20504,7 @@ fsevents@^1.2.7:
20504
20504
typescript: ^5.2.2
20505
20505
bin:
20506
20506
oazapfts: lib/codegen/cli.js
20507
- checksum: 0f3850767a1c18c02a2c002981f3d89304643ecd425d4723f0d73efebddaa3a13d9e7436a070cdd211b24a5fecd270e03686de91d316b3361de64413d2c2a7ee
20507
+ checksum: dbed3d73ba2c3a758b3e5a9ffb62486c628f020232ad513bceb0562a437a45350cc5262689191c664423980421d9f2690b9574a56f75bdaf1375772d179b1210
20508
20508
languageName: node
20509
20509
linkType: hard
20510
20510
You can’t perform that action at this time.
0 commit comments