Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Swift4] Does generator generate error responses for requests? #1455

Open
andreyshade opened this issue Nov 15, 2018 · 2 comments
Open

[Swift4] Does generator generate error responses for requests? #1455

andreyshade opened this issue Nov 15, 2018 · 2 comments

Comments

@andreyshade
Copy link

Description

When I tried to generate swift client for yaml file contains different types of responses. For example:

 responses:
        '200':
          description: OK
        '400':
          description: Bad request. User ID must be an integer and larger than 0.
        '401':
          description: Authorization information is missing or invalid.
        '404':
          description: A user with the specified ID was not found.
        '5XX':
          description: Unexpected error.

It will generate only 200 response. How to generate another responses?

@wing328
Copy link
Member

wing328 commented Nov 20, 2018

Is it correct to say that these error descriptions are included in the HTTP response body? If yes, then I think the exception should probably contain the "description" (at least that's how we do it in Ruby, PHP, C#, etc client)

@andreyshade
Copy link
Author

No, I mean about generated client code which include only handling 200 response only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants