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

Swagger parser fails to link correct external reference if it refers to a file with non-unique name #2143

Open
marcin-domanski-dis opened this issue Dec 5, 2024 · 0 comments

Comments

@marcin-domanski-dis
Copy link

marcin-domanski-dis commented Dec 5, 2024

If we have a swagger file with references where only path is unique but filename is not, then swagger parser will mix responses resulting in a parser result not matching actual swagger definitions.

Example:
index.yaml with responses section like below:

paths:
  /entityA:
    get:
      responses:
        "200":
          $ref: ./responses/entityA/list.yaml
  /entityB:
    get:
      responses:
        "200":
          $ref: ./responses/entityB/list.yaml

Then both responses will be indexed with a same key resulting in only one of these is being used and other discarded.

This is because RefUtils.computeDefinitionName() will only use filename when computing external reference name

Tested with 2.1.22 and 2.1.24

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

No branches or pull requests

1 participant