Skip to content

fix: Kotlin nullability interpretation of Any? type - #3339

Merged
bnasslahsen merged 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:kotlin-nullable-any
Sep 6, 2026
Merged

bnasslahsen merged 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:kotlin-nullable-any

Conversation

@Mattias-Sehlstedt

Copy link
Copy Markdown
Contributor

Fixes #3338

@bnasslahsen
bnasslahsen merged commit fda7748 into springdoc:main Sep 6, 2026
1 check passed
bnasslahsen added a commit that referenced this pull request Sep 6, 2026
…of app25

The Kotlin Any? fix from PR #3339 stops markNullable from narrowing a schema
that carries no type constraint. For a nullable $ref property the wrapper
already expresses nullability through oneOf, so the extra type: "null" sibling
(which made the property only ever validate against null) is now gone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bnasslahsen pushed a commit that referenced this pull request Sep 6, 2026
A schema representing Any? carries no type constraint, so it already permits
any value including null. Leave it untouched instead of narrowing it to
type: "null" (3.1) or decorating it with a redundant nullable: true (3.0).

Backport of PR #3339 from the main line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Any? is generated with type of null in 3.1.0

2 participants