Adding properties by reference to a definition

16 views
Skip to first unread message

miguel loayza

unread,
Nov 29, 2016, 3:36:14 PM11/29/16
to Swagger
When creating a definition in swagger-php, I want to add a set of standard properties to the definition via reference. How do i do this? Here is what i'm trying to accomplish.

* @SWG\Definition(

*         definition="StandardDates",

*         @SWG\Property( property="createdate", type="integer", description="(EPOCH Timestamp) Date and time the item was created" ),

*         @SWG\Property( property="modifieddate", type="integer", description="(EPOCH Timestamp) Date and time the item was modified" ),

*         @SWG\Property( property="deletedate", type="integer", description="(EPOCH Timestamp) Date and time the item was marked as deleted" )

* )

* @SWG\Definition(

*         definition="PetInfo",

*         @SWG\Property( property="petBreed", type="string"),

*         @SWG\Property( property="petName", type="string"),

*         ref="#/definitions/StandardDates"

* ),

*

* @SWG\Response

* (@SWG\Schema(ref="#/definitions/PetInfo"))


Expected Response

{

 "petBreed":"",

 "petName":"",

 "createdate":"",

 "modifieddate":"",

 "deletedate":""

}

Reply all
Reply to author
Forward
0 new messages