Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7722
Closed
Open
Issue created Oct 15, 2020 by Administrator@rootContributor

[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
  1. clone the openapi-generator repo
  2. setup the repo (mvn clean package)
  3. 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.

Assignee
Assign to
Time tracking