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

Question: How to run filter on response object? #133

Closed tmikaeld closed 2 years ago

tmikaeld commented 7 years ago

I've tried this:

           'models'      => [
                'json'       => [
                    'type'                 => 'object',
                    'additionalProperties' => [ 
                        'location' => 'json',
                        'filters'  => [ 'BcClient::objectToArray' ]
                    ]
                ]
            ]

But the response never get processed, the filter function does work on the response without filters.

danizord commented 7 years ago

@tmikaeld I'm having the same issue here. Have you managed to achive this?

tmikaeld commented 7 years ago

@danizord Unfortunately not, I'm still stuck on it

Konafets commented 7 years ago

I thought it was done because you closed it. Let me have look what happens there.

danizord commented 7 years ago

@Konafets According to the schema you linked, the properties of models is a $ref of parameters, which does contain filters.

Konafets commented 7 years ago

Yes, that I was figure out too and edited my comment ;-)

tmikaeld commented 7 years ago

@Konafets I saw the docs too, but figured it was only for single values.

And i found another project that used filter on the response, but i couldn't get that working either.

I closed it because i figured i did something wrong and didn't have time to fiddle with it.

tmikaeld commented 7 years ago

I'm still curious for a solution though, I'd rather do it properly.

danizord commented 7 years ago

Hey @tmikaeld and @Konafets, I've sent a PR to fix this: https://github.com/guzzle/guzzle-services/pull/138

GrahamCampbell commented 2 years ago

Closing since stale - I'm doing a cleanup across the whole organization, to enable us to focus on the tickets that are still live and have interest. Please feel free to open a new issue if this still is important to you. :)