fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add snapshot tests for nested allOf discriminator fix

Added test scenarios for discriminator-allof-nested.json in both 3.0.x and 3.1.x test suites with generated snapshots validating the fix

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+92
+7
packages/openapi-ts-tests/main/test/3.0.x.test.ts
··· 210 210 }, 211 211 { 212 212 config: createConfig({ 213 + input: 'discriminator-allof-nested.json', 214 + output: 'discriminator-allof-nested', 215 + }), 216 + description: 'handles nested allOf with discriminators', 217 + }, 218 + { 219 + config: createConfig({ 213 220 input: 'enum-escape.json', 214 221 output: 'enum-escape', 215 222 }),
+7
packages/openapi-ts-tests/main/test/3.1.x.test.ts
··· 241 241 }, 242 242 { 243 243 config: createConfig({ 244 + input: 'discriminator-allof-nested.json', 245 + output: 'discriminator-allof-nested', 246 + }), 247 + description: 'handles nested allOf with discriminators', 248 + }, 249 + { 250 + config: createConfig({ 244 251 input: 'duplicate-null.json', 245 252 output: 'duplicate-null', 246 253 }),
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-allof-nested/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type { CarDto, ClientOptions, GetCarsData, GetCarsResponse, GetCarsResponses, VehicleDto, VolvoDto } from './types.gen';
+36
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/discriminator-allof-nested/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type ClientOptions = { 4 + baseUrl: `${string}://${string}` | (string & {}); 5 + }; 6 + 7 + export type VehicleDto = { 8 + $type: string; 9 + id: number; 10 + }; 11 + 12 + export type CarDto = VehicleDto & { 13 + modelName: string; 14 + }; 15 + 16 + export type VolvoDto = CarDto & { 17 + $type: 'Volvo'; 18 + } & { 19 + seatbeltCount: number; 20 + }; 21 + 22 + export type GetCarsData = { 23 + body?: never; 24 + path?: never; 25 + query?: never; 26 + url: '/cars'; 27 + }; 28 + 29 + export type GetCarsResponses = { 30 + /** 31 + * List of cars 32 + */ 33 + 200: Array<CarDto | VolvoDto>; 34 + }; 35 + 36 + export type GetCarsResponse = GetCarsResponses[keyof GetCarsResponses];
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/discriminator-allof-nested/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type { CarDto, ClientOptions, GetCarsData, GetCarsResponse, GetCarsResponses, VehicleDto, VolvoDto } from './types.gen';
+36
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/discriminator-allof-nested/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type ClientOptions = { 4 + baseUrl: `${string}://${string}` | (string & {}); 5 + }; 6 + 7 + export type VehicleDto = { 8 + $type: string; 9 + id: number; 10 + }; 11 + 12 + export type CarDto = VehicleDto & { 13 + modelName: string; 14 + }; 15 + 16 + export type VolvoDto = CarDto & { 17 + $type: 'Volvo'; 18 + } & { 19 + seatbeltCount: number; 20 + }; 21 + 22 + export type GetCarsData = { 23 + body?: never; 24 + path?: never; 25 + query?: never; 26 + url: '/cars'; 27 + }; 28 + 29 + export type GetCarsResponses = { 30 + /** 31 + * List of cars 32 + */ 33 + 200: Array<CarDto | VolvoDto>; 34 + }; 35 + 36 + export type GetCarsResponse = GetCarsResponses[keyof GetCarsResponses];