Skip to content

Regression with ArrayObjects in version 0.12.53 #4056

@dunglas

Description

@dunglas

Bug report

Hi, first of all thanks for this great project. It helps us a lot improving the quality of API Platform.

Since the release of the last version, a strange error occurs where we instantiate \ArrayObject objects:

  Line   tests/Swagger/Serializer/ApiGatewayNormalizerTest.php                                                                                                                                    
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  137    Parameter #1 $input of class ArrayObject constructor expects array<string, ArrayObject<string, array<string, array<string,                                                               
         'integer'|'string'|true>&nonEmpty>&nonEmpty>|ArrayObject<string, array<string, (array<string, 'integer'|'string'|true>&nonEmpty)|ArrayObject<string,                                     
         string>>&nonEmpty>|ArrayObject<string, (array<string, ArrayObject<string, bool|string>|ArrayObject<string, string>>&nonEmpty)|string>|ArrayObject<string, (array<string,                 
         ArrayObject<string, string>>&nonEmpty)|string>>|object, array('Dummy' => ArrayObject<string, array<string, array(?'readOnly' => true, 'type' => 'integer'|'string')>&nonEmpty>,          
         'Dummy-list' => ArrayObject<string, array<string, array(?'readOnly' => true, 'type' => 'integer'|'string')>&nonEmpty>, 'Dummy-list_details' => ArrayObject<string, array<string,         
         array(?'readOnly' => true, 'type' => 'integer'|'string')|ArrayObject<string, string>>&nonEmpty>, 'Dummy:OutputDto' => ArrayObject<string, (array<string, ArrayObject<string,             
         bool|string>|ArrayObject<string, string>>&nonEmpty)|string>, 'Dummy:InputDto' => ArrayObject<string, (array<string, ArrayObject<string, string>>&nonEmpty)|string>,                      
         'RelatedDummy-list_details' => ArrayObject<string, (array<string, ArrayObject<string, string>>&nonEmpty)|string>) given.

The error wasn't present with 0.12.52, so it looks like a regression. (I can try to run git bisect if it helps.)

Code snippet that reproduces the problem

https://github.com/api-platform/core/blob/master/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php#L137

The problem occurs at other places in our code base, but not everywhere. For instance, it doesn't occur some lines below (https://github.com/api-platform/core/blob/master/tests/Swagger/Serializer/ApiGatewayNormalizerTest.php#L270).

Expected output

No errors should be reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions