guzzle / guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
MIT License
253 stars 78 forks source link

Breaking change for object #148

Closed bakura10 closed 3 years ago

bakura10 commented 7 years ago

Hi,

I didn't have time to check yet, but we had a user of our library ZfrShopify having a breaking change in last version of Guzzle-Services (downgrading to 1.1.0 fixed the issue).

We have a descriptor that looks like this:

        'GetMetafields' => [
            'httpMethod'       => 'GET',
            'uri'              => 'admin/metafields.json',
            'parameters'       => [
                'metafield' => [
                    'description' => 'Filter metafields by resource type and ID (accepts sub-fields "owner_id" and "owner_resource")',
                    'location'    => 'query',
                    'type'        => 'object',
                    'required'    => false
                ],
            ]
        ]

We called it this way:

$shopifyClient->getMetafields([
  'metafield' => [
    'owner_id' => 123,
    'owner_resource' => 'product'
  ]
]);

This used to properly serializes those parameters as ?metafield[owner_id]=123&metafield[owner_resource]=product

In the last version, it apparently does not work and serialize it as ?metafield=123&metafield=product, so it's a rather big breaking change.

We'll try to have a look but if you already know the reason, it would be nice to revert!

GrahamCampbell commented 3 years ago

Did you get anywhere with debugging this?

bakura10 commented 3 years ago

Hi Graham ! That’s a long time ago, I do not really remember. I unfortunately stopped backend development a few years ago.

GrahamCampbell commented 3 years ago

Ok, I'm going to close this out. :)