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

V2 Compatibility mode doesn't work for tag interface #3635

Open
ansteele opened this issue Aug 12, 2024 · 1 comment
Open

V2 Compatibility mode doesn't work for tag interface #3635

ansteele opened this issue Aug 12, 2024 · 1 comment
Labels
P3 pull-request-welcome That the core team don't have the resources, but would welcome a community PR type: bug version: 2.x

Comments

@ansteele
Copy link

Q&A (please complete the following information)

  • OS: Windows 11
  • Environment: Edge 127
  • Method of installation: npm
  • Swagger-Client version: 3.28.2
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Swagger-Client usage:

const client = SwaggerClient({url: url, v2OperationIdCompatibilityMode: true})

Describe the bug you're encountering

v2OperationIdCompabilityMode doesn't actually work, it creates the correctly named interface functions within 'client.apis' but when making a request it fails to resolve the operation ID to an endpoint within the spec.

It seems to be because the v2 compatibility flag isn't passed to getOperationRaw and then down to opId (where the flag is handled).

Looking at the unit tests that were added it seems they only check that the tag function is created not that the request actually succeeds.

To reproduce...

Steps to reproduce the behavior:

  1. Have a path that contains a route parameter (/some/path/{id})
  2. Ensure v2 compatibility mode is on
  3. Try to call client.apis.tag.get_some_path_id
  4. buildRequest throws as getOperationRaw cannot resolve the operation ID to a spec path

Expected behavior

The call is correctly translated to a request to /some/path/{id}

@ponelat ponelat added type: bug P3 version: 2.x pull-request-welcome That the core team don't have the resources, but would welcome a community PR labels Sep 13, 2024
@ponelat
Copy link
Member

ponelat commented Sep 13, 2024

Hi @ansteele thanks for the report! We don't have the priority to look into this right now, but would welcome a community PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 pull-request-welcome That the core team don't have the resources, but would welcome a community PR type: bug version: 2.x
Projects
None yet
Development

No branches or pull requests

2 participants