Skip to content

fix: nondeterministic schema type for Kotlin value class parameters - #3460

Open
Mattias-Sehlstedt wants to merge 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:issue-3459
Open

Mattias-Sehlstedt wants to merge 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:issue-3459

Conversation

@Mattias-Sehlstedt

@Mattias-Sehlstedt Mattias-Sehlstedt commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3459

For a Kotlin value class parameter, the JVM sees the underlying String type. calculateSchema passed that String to
WebConversionServiceProvider.getSpringConvertedType(). That method returns the source type of any converter that targets String. It picks the first match from a HashMap, so the result depended on hash ordering. The parameter schema could come out as string, number or array between runs, and @Size was applied as maxLength, maximum or maxItems to match.

Skip the Spring conversion lookup when the parameter type has already been resolved to a Kotlin value class.

For a Kotlin value class parameter, the JVM sees the underlying String
type. calculateSchema passed that String to
WebConversionServiceProvider.getSpringConvertedType(). That method returns
the source type of any converter that targets String. It picks the first
match from a HashMap, so the result depended on hash ordering. The
parameter schema could come out as string, number or array between runs,
and @SiZe was applied as maxLength, maximum or maxItems to match.

Skip the Spring conversion lookup when the parameter type has already
been resolved to a Kotlin value class.

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.

Request parameter with a Kotlin value class type generates wrong format

1 participant