We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note that it seems like this issue is fixed in the newer versions of kotlin (1.9.20), but we should check this works once we upgrade.
kotlin side: https://youtrack.jetbrains.com/issue/KT-58887/Reflection-IllegalArgumentException-argument-type-mismatch-when-using-reflection-to-invoke-a-value-class-returning-function-that spring side: spring-projects/spring-framework#27345 discord ref: https://discord.com/channels/1087271586832318494/1172096171318181918/1172417425933860904
Reproducer:
@Test fun fooTest() { runTest { val res = server.blockingWebClient({cb -> cb.addHeader(HttpHeaderNames.CONTENT_TYPE, "application/json") .responseTimeoutMillis(0) .writeTimeoutMillis(0) }) .post("/hello/foo", """ { "hello": "world!", "hi": 123 } """.trimIndent()) logger.info("res: ${res}") } } companion object { private val logger = LoggerFactory.getLogger(MyTest::class.java) @RegisterExtension val server: ServerExtension = object : ServerExtension() { override fun configure(sb: ServerBuilder) { sb.idleTimeoutMillis(0) .requestTimeoutMillis(0) sb.annotatedService() .pathPrefix("/hello") .build(MyAnnotatedService()) sb.errorHandler(object: ServerErrorHandler { override fun onServiceException( ctx: ServiceRequestContext, cause: Throwable ): HttpResponse? { logger.warn("onServiceException: ", cause) return null } }) } } data class Inner(val hello: String, val hi: Int) @JvmInline value class TestClass(val inner: Inner) private class MyAnnotatedService { @Post("/foo") @ProducesJson suspend fun foo(testClass: TestClass): TestClass { println("testClass :${testClass}") return TestClass(Inner("world", 456)) } } }
The text was updated successfully, but these errors were encountered:
Support for Kotlin value class in annotated services
cbba987
TBU Fixes: line#5294
d71803d
Successfully merging a pull request may close this issue.
Note that it seems like this issue is fixed in the newer versions of kotlin (1.9.20), but we should check this works once we upgrade.
kotlin side: https://youtrack.jetbrains.com/issue/KT-58887/Reflection-IllegalArgumentException-argument-type-mismatch-when-using-reflection-to-invoke-a-value-class-returning-function-that
spring side: spring-projects/spring-framework#27345
discord ref: https://discord.com/channels/1087271586832318494/1172096171318181918/1172417425933860904
Reproducer:
The text was updated successfully, but these errors were encountered: