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

[PHP] Deserializing array of objects may not work

Open fMads opened this issue 8 years ago • 1 comments

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

3.0.0-SNAPSHOT

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

fMads avatar May 22 '18 06:05 fMads

Found a but in how we deserialized json to stdClass/array in our code - so I'll close this issue as a non-bug

fMads avatar May 28 '18 09:05 fMads