How to generate Model/Example value section for GET request in Swagger

Viewed 3791

I am concerned on generating Model/Example value section for my GET request with Swagger. The link to official example shows that section perfectly.

In official docs it is generated using existing model:

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

I don't have such an option, because my properties is generated by REST.

I have tried the following way:

/**
 * @SWG\Get(
...
 *     @SWG\Response(
 *         response="200",
 *         description="Ok",
 *         @SWG\Schema(
 *             type="array",
 *             @SWG\Property(property="firstname", type="string", example="Steven")
 *         ),
 *     ),
 * )
 */

It is not working and answers:

fetching resource list: http://localhost/dist/swagger.json; Please wait.

Any help is highly appreciated. Thanks in advance.

1 Answers
Related