OpenAPITools / OpenAPITools/openapi-generator

[Swift4] Does generator generate error responses for requests?

Open
#1,455 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift General: Question
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Swift client generation from the YAML example and inspect the generated handling for the 200 response versus the 400, 401, 404, and 5XX responses. Done means the generated Swift client accounts for the listed non-success responses instead of generating only the 200 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.