Swagger-codegen: [typescript-angular2] use new HttpClient from '@angular/common/http' instead of old Http

Created on 26 Sep 2017  路  2Comments  路  Source: swagger-api/swagger-codegen

Description


The template generates services which use old Http class. Please use latest (available since [email protected]) HttpClient from '@angular/common/http' which is necessary for new interceptors suppot

Swagger-codegen version

2.3.0

Swagger declaration file content or url

modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i swagger.json -l typescript-angular -o out/

Suggest a fix/enhancement

import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
...and refactor the rest accordingly

Most helpful comment

The feature will be merged soon. See #6295

All 2 comments

The feature will be merged soon. See #6295

6295 was merged, so this issue could be closed

Was this page helpful?
0 / 5 - 0 ratings