Skip to content

Commit

Permalink
add annotation to nested API
Browse files Browse the repository at this point in the history
  • Loading branch information
gong023 committed May 12, 2014
1 parent acb5f78 commit 072b5bc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions web/index.php
Expand Up @@ -34,6 +34,31 @@
return $app->json($response);
});

/**
* @SWG\Resource(
* resourcePath="nested",
* @SWG\Api(
* path="/nested",
* description="nested api structure",
* @SWG\Operation(
* method="GET",type="NestedMember",nickname="nested"
* )
* )
* )
*
* @SWG\Model(
* id="NestedMember",
* @SWG\Property(name="id", type="integer", required=true, description="user id"),
* @SWG\Property(name="name", type="string", required=true, description="user name"),
* @SWG\Property(name="birth", type="Birth", required=true, description="birth day,month")
* )
*
* @SWG\Model(
* id="Birth",
* @SWG\Property(name="month", type="string", required=true, description="month"),
* @SWG\Property(name="day", type="integer", required=true, description="day")
* )
*/
$app->get('/nested', function () use ($app) {
$response = [
'id' => 0,
Expand Down

0 comments on commit 072b5bc

Please sign in to comment.