Skip to content

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

@ansteele

Description

@ansteele

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions