I want to specify a default json value in swagger docs for POST. I am getting T_CLOSE_PARENTHESIS error. I have also tried escaping the ".
/**
* @SWG\Api(path="/api/users",
* @SWG\Operation(
* method="POST",
* summary="Register a user",
* notes="Send a POST request along with required form parameters to add a new user",
* type="string",
* nickname="post-users",
* authorizations={},
* @SWG\Parameter(
* name="email",
* description="The email",
* required=true,
* type="json",
* paramType="body",
* allowMultiple=false,
* defaultValue = "{
"email":"pradeep****@gmail.com",
"first_name":"Pradeep",
"last_name":"Kumar",
"group":"subscriber",
"password":"password"
}",
* ),
*
* @SWG\ResponseMessage(code=200,message="Success"),
* @SWG\ResponseMessage(code=400,message="Bad Request")
* )
* )
*/
To escape a "
in a doctrine/annotation use ""
defaultValue="{""email"":""p****@gmail.com"",""first_name"":""Pradeep""}"
I'm guessing you should convert the defaultValue
into a single line, and escape the quotes with a forward slash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With