Currently in the java-jaxrs-client, we use the type Form when generating request bodies for requests of type application/x-www-form-urlencoded.
formUrlEncodedImplementation: () => new context.NativeType(`${generatorOptions.useJakarta ? 'jakarta' : 'javax'}.ws.rs.core.Form`),`
This means that the request body object defined in the schema is ignored and replaced by the generic Form, even though objects are supported in the OpenAPI specification. See here.
I noticed this comment in some related code, and I imagine this is likely the root cause of this.
/* Fix form post request bodies, as we can't properly handle them using
https://docs.oracle.com/javaee/7/api/javax/ws/rs/BeanParam.html yet
*/
However, in my testing I have found that (at least using jakarta) this comment no longer seems valid.
I was able to use a class marked with @BeanParam with the members marked with @FormParam successfully.
I think we should investigate correctly implementing generated form request bodies for the java-jaxrs-client.
Currently in the
java-jaxrs-client, we use the typeFormwhen generating request bodies for requests of typeapplication/x-www-form-urlencoded.This means that the request body object defined in the schema is ignored and replaced by the generic
Form,even though objects are supported in the OpenAPI specification. See here.I noticed this comment in some related code, and I imagine this is likely the root cause of this.
However, in my testing I have found that (at least using
jakarta) this comment no longer seems valid.I was able to use a class marked with
@BeanParamwith the members marked with@FormParamsuccessfully.I think we should investigate correctly implementing generated form request bodies for the
java-jaxrs-client.