Commit 543dba2 1 parent adb3a0d commit 543dba2 Copy full SHA for 543dba2
File tree 3 files changed +59
-3
lines changed
lib/apia/open_api/objects
3 files changed +59
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Base < Apia::API
18
18
add "time" , "Allows time telling functions"
19
19
end
20
20
21
- routes do
21
+ routes do # rubocop:disable Metrics/BlockLength
22
22
schema
23
23
24
24
get "time_formatting/incredibly/super/duper/long/format" , controller : Controllers ::TimeController ,
@@ -27,6 +27,7 @@ class Base < Apia::API
27
27
post "example/format_multiple" , controller : Controllers ::TimeController , endpoint : :format_multiple
28
28
29
29
get "plain_text" , endpoint : Endpoints ::PlainTextEndpoint
30
+ post "plain_text" , endpoint : Endpoints ::PlainTextEndpoint
30
31
31
32
get "paginated" , endpoint : Endpoints ::PaginatedEndpoint
32
33
Original file line number Diff line number Diff line change @@ -80,8 +80,10 @@ def generate_child_schemas
80
80
@children = @definition . fields . values
81
81
elsif @definition . type . argument_set?
82
82
@children = @definition . type . klass . definition . arguments . values
83
- @schema [ :description ] ||=
84
- "All '#{ @definition . name } []' params are mutually exclusive, only one can be provided."
83
+ if @definition . type . klass . ancestors . include? ( Apia ::LookupArgumentSet )
84
+ @schema [ :description ] ||=
85
+ "All '#{ @definition . name } []' params are mutually exclusive, only one can be provided."
86
+ end
85
87
elsif @definition . type . object?
86
88
@children = @definition . type . klass . definition . fields . values
87
89
elsif enum_definition?
Original file line number Diff line number Diff line change 308
308
"$ref" : " #/components/responses/APIAuthenticator403Response"
309
309
}
310
310
}
311
+ },
312
+ "post" : {
313
+ "operationId" : " post:plain_text" ,
314
+ "summary" : " Plain Text Endpoint" ,
315
+ "description" : " Return a plain text response" ,
316
+ "tags" : [
317
+ " Core"
318
+ ],
319
+ "requestBody" : {
320
+ "content" : {
321
+ "application/json" : {
322
+ "schema" : {
323
+ "properties" : {
324
+ "disk_template_options" : {
325
+ "type" : " array" ,
326
+ "items" : {
327
+ "$ref" : " #/components/schemas/KeyValue"
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+ }
334
+ },
335
+ "responses" : {
336
+ "200" : {
337
+ "description" : " Return a plain text response" ,
338
+ "content" : {
339
+ "text/plain" : {
340
+ "schema" : {
341
+ "type" : " string"
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "403" : {
347
+ "$ref" : " #/components/responses/APIAuthenticator403Response"
348
+ }
349
+ }
311
350
}
312
351
},
313
352
"/paginated" : {
1098
1137
}
1099
1138
}
1100
1139
},
1140
+ "KeyValue" : {
1141
+ "type" : " object" ,
1142
+ "properties" : {
1143
+ "key" : {
1144
+ "type" : " string"
1145
+ },
1146
+ "value" : {
1147
+ "type" : " string"
1148
+ }
1149
+ },
1150
+ "required" : [
1151
+ " key"
1152
+ ]
1153
+ },
1101
1154
"PaginationObject" : {
1102
1155
"type" : " object" ,
1103
1156
"properties" : {
You can’t perform that action at this time.
0 commit comments