Fix code generation for RequestType annotated lists - #1072
Open
JanTie wants to merge 1 commit into
Open
Conversation
JanTie
force-pushed
the
bugfix/fix-request-type-for-list-parameters
branch
2 times, most recently
from
June 4, 2026 07:22
7f5a7cb to
19e11bb
Compare
JanTie
force-pushed
the
bugfix/fix-request-type-for-list-parameters
branch
from
June 9, 2026 13:17
19e11bb to
b9095d4
Compare
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.
Problem
Using a
@RequestTypeannotation on List/Array parameters was not supported properly as the generated code treat the parameter builder as iterable, no matter what the type was actually mapped to. So for example the following code would previously cause ksp to generate non-compiling code:In this case the backend is supposed to work with a comma separated and html-encoded value for
someFilterData. A converter factory should take care of that.However, currently the generated code produces the following line
someFilterData?.filterNotNull()?.forEach { parameter("someFilterData", "$it") }which does not compile, as the parameter is already expected to be a String at this point.
Change
The proposed change now no longer relies on the initial datatype to determine how the parameters are added to the request. Instead the actual mapped type causes the code generation to decide which approach is the correct one.
Also added an Example implementation of the stated ConverterFactory to the demo project