Configurable option for generating body content in Post requests
I'm creating a simple REST service. I figured I'd use JAX-RS. I've generated my API and the documentation looks good.
I'm having trouble modifying the generated JAX-RS code (I'm using Jersey/Jetty) to retrieve 'body' parameters properly. If they're sent in a single packet with the request, the stub is invoked OK. If the body comes in another packet, however, Jetty dispatches the call as soon as the headers are complete and my server stub is invoked with a "null" parameter that should've been retrieved from the HTTP body.
Is there any good JAX-RS sample code that actually properly retrieves a 'body' parameter for use? Is there anything special my code needs to do if the passed function parameter is "null"? Am I supposed to be writing code to retrieve it from the body once that actually arrives, and block until then somehow?
Any pointers to complete sample code (that don't just return"Magic!" without looking at the parameters...) would be much appreciated!
can you please share more details? such as codegen version you use, also what jax-rs language (in codegen options) are you using to generated code? and if it's possible, share the api documentation used on your sample
Re: Configurable option for generating body content in Post requests
I'm just using whatever codegen version is current on Swaggerhub, which I'm using for development. I exported the server stubs for plain "jaxrs", IIRC.
Again, the strange part is that the whole operation works fine end-to-end if the body is included in the original request packet; it's when the body is sent in a separate packet that the API is just called with a "null" value for a required [body] parameter.
I'm having some trouble accessing the API through Swaggerhub at the moment but the API definition (in the original yaml) for the Swagger 2.0 version of the API, was as follows: