OpenAPITools / OpenAPITools/openapi-generator
[csharp] Multiple response types not supported
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When multiple responses are present in a v3 OpenAPI document with differing types, only the first one is respected when C# client SDK is generated.
openapi-generator version
3.3.3
OpenAPI declaration file content or url
/my/api/path:
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
type: string
format: byte
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/Microsoft.OpenApi.Services.AutoRestService.ServiceFault'
Command line used for generation
openapi-generator generate -g csharp -i .\openapi.json -o .\output
Related issues/PRs
I see similar issues for other languages, but perhaps C# isn't enhanced yet?
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 supplied OpenAPI declaration and the openapi-generator generate -g csharp command, then trace how the C# generator handles multiple response schemas. Done means the generated client represents both the 200 array response and the 202 ServiceFault response instead of respecting only the first response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100