-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathUser.yaml
More file actions
105 lines (105 loc) · 3.26 KB
/
User.yaml
File metadata and controls
105 lines (105 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Acme\Domain\User\User:
properties:
uuid:
identifier: true
collectionOperations:
get:
method: GET
filters: [ 'user.search_filter' ]
output: Acme\UI\Http\Rest\Presentation\User\UserView
normalization_context:
groups: [ profile ]
get_v2:
path: v2/users
method: GET
query: Acme\Application\UseCase\Query\User\GetUsers\GetUsersQuery
filters: [ 'user.search_filter' ]
output: Acme\UI\Http\Rest\Presentation\User\UserProfileView
post:
method: POST
path: '/signup'
messenger: true
input: Acme\Application\UseCase\Command\User\SignUp\SignUpInput
output: false
validate: false
status: 202
openapi_context:
summary: Create a user account
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
uuid:
type: string
format: uuid
required: true
description: Uuid Version 4 https://www.uuidgenerator.net/
email:
type: string
format: email
required: true
password:
type: string
format: password
required: true
example: yourstrongpassword
responses:
202:
description: Request has been received and will be treated later
400:
description: Invalid input
itemOperations:
change_email:
method: PUT
path: '/users/{uuid}/email'
messenger: true
input: Acme\Application\UseCase\Command\User\ChangeEmail\ChangeEmailInput
# Check if the user can edit email
# - `is_granted` relies on Acme\Infrastructure\User\Security\Voter\UserVoter
# - `uuid` comes from URL
security: 'is_granted("user_change_email", uuid)'
# Disable API Platform data retriever
read: false
# No content in the response
output: false
# By pass response validation to allow null response
validate: false
# Override default documentation
openapi_context:
summary: Update user email
# API Platform only supports identifier named `id` in path
parameters:
- in: path
name: uuid
type: string
required: true
responses:
204:
description: User email updated successfully
400:
description: Invalid input
409:
description: Conflict
get:
method: GET
output: Acme\UI\Http\Rest\Presentation\User\UserView
normalization_context:
groups: [ profile ]
get_by_email:
method: GET
path: '/users-by-email/{email}'
controller: Acme\UI\Http\Rest\Controller\User\GetUserByEmailController
read: false
input: Acme\Application\UseCase\Query\User\FindByEmail\FindByEmailQuery
output: Acme\UI\Http\Rest\Presentation\User\UserView
normalization_context:
groups: [ profile ]
openapi_context:
parameters:
- in: path
name: email
type: string
required: true