How to post/put using the generated client?

8 views
Skip to first unread message

Jochen Wiedmann

unread,
May 17, 2018, 4:10:29 AM5/17/18
to Swagger

Hi,

I've got a client SDK, which has been generated from me by a server side tool, which I do not control. No idea, what version of swagger-codegen, or the like. The only information I've got, is this:

    @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-14T16:41:00.452Z")

In the generated code, there is a class DefaultApi with methods like

    public void pUT(String id, String contentType, String accept) throws ApiException;
    public InlineResponse201Created pOST(String accept, String contentType) throws ApiException;

Which is all well, except... there is something missing: I would have expected an additional parameter, which is being mapped to the request body, but there is none.
And, indeed, looking into methods like pOSTCall, and pUTCall (which seem to create, and send the actual request), I notice, that there is a variable localVarPostBody,
which is initialized with null, but never written to.

Tracing a POST request with Wireshark reveals, that there is indeed no body.

Am I missing something, or am I supposed to use heavy trickery?

Thanks,

Jochen



Reply all
Reply to author
Forward
0 new messages