Skip to content

[TS][Angular2] Add last response code and headers #3760

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

Merged
merged 3 commits into from
Sep 12, 2016

Conversation

stevedenman
Copy link
Contributor

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

Apply same workaround as #1127 to typescript-angular2 template.

Apply same workaround as swagger-api#1127 to typescript-angular2 template.
@wing328
Copy link
Contributor

wing328 commented Sep 9, 2016

@stevedenman thanks for the PR.

For #1127, we've replaced that 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

Can we do something similar in TypeScript-Angular2 client?

The reason we didn't use variables to store the last status code and response headers was that such solution will have issues with multi-threading environment.

@wing328
Copy link
Contributor

wing328 commented Sep 9, 2016

cc @Vrolijkx

@stevedenman
Copy link
Contributor Author

Hi @wing328, yeah, that makes sense. I will have a look at changing it.

@stevedenman
Copy link
Contributor Author

@wing328 I've pushed that change - the new functions return the Response, so headers etc can be used.

@wing328 wing328 merged commit 314bfde into swagger-api:master Sep 12, 2016
@wing328
Copy link
Contributor

wing328 commented Sep 12, 2016

@stevedenman thanks for the contribution. PR merged into master.

@stevedenman stevedenman deleted the patch-1 branch September 12, 2016 09:46
@wing328 wing328 changed the title Add last response code and headers [TS] Add last response code and headers Feb 20, 2017
@wing328 wing328 changed the title [TS] Add last response code and headers [TS][Angular2] Add last response code and headers Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants