Open Ealenn opened 4 years ago
Hi!
I just hit this issue as well. When the server returns 204 and correctly omits the response body the generated client code fails as it still attempts to parse a JSON response.
This also affected the typescript-angular2
generator, (https://github.com/swagger-api/swagger-codegen/issues/3129) although it has been fixed. The fix for the typescript-fetch
generator should be similar.
Hello ! If I have time, I would propose PR, otherwise someone will do it (I hope ❤)
Describe the bug In the case of a REST call that returns a 204 (No-Content)
https://github.com/swagger-api/swagger-codegen/blob/b821aab2df0ce93ca26953ab46d01d11521af0fa/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache#L269
The client leave exception here :
https://github.com/swagger-api/swagger-codegen/blob/b821aab2df0ce93ca26953ab46d01d11521af0fa/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache#L270
Expected behavior The client must be return promise with null response