有必要正确生成swagger json

时间:2018-04-14 10:47:37

标签: laravel swagger swagger-editor swagger-php

问题是我需要文档来证明可以以数组的形式传输字段colums,并在其中传输以下字段(name,description,created_at,updated_at,author)。 json已成功生成,但在swagger-editor文档中,这些字段不可见

 /**
         * @SWG\Get(path="/articles",
         *   tags={"Article"},
         *   summary="Get all Articles",
         *   description="Show list of Articles",
         *   operationId="all",
         *   produces={"application/json"},
         *   @SWG\Parameter(
         *     name="columns",
         *     in="query",
         *     description="get specific columns",
         *     required=false,
         *     type="array",
         *     collectionFormat="multi",
         *     @SWG\Items(
         *       type="string",
         *          @SWG\Property(property="name", type="string"),
         *          @SWG\Property(property="description", type="string"),
         *          @SWG\Property(property="author", type="string"),
         *          @SWG\Property(property="created_at", type="string"),
         *          @SWG\Property(property="updated_at)", type="string")
         *      )
         *   ),
         *   @SWG\Response(response="200"),
         *   @SWG\Response(response=500)
         *   ),
         * )
         */

0 个答案:

没有答案