-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Description
When using basic types in a oneOf the generated code is importing the basic type like this:
Actual:
import type { TestA } from './TestA';
import type { TestB } from './TestB';
import type { string } from './string';
export type TestResponse = TestA | TestB | string;
Expected:
import type { TestA } from './TestA';
import type { TestB } from './TestB';
export type TestResponse = TestA | TestB | string;
When using arrays of refs in a oneOf it's the opposite, the referenced schemas are not imported:
Actual:
export type TestArrayResponse = Array<TestA> | Array<TestB> | Array<string>;
Expected:
import type { TestA } from './TestA';
import type { TestB } from './TestB';
export type TestArrayResponse = Array<TestA> | Array<TestB> | Array<string>;
openapi-generator version
7.9.0 and latest master
OpenAPI declaration file content or url
https://gist.github.com/GregoryMerlet/fc7d7c2cb750d8d27eb064a613312b0c
Generation Details
typescript-fetch generator
Steps to reproduce
Generate using the yaml previously linked.