swagger-api / swagger-api/swagger-parser

Duplicated referenced definitions

Open
#1,422 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

I have the following swagger files with referenced definitions:

When reading the parsed model of the first file using version 1.0.51 I expected to find the definitions File1_parent_definition, File1_referenced_definition and File2_referenced_definition, but there is also a File1_referenced_definition_2 created by the reference found in the second file that represents the same as File1_referenced_definition. Since this is a reference to an existing definition, I expected it to point to File1_referenced_definition instead of creating a duplicate.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the attached File1.txt and File2.txt using swagger-parser 1.0.51, then inspect how referenced definitions are resolved into the parsed model. Done means the second reference reuses File1_referenced_definition instead of creating File1_referenced_definition_2, with the expected definitions still present.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.