Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

Property and inheritance #669

Open camlafit opened 3 years ago

camlafit commented 3 years ago

Hello

When we declare an object has return, inheritance is not take in consideration. For example to @return MyValueObject $myobject Description

and

/**
 *@property string $parentobject
 */
Class ParentMyValueObject extends \Luracast\Restler\Data\ValueObject {
    $public $parentobject;
    ...
}

Class MyValueObject extends ParentMyValueObject {
     ...
}

In Model description provide by API Explorer , $parentobject property is missing.

Thanks

camlafit commented 3 years ago

Looks related to subTypes features https://github.com/OAI/OpenAPI-Specification/blob/main/versions/1.2.md#modelSubTypes

camlafit commented 3 years ago

To use subType, I think model structure should be reviewed and to allow others elements than children. As list() are used then to retrieve others contents as subType is not easy .

Arul- commented 3 years ago

Actually inherited properties work just fine. I have added a test in a4871d3e60a4fd35b582558d3446047a2ab1df21 to make sure!

camlafit commented 3 years ago

Hello

When we use @property and settter/getter behavior is different. I prepare a sample code to be more explicit.