You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While generating typescript-angular2 API, requestOption.responseType is always set to ResponseContentType.Json. This is causing issues when API returns 204 and there is no content to be parsed to json. Angular 2 is trying to parse response according to responseType and failing in this case.
Moreover, extraHttpRequestParams is not applied (parameter is not used).
Another suspicious thing is that "consumes" and "produces" are never used. Shouldn't they be applied in request / response?
ResponseType and extraHttpRequestParams seems to be properly done for typescript-angular.
Description
While generating typescript-angular2 API, requestOption.responseType is always set to ResponseContentType.Json. This is causing issues when API returns 204 and there is no content to be parsed to json. Angular 2 is trying to parse response according to responseType and failing in this case.
Moreover, extraHttpRequestParams is not applied (parameter is not used).
Another suspicious thing is that "consumes" and "produces" are never used. Shouldn't they be applied in request / response?
ResponseType and extraHttpRequestParams seems to be properly done for typescript-angular.
Swagger-codegen version
2.2.1
Swagger declaration file content or url
http://petstore.swagger.io/v2/swagger.json
Command line used for generation
java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l typescript-angular2 -o c:\temp\ng2_api_client
Steps to reproduce
Run client API generation on Petstore swagger.json - all requestOption.responseType are Json and extraHttpRequestParams is not used.
Related issues
Suggest a Fix
mustache template modification for typescript-angular2 (see typescript-angular as an example)?
The text was updated successfully, but these errors were encountered: