You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I am trying to use the typescript-fetch generator to generate libraries for my openapi spec. When I define a 400 response that has oneOf, the resulting TS file does not include the imports for the referenced files, resulting in invalid typescript.
Running the command above produces a file, dist/openapi/typescript/client/models/GetIslandPosts400Response.ts, that is missing imports for the referenced models in oneOf.
It produces this snippet:
/* tslint:disable */
/* eslint-disable */
/**
* Example API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type GetIslandPosts400Response
*
* @export
*/
export type GetIslandPosts400Response = GetIslandPosts400ResponseOneOf | GetIslandPosts400ResponseOneOf1;
export function GetIslandPosts400ResponseFromJSON(json: any): GetIslandPosts400Response {
return GetIslandPosts400ResponseFromJSONTyped(json, false);
}
<snip>
If I add these imports, it is fixed:
import { GetIslandPosts400ResponseOneOf } from './GetIslandPosts400ResponseOneOf';
import { GetIslandPosts400ResponseOneOf1 } from './GetIslandPosts400ResponseOneOf1';
export type GetIslandPosts400Response = GetIslandPosts400ResponseOneOf | GetIslandPosts400ResponseOneOf1;
Importing the models seems like it would be enough. My entire .yaml file passes redocly lint. I don't know if I'm misusing something else, but it looks like this should be valid to me?
Bug Report Checklist
Description
I am trying to use the
typescript-fetchgenerator to generate libraries for my openapi spec. When I define a400response that hasoneOf, the resulting TS file does not include the imports for the referenced files, resulting in invalid typescript.openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Running the command above produces a file,
dist/openapi/typescript/client/models/GetIslandPosts400Response.ts, that is missing imports for the referenced models inoneOf.It produces this snippet:
If I add these imports, it is fixed:
Related issues/PRs
Suggest a fix
Importing the models seems like it would be enough. My entire
.yamlfile passes redocly lint. I don't know if I'm misusing something else, but it looks like this should be valid to me?