When performing a MultipartForm request on a REST client with a Kotlin data class wrapping the form fields it fails to generate the REST client with the error below.
Request failed:
org.eclipse.microprofile.rest.client.RestClientDefinitionException:
org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException:
Failed to generate client for class interface com.acme.accountmanager.apis.google.GoogleApi:
Non-public field found in a multipart form data class com.acme.accountmanager.apis.google.dto.recaptcha.GoogleRecaptchaRequestDto.
Rest Client Reactive only supports multipart form classes with a list of public fields
import org.jboss.resteasy.reactive.PartType
import javax.ws.rs.FormParam
import javax.ws.rs.core.MediaType
data class GoogleRecaptchaRequestDto(
@FormParam("secret")
@PartType(MediaType.TEXT_PLAIN)
val secret: String,
@FormParam("response")
@PartType(MediaType.TEXT_PLAIN)
val captchaValue: String
)
Expected behavior
Since all fields in a data class are public by default, I would expect it to perform the request as when providing the form params like this
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
fun verifyCaptcha(@FormParam("secret") secret: String, @FormParam("response") captchaValue: String): Response
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
openjdk 11.0.10 2021-01-19 OpenJDK Runtime Environment (build 11.0.10+9) OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.3-Final
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
During build time it also shows this error message
Failed to create client proxy for com.acme.accountmanager.apis.google.GoogleApi this can usually be safely ignored:
java.lang.IllegalArgumentException:
Non-public field found in a multipart form data class com.acme.accountmanager.apis.google.dto.recaptcha.GoogleRecaptchaRequestDto.
Rest Client Reactive only supports multipart form classes with a list of public fields
Describe the bug
When performing a MultipartForm request on a REST client with a Kotlin data class wrapping the form fields it fails to generate the REST client with the error below.
The REST client is defined as
And the data class as
Expected behavior
Since all fields in a data class are public by default, I would expect it to perform the request as when providing the form params like this
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
openjdk 11.0.10 2021-01-19 OpenJDK Runtime Environment (build 11.0.10+9) OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.3-Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
During build time it also shows this error message
https://github.com/quarkusio/quarkus/issues/20457
$upstream:20457$