Skip to content

Commit 35a59fd

Browse files
committed
Fix documentation
1 parent 0e4ad16 commit 35a59fd

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

app/controllers/api/v8/core/submissions/feedback_controller.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ class FeedbackController < Api::V8::BaseController
1919
schema do
2020
key :title, :status
2121
key :required, [:status]
22-
property :status, type: :string, example: 'ok'
23-
key :answers, :array
24-
items do
25-
key :answer, :string
26-
key :answer, :integer
27-
end
22+
property :status do
23+
key :type, :array
24+
items do
25+
key :type, :object
26+
property :answer do
27+
key :type, :string
28+
end
29+
property :question_id do
30+
key :type, :integer
31+
end
32+
end
33+
end
2834
end
2935
end
3036
response 403, '$ref': '#/responses/error'

app/controllers/api/v8/users/basic_info_by_usernames_controller.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ class BasicInfoByUsernamesController < Api::V8::BaseController
1010
operation :post do
1111
key :description, 'Find all users\' basic infos with the posted json array of usernames'
1212
key :operationId, 'findUsersBasicInfoByUsernames'
13+
parameter do
14+
key :name, :usernames
15+
key :in, :body
16+
key :description, 'usernames for which to find basic infos'
17+
key :required, true
18+
schema do
19+
key :'$ref', :UsernamesInput
20+
end
21+
end
1322
key :produces, [
1423
'application/json'
1524
]
@@ -31,6 +40,22 @@ class BasicInfoByUsernamesController < Api::V8::BaseController
3140
end
3241
end
3342

43+
swagger_schema :UsernamesInput do
44+
allOf do
45+
schema do
46+
property :usernames do
47+
key :type, :array
48+
items do
49+
key :type, :string
50+
property :username do
51+
key :type, :string
52+
end
53+
end
54+
end
55+
end
56+
end
57+
end
58+
3459

3560
skip_authorization_check
3661

0 commit comments

Comments
 (0)