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

Extending a parameter that extends another parameter doesn't work as expected #184

Open garrettrathbone opened 2 years ago

garrettrathbone commented 2 years ago

Description If a model/parameter (model 1) extends another model/parameter (model 2) that itself extends another model/parameter (model 3), it should be assumed that model 1 has properties that were pulled through from model 3, but instead only values from model 2 are pulled through.

How to reproduce Create 3 models:

You'd expect model 1 to then have properties from both model 2 and 3, but it only has properties from model 2.

Possible Solution I believe the issue is being caused from when the extends is converted to an array to add to the data on parameter construction in the Parameter class. $data += $extends->toArray(); The toArray method returns the originalData property, which is never modified even when extending.

The possible solution would be to additionally merge the $extends->toArray() data in with the $this->originalData at the same time as when it's added to the current $data. Either that or set $data to $this->originalData (which currently happens first) after the $ref and extends functionality is ran.