swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[Swift4] 204 No Content returns error

Open nfortenberry opened this issue 8 years ago • 3 comments

Description

Swift 4 code-gen issue: If a request returns a status code of 204 with no content, the completion handler will return an error and nil response. Since a 204 with no content is expected, no error should be thrown.

Swagger-codegen version

Swagger version 2.3.1

Steps to reproduce

In swagger, create a request that returns a 204 and no content.

Suggest a fix/enhancement

An error should not be thrown.

nfortenberry avatar Mar 15 '18 20:03 nfortenberry

@wing328 Do you know we have 204 response api definition in petstore.yaml? I also need to use 204 response api. If not, we should add as reference.

d-date avatar Mar 27 '18 07:03 d-date

@nfortenberry By this PR, we can accept no content as Void response.

d-date avatar Mar 27 '18 09:03 d-date

Great! Thank you!

nfortenberry avatar Mar 27 '18 17:03 nfortenberry