Skip to content

Commit 8230154

Browse files
committed
1 parent 7b83462 commit 8230154

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

modules/openapi-generator/src/main/resources/crystal/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module {{moduleName}}
131131
cookie_params = Hash(String, String).new
132132

133133
# query parameters
134-
query_params = Hash(String, String).new
134+
query_params = Hash(String, String | Array(String)).new
135135
{{#queryParams}}
136136
query_params["{{{baseName}}}"] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}) unless {{{paramName}}}.nil?{{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.to_s unless {{{paramName}}}.nil?{{/collectionFormat}}
137137
{{/queryParams}}

modules/openapi-generator/src/main/resources/crystal/api_client.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ module {{moduleName}}
109109
when :pipes
110110
param.join("|")
111111
when :multi
112-
# TODO: Need to fix this
113-
raise "multi is not supported yet"
112+
param
114113
else
115114
raise "unknown collection format: #{collection_format.inspect}"
116115
end
@@ -147,7 +146,8 @@ module {{moduleName}}
147146
cookies: cookie_params,
148147
form: form_or_body,
149148
logging: @config.debugging,
150-
handle_errors: false
149+
handle_errors: false,
150+
params_encoder: Crest::NestedParamsEncoder
151151
)
152152

153153
response = request.execute

samples/client/petstore/crystal/src/petstore/api/fake_api.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module Petstore
6767
cookie_params = Hash(String, String).new
6868

6969
# query parameters
70-
query_params = Hash(String, String).new
70+
query_params = Hash(String, String | Array(String)).new
7171
query_params["type"] = _type.to_s unless _type.nil?
7272
query_params["http_debug_option"] = http_debug_option.to_s unless http_debug_option.nil?
7373

samples/client/petstore/crystal/src/petstore/api/pet_api.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module Petstore
4545
cookie_params = Hash(String, String).new
4646

4747
# query parameters
48-
query_params = Hash(String, String).new
48+
query_params = Hash(String, String | Array(String)).new
4949

5050
# header parameters
5151
header_params = Hash(String, String).new
@@ -110,7 +110,7 @@ module Petstore
110110
cookie_params = Hash(String, String).new
111111

112112
# query parameters
113-
query_params = Hash(String, String).new
113+
query_params = Hash(String, String | Array(String)).new
114114

115115
# header parameters
116116
header_params = Hash(String, String).new
@@ -172,7 +172,7 @@ module Petstore
172172
cookie_params = Hash(String, String).new
173173

174174
# query parameters
175-
query_params = Hash(String, String).new
175+
query_params = Hash(String, String | Array(String)).new
176176
query_params["status"] = @api_client.build_collection_param(status, :csv) unless status.nil?
177177

178178
# header parameters
@@ -236,7 +236,7 @@ module Petstore
236236
cookie_params = Hash(String, String).new
237237

238238
# query parameters
239-
query_params = Hash(String, String).new
239+
query_params = Hash(String, String | Array(String)).new
240240
query_params["tags"] = @api_client.build_collection_param(tags, :csv) unless tags.nil?
241241

242242
# header parameters
@@ -300,7 +300,7 @@ module Petstore
300300
cookie_params = Hash(String, String).new
301301

302302
# query parameters
303-
query_params = Hash(String, String).new
303+
query_params = Hash(String, String | Array(String)).new
304304

305305
# header parameters
306306
header_params = Hash(String, String).new
@@ -363,7 +363,7 @@ module Petstore
363363
cookie_params = Hash(String, String).new
364364

365365
# query parameters
366-
query_params = Hash(String, String).new
366+
query_params = Hash(String, String | Array(String)).new
367367

368368
# header parameters
369369
header_params = Hash(String, String).new
@@ -428,7 +428,7 @@ module Petstore
428428
cookie_params = Hash(String, String).new
429429

430430
# query parameters
431-
query_params = Hash(String, String).new
431+
query_params = Hash(String, String | Array(String)).new
432432

433433
# header parameters
434434
header_params = Hash(String, String).new
@@ -493,7 +493,7 @@ module Petstore
493493
cookie_params = Hash(String, String).new
494494

495495
# query parameters
496-
query_params = Hash(String, String).new
496+
query_params = Hash(String, String | Array(String)).new
497497

498498
# header parameters
499499
header_params = Hash(String, String).new

samples/client/petstore/crystal/src/petstore/api/store_api.cr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module Petstore
4545
cookie_params = Hash(String, String).new
4646

4747
# query parameters
48-
query_params = Hash(String, String).new
48+
query_params = Hash(String, String | Array(String)).new
4949

5050
# header parameters
5151
header_params = Hash(String, String).new
@@ -100,7 +100,7 @@ module Petstore
100100
cookie_params = Hash(String, String).new
101101

102102
# query parameters
103-
query_params = Hash(String, String).new
103+
query_params = Hash(String, String | Array(String)).new
104104

105105
# header parameters
106106
header_params = Hash(String, String).new
@@ -171,7 +171,7 @@ module Petstore
171171
cookie_params = Hash(String, String).new
172172

173173
# query parameters
174-
query_params = Hash(String, String).new
174+
query_params = Hash(String, String | Array(String)).new
175175

176176
# header parameters
177177
header_params = Hash(String, String).new
@@ -234,7 +234,7 @@ module Petstore
234234
cookie_params = Hash(String, String).new
235235

236236
# query parameters
237-
query_params = Hash(String, String).new
237+
query_params = Hash(String, String | Array(String)).new
238238

239239
# header parameters
240240
header_params = Hash(String, String).new

samples/client/petstore/crystal/src/petstore/api/user_api.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module Petstore
4545
cookie_params = Hash(String, String).new
4646

4747
# query parameters
48-
query_params = Hash(String, String).new
48+
query_params = Hash(String, String | Array(String)).new
4949

5050
# header parameters
5151
header_params = Hash(String, String).new
@@ -108,7 +108,7 @@ module Petstore
108108
cookie_params = Hash(String, String).new
109109

110110
# query parameters
111-
query_params = Hash(String, String).new
111+
query_params = Hash(String, String | Array(String)).new
112112

113113
# header parameters
114114
header_params = Hash(String, String).new
@@ -171,7 +171,7 @@ module Petstore
171171
cookie_params = Hash(String, String).new
172172

173173
# query parameters
174-
query_params = Hash(String, String).new
174+
query_params = Hash(String, String | Array(String)).new
175175

176176
# header parameters
177177
header_params = Hash(String, String).new
@@ -234,7 +234,7 @@ module Petstore
234234
cookie_params = Hash(String, String).new
235235

236236
# query parameters
237-
query_params = Hash(String, String).new
237+
query_params = Hash(String, String | Array(String)).new
238238

239239
# header parameters
240240
header_params = Hash(String, String).new
@@ -295,7 +295,7 @@ module Petstore
295295
cookie_params = Hash(String, String).new
296296

297297
# query parameters
298-
query_params = Hash(String, String).new
298+
query_params = Hash(String, String | Array(String)).new
299299

300300
# header parameters
301301
header_params = Hash(String, String).new
@@ -369,7 +369,7 @@ module Petstore
369369
cookie_params = Hash(String, String).new
370370

371371
# query parameters
372-
query_params = Hash(String, String).new
372+
query_params = Hash(String, String | Array(String)).new
373373
query_params["username"] = username.to_s unless username.nil?
374374
query_params["password"] = password.to_s unless password.nil?
375375

@@ -428,7 +428,7 @@ module Petstore
428428
cookie_params = Hash(String, String).new
429429

430430
# query parameters
431-
query_params = Hash(String, String).new
431+
query_params = Hash(String, String | Array(String)).new
432432

433433
# header parameters
434434
header_params = Hash(String, String).new
@@ -495,7 +495,7 @@ module Petstore
495495
cookie_params = Hash(String, String).new
496496

497497
# query parameters
498-
query_params = Hash(String, String).new
498+
query_params = Hash(String, String | Array(String)).new
499499

500500
# header parameters
501501
header_params = Hash(String, String).new

samples/client/petstore/crystal/src/petstore/api_client.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ module Petstore
117117
when :pipes
118118
param.join("|")
119119
when :multi
120-
# TODO: Need to fix this
121-
raise "multi is not supported yet"
120+
param
122121
else
123122
raise "unknown collection format: #{collection_format.inspect}"
124123
end
@@ -155,7 +154,8 @@ module Petstore
155154
cookies: cookie_params,
156155
form: form_or_body,
157156
logging: @config.debugging,
158-
handle_errors: false
157+
handle_errors: false,
158+
params_encoder: Crest::NestedParamsEncoder
159159
)
160160

161161
response = request.execute

0 commit comments

Comments
 (0)