Repository navigation
fix: nondeterministic schema type for Kotlin value class parameters - #3460
Open
Mattias-Sehlstedt wants to merge 1 commit into
Open
Mattias-Sehlstedt wants to merge 1 commit into
Mattias-Sehlstedt wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3459
For a
Kotlinvalue class parameter, the JVM sees the underlyingStringtype. calculateSchema passed thatStringtoWebConversionServiceProvider.getSpringConvertedType(). That method returns the source type of any converter that targetsString. 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@Sizewas applied as maxLength, maximum or maxItems to match.Skip the Spring conversion lookup when the parameter type has already been resolved to a
Kotlinvalue class.