openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[PHP] Incorrect return types if multiple responses are defined

Open fMads opened this issue 8 years ago • 2 comments

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 avatar May 22 '18 06:05 fMads

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

ackintosh avatar Jun 20 '18 12:06 ackintosh

This is still happening for Java

slind85 avatar Feb 21 '25 15:02 slind85