From 9f7f6e33e8688c907408bcca4952ed832c32ae17 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 19 Jan 2022 10:34:33 +0100 Subject: [PATCH] user-job: make an endpoint for userJob + doc swagger --- .../ChillMainExtension.php | 20 ++++++++++++++++ .../ChillMainBundle/chill.api.specs.yaml | 23 +++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 772f4d8ee..27d70e725 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -391,6 +391,26 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => \Chill\MainBundle\Entity\UserJob::class, + 'name' => 'user_job', + 'base_path' => '/api/1.0/main/user-job', + '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, + ], + ], + ], + ], [ 'controller' => \Chill\MainBundle\Controller\AddressReferenceAPIController::class, 'class' => \Chill\MainBundle\Entity\AddressReference::class, diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 753cb855c..4f2e3648e 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -116,7 +116,15 @@ components: type: number minItems: 2 maxItems: 2 - + UserJob: + type: object + properties: + id: + type: integer + label: + type: object + type: + type: string paths: /1.0/search.json: @@ -771,5 +779,16 @@ paths: description: "accepted" 403: description: "unauthorized" - + /1.0/main/user-job.json: + get: + tags: + - user + summary: Return a list of all user jobs + responses: + 200: + description: "ok" + content: + application/json: + schema: + $ref: '#/components/schemas/UserJob'