-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpasswords_controller.rb
More file actions
103 lines (92 loc) · 2.74 KB
/
Copy pathpasswords_controller.rb
File metadata and controls
103 lines (92 loc) · 2.74 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
# frozen_string_literal: true
module Controllers
module Users
class PasswordsController
include Swagger::Blocks
swagger_path '/users/password' do
operation :post do
key :summary, 'Reset password'
key :description, 'Send an email about resetting password'
key :operationId, 'sendResetPasswordInformation'
key :tags, [
'User Passwords'
]
request_body do
key :description, 'User email'
key :required, true
content :'application/json' do
schema do
key :'$ref', :UsersPasswordsSendInstructionsContractInput
end
end
end
response 200 do
key :description, 'Successful response'
content :'application/json' do
schema do
key :'$ref', :UserResetPasswordSuccessResponse
end
end
end
response 422 do
key :description, 'Somethins goes wrong'
content :'application/json' do
schema do
key :'$ref', :ErrorResponse
end
end
end
response 401 do
key :description, 'Invalid client credentials passed'
content :'application/json' do
schema do
key :'$ref', :ErrorResponse
end
end
end
end
operation :patch do
key :summary, 'Update password'
key :description, 'Update user password with token'
key :operationId, 'updateUserPassword'
key :tags, [
'User Passwords'
]
request_body do
key :description, 'Password credentials'
key :required, true
content :'application/json' do
schema do
key :'$ref', :UsersPasswordsUpdateContractInput
end
end
end
response 200 do
key :description, 'Successful response'
content :'application/json' do
schema do
key :'$ref', :UserUpdatePasswordSuccessResponse
end
end
end
response 422 do
key :description, 'Something goes wrong'
content :'application/json' do
schema do
key :'$ref', :ErrorResponse
end
end
end
response 401 do
key :description, 'Invalid client credentials passed'
content :'application/json' do
schema do
key :'$ref', :ErrorResponse
end
end
end
end
end
end
end
end