Skip to content

fix: ensure that @Nullable does not incorrectly affect object schemas#5124

Open
Mattias-Sehlstedt wants to merge 2 commits intoswagger-api:masterfrom
Mattias-Sehlstedt:do-not-set-nullable-on-objects
Open

fix: ensure that @Nullable does not incorrectly affect object schemas#5124
Mattias-Sehlstedt wants to merge 2 commits intoswagger-api:masterfrom
Mattias-Sehlstedt:do-not-set-nullable-on-objects

Conversation

@Mattias-Sehlstedt
Copy link
Copy Markdown
Contributor

Pull Request

Thank you for contributing to swagger-core!

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


Description

Changes so that a @Nullable annotation present on a model does not incorrectly set type: null for OAS 3.1 or nullable: true for OAS 3.0. The nullable is instead dropped entirely. This since the resolving currently does not support an easy way of expressing nullable with refs correctly.

Fixes: #5115

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

@Mattias-Sehlstedt Mattias-Sehlstedt force-pushed the do-not-set-nullable-on-objects branch from a528240 to 3043ce4 Compare April 13, 2026 10:08
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]: @Nullable annotation incorrectly affects object and sets the type to null

1 participant