- Fixed issue where similar model name and service name would result in filtering out the import

This commit is contained in:
Ferdi Koomen 2021-11-13 10:20:19 +01:00
parent 8485931b0a
commit 7e8d66b90a
3 changed files with 4 additions and 7 deletions

View File

@ -452,8 +452,8 @@ If you want to generate the Axios based client then you can specify `--client ax
`openapi --input ./spec.json --output ./dist --client axios`
The only downside is that this client needs some additional dependencies to work, due to the missing Blob and FormData
classes in NodeJS.
The only downside is that this client needs some additional dependencies to work (due to the missing Blob and FormData
classes in NodeJS).
```
npm install axios --save-dev

View File

@ -1,6 +1,6 @@
{
"name": "openapi-typescript-codegen",
"version": "0.12.0-beta",
"version": "0.12.0",
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
"author": "Ferdi Koomen",
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",

View File

@ -7,8 +7,5 @@ import { unique } from './unique';
* @param service
*/
export function postProcessServiceImports(service: Service): string[] {
return service.imports
.filter(unique)
.sort(sort)
.filter(name => service.name !== name);
return service.imports.filter(unique).sort(sort);
}