question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[issue] - same operationId won't generate outputs

See original GitHub issue

What are the steps to reproduce this issue?

  1. create an input target that has operations with the same id
  2. run your generate normally

ie.:

  1. add this code below into the samples/react-app-with-react-query/petstore.yaml
  /dogs:
    get:
      summary: List all dogs
      operationId: listPets 👈  it will cause the issue
      tags:
        - dogs
      parameters:
        - name: limit
          in: query
          description: How many items to return at one time (max 100)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A paged array of pets
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pets'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

  1. run orval
  2. you won’t see dogs outputs

What happens?

Just noticed it, cause I have a huge swagger.json file that has many similar operationId. ie.: getAll, getById, …

When the input target has operations with the same operationId being repeated many times, the output won’t have all operations.

What were you expecting to happen?

Generate all operations, even those with the same Id.

Any logs, error output, etc?

Any other comments?

sent the pr: https://github.com/anymaniax/orval/pull/157 Which worked fine for me. But, noticed that it won’t work for the modes single and split. Any thoughts?

What versions are you using?

Operating System: macOS Big Sur 11.2.3 Package Version: 5.4.4 Browser Version: Google Chrome 91.0.4472.77

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
anymaniaxcommented, Jun 2, 2021

Sure you can check here

0reactions
davidsonsnscommented, Jun 2, 2021

You can override the operation with the config operationName but you will still have a problem with the generation.

is it documented?

btw thanks for an answer so fast 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate operationId values · Issue #361 - GitHub
Currently the operationId for the OpenAPI spec is generated only from the simple method name (if not explicitly set).
Read more >
Cannot have multiple operations with the same operationId
I have imported an API from swagger-UI and able to create an api and product,But when I am ...
Read more >
Fix Swagger Validator errors in Power Platform connectors
Your swagger has an operation with a response example, but that same operation does not produce a response with the indicated MIME type....
Read more >
Path Operation Advanced Configuration - FastAPI
You can set the OpenAPI operationId to be used in your path operation with the parameter operation_id . You would have to make...
Read more >
Using OpenApiReference To Generate Open API Client Code
I this post I show how you can customise the code generated by the ... this suffers the same problem of all command...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found