Skip to content

Comments

fix(converter): keep x-nullable in shared $ref responses#2276

Open
esaezgil wants to merge 2 commits intoswagger-api:masterfrom
esaezgil:bug/2269_fix_lost_xnullable_swagger_2_shared_responses
Open

fix(converter): keep x-nullable in shared $ref responses#2276
esaezgil wants to merge 2 commits intoswagger-api:masterfrom
esaezgil:bug/2269_fix_lost_xnullable_swagger_2_shared_responses

Conversation

@esaezgil
Copy link

@esaezgil esaezgil commented Feb 20, 2026

Description

  • Fixes x-nullable vendor extension being lost when multiple endpoints share the same response via $ref during Swagger 2.0 to OpenAPI 3.0 conversion
  • Creates a new map instead of mutating the original, preserving extensions for all endpoints sharing the same response definition
  • Adds a regression test

Fixes: #2269

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)

Screenshots / Additional Context

esaezgil and others added 2 commits February 20, 2026 06:23
The convert(vendorExtensions) method mutated the original map when
filtering out x-nullable, x-example, and x-examples extensions.

When multiple endpoints referenced the same response via $ref, the
first conversion removed x-nullable from the shared source object,
causing subsequent conversions to miss it and produce nullable=null.

Create a new map instead of mutating the original to preserve vendor
extensions for all endpoints sharing the same response definition.
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.

[Bug]: x-nullable lost for shared $ref responses during Swagger 2.0 to OAS3 conversion

1 participant