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-netcore] How to deal with different response objects? #12507

Open
jangaehler opened this issue Jun 1, 2022 · 1 comment
Open

[csharp-netcore] How to deal with different response objects? #12507

jangaehler opened this issue Jun 1, 2022 · 1 comment

Comments

@jangaehler
Copy link

Description

The Api definition specifies that for different status codes, different objects are returned. The generated client always expects a DataDeliveryReceipt object, if the response is e.g. 412, an ApiException is thrown and I see the ValidationResponse as string in the ErrorContent. I expected to get the Error Code and the ValidationResponse object. What is the intended procedure in such a case or does the generator not support that?

openapi-generator version

6.0.0

OpenAPI declaration file content or url
responses:
        "200":
          description: A receipt of the data received.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDeliveryReceipt'
        "400":
          description: Processing conflicts occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessingConflicts'
        "401":
          description: Authorization failure.
        "403":
          description: No permission to the requested data with the given credentials.
        "412":
          description: Validation errors occured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
        "500":
          description: Technical error.

The complete .yaml File can be found here. https://arge-heiwako.de/wp-content/uploads/2022/03/arge-spec-on-site-roles_1_1.zip

Related issues/PRs

#9966

@devhl-labs
Copy link
Contributor

If it doesn't return a ValidationResponse, then it's not supported. Submit a PR if you want it supported.

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

No branches or pull requests

2 participants