swagger-api/swagger-codegen

Empty response body handling in typescript-angular2

Aperta

#4962 aperta il 7 mar 2017

 (24 commenti) (4 reazioni) (0 assegnatari)HTML (5474 fork)batch import
Client: TypeScriptIssue: Bughelp wanted

Metriche repository

Star
 (12.701 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Description

Empty response 200 OK codes are not handled by auto generated api code.

Swagger-codegen version

2.2.2

Swagger declaration file content or url
Command line used for generation

language: typescript-angular2

Steps to reproduce

Build an api response just give 200 as http code but no response body

Suggest a Fix

Here's the current api.mustache at line 45;

return response.json()

It should be;

return response.json() || {};

Guida contributor