Php “如何放置数组”;[……”是;括号中的虚张声势和拉雷维尔的评论?
我无法在带有数组括号的示例中编写JSON代码Php “如何放置数组”;[……”是;括号中的虚张声势和拉雷维尔的评论?,php,swagger,laravel-5.5,Php,Swagger,Laravel 5.5,我无法在带有数组括号的示例中编写JSON代码 @SWG\Definition( * definition="UserResponse", * @SWG\Property(property="response", example={ * "id": 1, * "name": "Raj", * "userprofile": [{ * "email"
@SWG\Definition(
* definition="UserResponse",
* @SWG\Property(property="response", example={
* "id": 1,
* "name": "Raj",
* "userprofile": [{
* "email": "raj@gmail.com",
* "phone": "9999999999",
* }],
* "updated_at": "2017-03-06 12:03:12",
* "created_at": "2017-03-06 12:03:12"
* }
* ),
* ),
*/
我希望这种输出使用招摇响应输出:
{
"id": 1,
"name": "Raj",
"userprofile": [
{
"email": "raj@gmail.com",
"phone": "9999999999",
}
],
"updated_at": "2017-03-06 12:03:12",
"created_at": "2017-03-06 12:03:12"
}
根据以上代码,我需要以下类型的输出:
谢谢, 你只需要添加“{”花键“}”,因此它会考虑数组“[]”括号。
@SWG\Definition(
* definition="UserResponse",
* @SWG\Property(property="response", example={
* "id": 1,
* "name": "Raj",
* "userprofile": {{
* "email": "raj@gmail.com",
* "phone": "9999999999",
* }},
* "updated_at": "2017-03-06 12:03:12",
* "created_at": "2017-03-06 12:03:12"
* }
* ),
* ),
*/
谢谢你的回答,让我检查一下,让你知道同样的情况。