swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.05k stars 6.03k forks source link

[PHP] Deserializing array of objects may not work #8163

Open fMads opened 6 years ago

fMads commented 6 years ago
Description

When data structure defines array of object, deserializing doesn't work as the nested data may be an array instead of stdclass.

Swagger-codegen version

2.3

Swagger declaration file content or url
  /path:
    post:
      parameters:
        - in: body
          required: true
          name: objectName
          schema:
            type: object
            properties:
              arrayInObject:
                type: array
                minItems: 1
                items:
                  $ref: '#/definitions/SomeObject'
Suggest a fix/enhancement

Cast data to stdclass, if data is array, when deserializing data

josh123a123 commented 5 years ago

This is not fixed