diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php new file mode 100644 index 000000000..6b583f546 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -0,0 +1,10 @@ + \Chill\MainBundle\Entity\User::class, + 'controller' => \Chill\MainBundle\Controller\UserApiController::class, + 'name' => 'user', + 'base_path' => '/api/1.0/main/user', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true + ], + ], + '_entity' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ] + ], + ] + ], ] ]); } diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index b81cc97aa..e53900643 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -10,6 +10,19 @@ servers: components: schemas: + User: + type: object + properties: + id: + type: integer + type: + type: string + enum: + - user + username: + type: string + text: + type: string Center: type: object properties: @@ -425,3 +438,38 @@ paths: description: "not found" 401: description: "Unauthorized" + + + /1.0/main/user.json: + get: + tags: + - user + summary: Return a list of all user + responses: + 200: + description: "ok" + /1.0/main/user/{id}.json: + get: + tags: + - user + summary: Return a user by id + parameters: + - name: id + in: path + required: true + description: The user id + schema: + type: integer + format: integer + minimum: 1 + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 404: + description: "not found" + 401: + description: "Unauthorized"