PATCH added for person endpoint

This commit is contained in:
Julie Lenaerts 2021-09-29 14:22:55 +02:00
parent fc1dd499c4
commit f2ebb1f33c
2 changed files with 31 additions and 1 deletions

View File

@ -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' => [

View File

@ -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: