Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [typescript-fetch] Multiple tags cause duplicate export #7519

Closed
5 of 6 tasks
aeneasr opened this issue Sep 27, 2020 · 3 comments
Closed
5 of 6 tasks

[BUG] [typescript-fetch] Multiple tags cause duplicate export #7519

aeneasr opened this issue Sep 27, 2020 · 3 comments

Comments

@aeneasr
Copy link
Contributor

aeneasr commented Sep 27, 2020

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?
  • 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:

> tsc

src/apis/index.ts:3:1 - error TS2308: Module './AdminApi' has already exported a member named 'GetSelfServiceSettingsFlowRequest'. Consider explicitly re-exporting to resolve the ambiguity.

3 export * from './PublicApi';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openapi-generator version

4.3.1

OpenAPI declaration file content or url
    "/self-service/settings/flows": {
      "get": {
        "produces": [
          "application/json"
        ],
        "schemes": [
          "http",
          "https"
        ],
        "tags": [
          "public",
          "admin"
        ],
        "summary": "Get Settings Flow",
        "operationId": "getSelfServiceSettingsFlow",
        "parameters": [
          {
            "type": "string",
            "description": "ID is the Settings Flow ID\n\nThe value for this parameter comes from `flow` URL Query parameter sent to your\napplication (e.g. `/settings?flow=abcde`).",
            "name": "id",
            "in": "query",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "settingsFlow",
            "schema": {
              "$ref": "#/definitions/settingsFlow"
            }
          },
          "403": {
            "description": "genericError",
            "schema": {
              "$ref": "#/definitions/genericError"
            }
          },
          "404": {
            "description": "genericError",
            "schema": {
              "$ref": "#/definitions/genericError"
            }
          },
          "410": {
            "description": "genericError",
            "schema": {
              "$ref": "#/definitions/genericError"
            }
          },
          "500": {
            "description": "genericError",
            "schema": {
              "$ref": "#/definitions/genericError"
            }
          }
        }
      }
    },

Full spec

Generation Details
# typescript.yml
npmName: "@oryd/kratos-client"
npmVersion: v0.0.1
supportsES6: true
npx @openapitools/[email protected] generate -i "./contrib/sdk/api.swagger.json" \
			-g typescript-fetch \
			-o "./contrib/sdk/generated" \
			--git-user-id ory \
			--git-repo-id sdk \
			--git-host github.com \
			-c ./contrib/sdk/typescript.yml
Steps to reproduce

See command above.

Related issues/PRs

None

Suggest a fix

Prefix and exports with their tag as to avoid duplicate exports.

@auto-labeler
Copy link

auto-labeler bot commented Sep 27, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@aeneasr
Copy link
Contributor Author

aeneasr commented Sep 27, 2020

Looks like setting

prefixParameterInterfaces: true

fixes the issue :)

@aeneasr aeneasr closed this as completed Sep 27, 2020
@denimamab
Copy link

@aeneasr seems to be working for interfaces but not Enums, still having the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants