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

[csharp] Multiple response types not supported #1562

Open
scott-lin opened this issue Nov 27, 2018 · 1 comment
Open

[csharp] Multiple response types not supported #1562

scott-lin opened this issue Nov 27, 2018 · 1 comment

Comments

@scott-lin
Copy link

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?

@jimschubert
Copy link
Member

@scott-lin sorry for taking so long to triage the issues/PRs. I'm just now finding free time after moving into my first new home.

Would you be able to provide an example of how you'd expect to see such a method with multiple possible return types defined? I have an idea or two, but they'd be borrowed from Scala and may not be ideal for C#.

For the PHP example you've linked, it's a different beast because that's technically a dynamic language, so I unfortunately couldn't model after that approach unless the return type was Object.

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