[BUG][TYPESCRIPT-ANGULAR] client generated README with apiModulePrefix
Created by: sorohan
Description
When specifying the apiModulePrefix
the generated README still says to import ApiModule
.
If you specify a prefix (eg PetStore
) the generated README should say to import PetStoreApiModule
.
openapi-generator version
4.3.0 (also checked on master)
OpenAPI declaration file content or url
The petstore YAML is sufficient to reproduce it.
Command line used for generation
You can generate using the samples, as the generated code contains the bug.
You can use the typescript-angular-with-prefixed-module-name-v8
sample:
sh bin/generate-samples.sh bin/configs/typescript-angular-with-prefixed-module-name-v8.yaml
Steps to reproduce
- clone the openapi-generator repo
- setup the repo (
mvn clean package
) - generate the sample with prefixed module:
sh bin/generate-samples.sh bin/configs/typescript-angular-with-prefixed-module-name-v8.yaml
Expected result:
Sample readme (samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/README.md
) should contain PetStoreApiModule
.
Actual result:
Sample readme contains ApiModule
.
See the general usage generated for the sample.
Suggest a fix/enhancement
I have a branch with the fix, and I can make a PR if you agree. See: https://github.com/OpenAPITools/openapi-generator/compare/master...sorohan:bugfix/typescript-angular-docs-with-module-prefix?expand=1
The thing I'm least sure about is updating the section on "Using multiple OpenAPI files / APIs / ApiModules". The advice given currently is to use:
import { ApiModule as OtherApiModule } from 'my-other-api-path';
But I think it would be better to just recommend people to use the apiModulePrefix
option, as I assume that's what it's there for.