-
Notifications
You must be signed in to change notification settings - Fork 6k
Add status code and response headers of the last request to java and c# #1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…csharp templates per #990
@wing328 I would like to get your suggestion merged, but it appears that there is a failure on one of the scala tests. It happens with and without my changes locally (and they definitely don't look related). Any insight as to what I can do to move forward? |
@ivanmartinvalle I'm seeing the tests pass via travis-ci. Can you run off a clean master branch? What is the error you're getting? |
@ivanmartinvalle my commit (#1123) does not change the Scala client. Let me look into that as I suspect it's due to data change in the server side (petstore server) |
@ivanmartinvalle the user record looks good:
let me reopen this PR to trigger the test again and see if the error persists. |
@ivanmartinvalle now the tests passed. |
@ivanmartinvalle thanks for the PR to add status and response header to API client of Java and C#. Testing looks good. |
Add status code and response headers of the last request to java and c#
Apply same workaround as swagger-api#1127 to typescript-angular2 template.
UPDATE: we've replaced this approach (varaibles to store the last status code and response headers) with an additional method WithHttpInfo, e.g. https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java#L123-L137 |
* Add last response code and headers Apply same workaround as #1127 to typescript-angular2 template. * Add WithHttpInfo() methods to return raw response. * Revert change to http method formatting
Per #990
I would like to add the ability to return the status code and response headers from the previous API call from java and csharp. The python client already provides this ability via the last_response variable. This is necessary for our API, as we need the value of the Location header after a POST request.
Approach: Before returning the response body, set the non-body parts of the response on ApiClient.