I am interested in creating a Model / Example section for my GET request using Swagger.
The link in the official example shows that the section is excellent.
In official documents, it is created using the existing model:
* @SWG\Schema(ref="#/definitions/User")
I do not have such an option, because my properties are generated by REST.
I tried as follows:
/**
* @SWG\Get(
...
* @SWG\Response(
* response="200",
* description="Ok",
* @SWG\Schema(
* type="array",
* @SWG\Property(property="firstname", type="string", example="Steven")
* ),
* ),
* )
*/
It does not work and answers:
fetching resource list: http://localhost/dist/swagger.json; Please wait.
Any help is greatly appreciated. Thanks in advance.
source
share