Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(typescript-angular): correct httpClient call with URL query parameters & support body for all methods #568

Merged
merged 2 commits into from
Dec 27, 2019

Conversation

cmalard
Copy link
Contributor

@cmalard cmalard commented Dec 23, 2019

Will convert:

    return this.httpClient.post<any>(`${this.basePath}...`, body,
      {
        params: queryParameters,
        withCredentials: this.configuration.withCredentials,
        headers: headers,
        observe: observe,
        reportProgress: reportProgress,
      }
    );

to:

    return this.httpClient.request<any>('post', `${this.basePath}...`,
      {
        body: body,
        params: queryParameters,
        withCredentials: this.configuration.withCredentials,
        headers: headers,
        observe: observe,
        reportProgress: reportProgress,
      }
    );

https://angular.io/api/common/http/HttpClient#request

Wich will fix for Codegen 3:

@HugoMario HugoMario merged commit 4b74540 into swagger-api:master Dec 27, 2019
@HugoMario
Copy link
Contributor

thanks a lot @cmalard !!!

@mold
Copy link

mold commented Jan 9, 2020

I get broken code now, looks like it has to do with this PR. Example:

  return this.httpClient.request<any>(
    post, // <--- missing quotes
    `${this.basePath}...`,
    {
        body: body  // <--- missing comma
        params: queryParameters,
        withCredentials: this.configuration.withCredentials,
        headers: headers,
        observe: observe,
        reportProgress: reportProgress
    }
);

any chance of fixing this?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants