问题描述:

I have a JSON Object and its parameters could be require or optional.

I have the following code and I want mark the property inviter_email as optional.

@SWG\Definition(

* definition="newUserModel",

* required={"code", "message"},

* @SWG\Property(

* property="email",

* type="string"

* ),

* @SWG\Property(

* property="name",

* type="string"

* ),

* @SWG\Property(

* property="surname",

* type="string",

* ),

* @SWG\Property(

* property="password",

* type="string",

* ),

* @SWG\Property(

* property="company",

* type="string",

* ),

* @SWG\Property(

* property="phonenumber",

* type="string",

* ),

* @SWG\Property(

* property="inviter_email",

* type="string"

* )

*

* )

*

* @SWG\Post(

* tags={"newUser"},

* path="newUser",

* description="Create a new user",

* summary="Create a user.",

* operationId="newUser",

* consumes={"application/json"},

* produces={"application/json"},

*

* @SWG\Parameter(

* name="user",

* in="body",

* description="New user",

* required=true,

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

* ),

...

相关阅读:
Top