-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
For Golang need to make HTTPResponse.Body readable again
Now after generating code, the generator read the Http Body one and closed it. After that user cannot read the Body again out the generated client. I suggest making the Body readable again.
openapi-generator version
4.2.3
Suggest a fix
Need to change in the templates localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
to
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))
nmische