Skip to content

Fix #1518 Duplicate External Schema Components#2321

Open
knivram wants to merge 2 commits intoswagger-api:masterfrom
knivram:bug/1518-duplicate-external-schema-components
Open

Fix #1518 Duplicate External Schema Components#2321
knivram wants to merge 2 commits intoswagger-api:masterfrom
knivram:bug/1518-duplicate-external-schema-components

Conversation

@knivram
Copy link
Copy Markdown

@knivram knivram commented Apr 20, 2026

Pull Request

Thank you for contributing to swagger-parser!

Please fill out the following checklist to help us review your PR efficiently.


Description

Fixes #1518

Resolving nested external schema refs could treat the same target schema as different refs depending on the relative path spelling, which led to duplicate generated models with suffixed names (see added test case).

This change normalizes nested external schema refs through the existing join(...) path resolution logic in ExternalRefProcessor instead of rebuilding the ref manually.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

@knivram knivram changed the title Bug/1518 duplicate external schema components Fix #1518 Duplicate External Schema Components Apr 20, 2026
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

Successfully merging this pull request may close these issues.

External ref resolve fails to resolve to same schema and creates duplicate classes

1 participant