ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.79k stars 513 forks source link

Import Core path #2202

Open focus-at opened 1 week ago

focus-at commented 1 week ago

I use multiple opeapi schemes from different urls To avoid duplicate ./src/api-generated/${scheme}/core directory for each api provider, I generate core separately

1. --output ./src/api-generated/core --exportServices false --exportModels false
2. --output ./src/api-generated/audio --exportCore false
3. --output ./src/api-generated/web --exportCore false

but In all generated services i get

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

I would like to be able to specify the directory from which it will be imported, maybe with flag --importCorePath, although we might also need to change the OpenAPI settings for a specific provider separately

mrlubos commented 1 week ago

@focus-at this is solved in https://github.com/hey-api/openapi-ts + this package is no longer maintained, so I'd encourage you to migrate if possible 🚀