Skip to content

fix: ignore a nullable annotation for enums that use enumAsRef (3.x) - #5421

Open
AdzerKI wants to merge 1 commit into
swagger-api:3.0.0from
AdzerKI:enum-as-ref-nullable-3.x
Open

AdzerKI wants to merge 1 commit into
swagger-api:3.0.0from
AdzerKI:enum-as-ref-nullable-3.x

Conversation

@AdzerKI

@AdzerKI AdzerKI commented Nov 21, 2026

Copy link
Copy Markdown

Description

Port of #5312 to the 3.x line. A nullable enum that becomes a $ref component (@Schema(enumAsRef = true) or ModelResolver.enumsAsRef) still gets nullable/"null" written into the shared enum component, so every other use of that enum turns nullable too. 3.0.0 has the same behaviour as 2.2.x.

The change is the commit from #5312 as is. The only difference is in the two new test models: they use jakarta.annotation.Nullable, since javax.annotation is not on the 3.x test classpath.

Fixes: #5310

Type of Change

  • 🐛 Bug fix
  • 🧪 Tests

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

swagger-core module tests pass on the 3.0.0 branch (1606 tests).

This branch has not been deployed

No deployments
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.

3 participants