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
  • #13200
Closed
Open
Issue created Aug 16, 2022 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][typescript-angular] Multiple tags and `useSingleRequestParameter` cause duplicate export

Created by: snebjorn

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
    • Issue is still present in master https://github.com/snebjorn/openapi-gen-bug/tree/master/output-master/export-bug
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Defining operations with multiple tags leads to duplicate export.

https://github.com/snebjorn/openapi-gen-bug/blob/ad3851d72b3a9bfe8bc49604730d013e03813b73/export-bug.json#L19

Module './tag1.service' has already exported a member named 'FoosParam1BarsGetRequestParams'. Consider explicitly re-exporting to resolve the ambiguity. ts(2308)

FoosParam1BarsGetRequestParams is declared in both these places:

  • https://github.com/snebjorn/openapi-gen-bug/blob/ad3851d72b3a9bfe8bc49604730d013e03813b73/output-6.0.1/export-bug/api/tag1.service.ts#L27
  • https://github.com/snebjorn/openapi-gen-bug/blob/ad3851d72b3a9bfe8bc49604730d013e03813b73/output-6.0.1/export-bug/api/tag2.service.ts#L27
openapi-generator version

6.0.1

OpenAPI declaration file content or url

https://raw.githubusercontent.com/snebjorn/openapi-gen-bug/master/export-bug.json

{
  "openapi": "3.0.0",
  "info": {
    "title": "",
    "version": ""
  },
  "paths": {
    "/Foos/{Param1}/Bars": {
      "parameters": [
        {
          "name": "Param1",
          "in": "path",
          "required": true,
          "description": "",
          "schema": { "type": "string" }
        }
      ],
      "get": {
        "tags": ["Tag1", "Tag2"],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    }
  }
}
Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
   -i https://raw.githubusercontent.com/snebjorn/openapi-gen-bug/master/export-bug.json \
   -g typescript-angular \
   -o output-master/export-bug \
   -p=useSingleRequestParameter=true
Steps to reproduce
  1. Clone https://github.com/snebjorn/openapi-gen-bug
  2. Run yarn install
  3. Run yarn gen
  4. Observe export error in https://github.com/snebjorn/openapi-gen-bug/blob/master/output-6.0.1/export-bug/api/api.ts
Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/7519

Suggest a fix

Prefix with their tag as to avoid duplicate exports.

Assignee
Assign to
Time tracking