From f2ebb1f33c695b223f05ee4eaea7d5a676be6a0b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 29 Sep 2021 14:22:55 +0200 Subject: [PATCH] PATCH added for person endpoint --- .../ChillPersonExtension.php | 3 +- .../ChillPersonBundle/chill.api.specs.yaml | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 485185ce7..d597e3572 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -640,12 +640,13 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_GET => true, Request::METHOD_HEAD => true, Request::METHOD_POST=> true, + Request::METHOD_PATCH => true ], 'roles' => [ Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, Request::METHOD_HEAD => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, - + Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, ], ], 'address' => [ diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml index 020fa409f..2ebb35d00 100644 --- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml @@ -298,6 +298,35 @@ paths: $ref: "#/components/schemas/Person" 403: description: "Unauthorized" + patch: + tags: + - person + summary: "Alter a person" + parameters: + - name: id + in: path + required: true + description: The person's id + schema: + type: integer + format: integer + minimum: 1 + requestBody: + description: "A person" + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Person" + responses: + 401: + description: "Unauthorized" + 404: + description: "Not found" + 200: + description: "OK" + 422: + description: "Object with validation errors" /1.0/person/person.json: post: