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

[PHP] Incorrect return types if multiple responses are defined #125

Closed
fMads opened this issue May 22, 2018 · 1 comment
Closed

[PHP] Incorrect return types if multiple responses are defined #125

fMads opened this issue May 22, 2018 · 1 comment

Comments

@fMads
Copy link
Contributor

fMads commented May 22, 2018

Description

If you define multiple responses, the codegen will only support the first one (typically 200).

openapi-generator version

3.0.0-SNAPSHOT

OpenAPI declaration file content or url
  /path
    post:
      responses:
        200:
          schema:
            $ref: '#/definitions/EmptyResponse'
        202:
          schema:
            $ref: '#/definitions/InBackgroundResponse'
Suggest a fix/enhancement

Correctly generate the return-object based on the HTTP Status Code in the Response.
Also fix ReturnType info in DocBlock

fMads added a commit to spysystem/openapi-generator that referenced this issue May 22, 2018
fMads added a commit to spysystem/openapi-generator that referenced this issue Jun 7, 2018
ackintosh pushed a commit that referenced this issue Jun 20, 2018
* #125: Correctly handle multiple valid responses

* Fixed defaultResponses

* Fixed void-returns

* Fixed multiple return-types without an actual type

* Update the samples under openapi3 folder
@ackintosh
Copy link
Contributor

@fMads #128 is merged! Thanks for your contribution.

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

3 participants