@@ -16,7 +16,12 @@ class ResponseApiModelsAndPrimitiveTypes < Grape::API
16
16
{ model : Entities ::UseResponse , as : :user_response } ,
17
17
{ type : 'String' , as : :string_response } ,
18
18
{ type : 'Float' , as : :float_response } ,
19
- { type : 'Hash' , as : :hash_response }
19
+ { type : 'Hash' , as : :hash_response } ,
20
+ { type : Array [ Integer ] , as : :array_of_integer_response } ,
21
+ { type : Array [ String ] , as : :array_of_string_response } ,
22
+ { type : Array [ Float ] , as : :array_of_float_response } ,
23
+ { type : Array [ Hash ] , as : :array_of_hash_response } ,
24
+ { type : Array [ Array [ Float ] ] , as : :array_of_array_of_float_response }
20
25
] ,
21
26
failure : [
22
27
{ code : 400 , message : 'NotFound' , model : '' } ,
@@ -56,7 +61,43 @@ def app
56
61
'integer_response' => { 'type' => 'integer' , 'format' => 'int32' } ,
57
62
'string_response' => { 'type' => 'string' } ,
58
63
'float_response' => { 'type' => 'number' , 'format' => 'float' } ,
59
- 'hash_response' => { 'type' => 'object' }
64
+ 'hash_response' => { 'type' => 'object' } ,
65
+ 'array_of_integer_response' => {
66
+ 'type' => 'array' ,
67
+ 'items' => {
68
+ 'type' => 'integer' ,
69
+ 'format' => 'int32'
70
+ }
71
+ } ,
72
+ 'array_of_string_response' => {
73
+ 'type' => 'array' ,
74
+ 'items' => {
75
+ 'type' => 'string'
76
+ }
77
+ } ,
78
+ 'array_of_float_response' => {
79
+ 'type' => 'array' ,
80
+ 'items' => {
81
+ 'type' => 'number' ,
82
+ 'format' => 'float'
83
+ }
84
+ } ,
85
+ 'array_of_hash_response' => {
86
+ 'type' => 'array' ,
87
+ 'items' => {
88
+ 'type' => 'object'
89
+ }
90
+ } ,
91
+ 'array_of_array_of_float_response' => {
92
+ 'type' => 'array' ,
93
+ 'items' => {
94
+ 'type' => 'array' ,
95
+ 'items' => {
96
+ 'type' => 'number' ,
97
+ 'format' => 'float'
98
+ }
99
+ }
100
+ }
60
101
}
61
102
}
62
103
} ,
0 commit comments