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

Output mode 'tags' issue when operation has multiple tags #1677

Open
oliveira-m opened this issue Oct 29, 2024 · 0 comments
Open

Output mode 'tags' issue when operation has multiple tags #1677

oliveira-m opened this issue Oct 29, 2024 · 0 comments
Labels
enhancement New feature or request openapi_31 OpenAPI 3.1 related issue

Comments

@oliveira-m
Copy link

oliveira-m commented Oct 29, 2024

Duplicate operation are generated when Output mode is 'tags' and operation has multiples tags, which is allowed by OpenAPI.

What are the steps to reproduce this issue?

  1. set multiple tags on a operation:
    e.g.
paths:
  /pets:
    get:
      summary: List all pets
      operationId: listPets
      tags:
        - pets
        - listAll
  1. set output mode to 'tags'
  2. run

What happens?

the operation will be generated on both ./pets and ./listAll
which causes the index.ts file to throw an error:
Module './pets' has already exported a member named 'ListPetsParams'. Consider explicitly re-exporting to resolve the ambiguity.

What were you expecting to happen?

only the first tag should be used in this scenario to export types and functions thus avoiding duplication

Any other comments?

there could be a config to set which tag to use in this scenario.( future enhancement)

What versions are you using?

orval: 7.2.0

System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 137.88 MB / 32.00 GB
Shell: 5.9 - /bin/zsh

@melloware melloware added openapi_31 OpenAPI 3.1 related issue enhancement New feature or request labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi_31 OpenAPI 3.1 related issue
Projects
None yet
Development

No branches or pull requests

2 participants