OpenAPITools / OpenAPITools/openapi-generator
[REQ] Swift5 client: support error response schema
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
When an error occurs on the server, the server responds with an error object which is specified in the OpenAPI file. Unfortunately, the swift client does not take into account this and return a parse error instead because it did not expect that object.
The bug https://github.com/OpenAPITools/openapi-generator/issues/5504 describes this well
Describe the solution you'd like
I'd like the swift client to take into account the schema defined for error responses and to parse the response according to that schema, so the response object can be used just like for 200 responses
Describe alternatives you've considered
Right now, i end up creating code in my error handling code to parse the object manually.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Swift client generation path and the OpenAPI file's error response schemas, using issue #5504 for context. Trace how successful responses are parsed and identify where an error object instead becomes a parse error. Done means generated Swift clients parse documented error responses into usable response objects rather than failing during parsing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, swift
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100