[TypeScript][Fetch] Change return type from any -> Response#6774
[TypeScript][Fetch] Change return type from any -> Response#6774wing328 merged 3 commits intoswagger-api:masterfrom
Conversation
|
@masaeedu have you checked this with a generated library to make sure Response was valid? I'm not sure if our tests cover it yet. |
|
If you look at the method for which I've changed the return type, the final
return value is templated as `return
response{{#returnType}}.json(){{/returnType}};`. This means whenever the
returnType mustache variable isn't present (which is the case in which we
return any) the value returned is the raw Response object.
On Oct 22, 2017 8:15 PM, "kenisteward" <notifications@github.com> wrote:
@masaeedu <https://github.com/masaeedu> have you checked this with a
generated library to make sure Response was valid? I'm not sure if our
tests cover it yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6774 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADgPyKj_9kE7XaIuu4UGWqYnXV0BuaHNks5su9qwgaJpZM4QBAqQ>
.
|
|
yup i gathered that. I just wanted to make sure you tried this locally with an api you have and everything turned out fine. Just a safety net until we get better integration tests online. |
|
Also, to get ci to pass it seems as someone else's changes are needed. I had a pr as well and I just re-merged with master and that fixed it. |
|
@kenisteward Rebased, thanks. The client library I'm generating compiles fine with the change when |
|
that's exactly what I wanted to know. As long as the one you generate for yourself works that's perfect :) I hope to in the future have a sample app that calls each of the endpoints. |
kenisteward
left a comment
There was a problem hiding this comment.
Thanks for locally testing and the changes.
|
Hi @wing328. Any chance of getting this merged today? I have some other stuff that depends on this. |
Fixes #6772
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.3.0.0branch for changes related to OpenAPI spec 3.0. Default:master.Description of the PR
Change the return type of API methods for which a response schema is not available to reflect that they return a
Promise<Response>(instead ofPromise<any>).Technical committee reviewers
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx