Skip to content

Commit 6f01c8b

Browse files
committed
fix(crystal): remove useless return_type argument
1 parent 7638e61 commit 6f01c8b

7 files changed

Lines changed: 2 additions & 90 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,13 @@ module {{moduleName}}
159159
# http body (model)
160160
post_body = {{#bodyParam}}{{{paramName}}}.to_json{{/bodyParam}}{{^bodyParam}}nil{{/bodyParam}}
161161

162-
# return_type
163-
return_type = {{#returnType}}"{{{.}}}"{{/returnType}}{{^returnType}}nil{{/returnType}}
164-
165162
# auth_names
166163
auth_names = {{#authMethods}}{{#-first}}[{{/-first}}"{{name}}"{{^-last}}, {{/-last}}{{#-last}}]{{/-last}}{{/authMethods}}{{^authMethods}}[] of String{{/authMethods}}
167164

168165
data, status_code, headers = @api_client.call_api(
169166
http_method: :{{httpMethod}},
170167
path: local_var_path,
171168
operation: :"{{classname}}.{{operationId}}",
172-
return_type: return_type,
173169
post_body: post_body,
174170
auth_names: auth_names,
175171
header_params: header_params,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module {{moduleName}}
119119
#
120120
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
121121
# the data deserialized from response body (could be nil), response status code and response headers.
122-
def call_api(http_method : Symbol, path : String, operation : Symbol, return_type : String?, post_body : String?, auth_names = [] of String, header_params = {} of String => String, query_params = {} of String => String, cookie_params = {} of String => String, form_params = {} of Symbol => (String | ::File))
122+
def call_api(http_method : Symbol, path : String, operation : Symbol, post_body : String?, auth_names = [] of String, header_params = {} of String => String, query_params = {} of String => String, cookie_params = {} of String => String, form_params = {} of Symbol => (String | ::File))
123123
#ssl_options = {
124124
# :ca_file => @config.ssl_ca_file,
125125
# :verify => @config.ssl_verify,

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,13 @@ module Petstore
8383
# http body (model)
8484
post_body = nil
8585

86-
# return_type
87-
return_type = nil
88-
8986
# auth_names
9087
auth_names = [] of String
9188

9289
data, status_code, headers = @api_client.call_api(
9390
http_method: :GET,
9491
path: local_var_path,
9592
operation: :"FakeApi.get_parameter_name_mapping",
96-
return_type: return_type,
9793
post_body: post_body,
9894
auth_names: auth_names,
9995
header_params: header_params,

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,13 @@ module Petstore
6060
# http body (model)
6161
post_body = pet.to_json
6262

63-
# return_type
64-
return_type = "Pet"
65-
6663
# auth_names
6764
auth_names = ["petstore_auth"]
6865

6966
data, status_code, headers = @api_client.call_api(
7067
http_method: :POST,
7168
path: local_var_path,
7269
operation: :"PetApi.add_pet",
73-
return_type: return_type,
7470
post_body: post_body,
7571
auth_names: auth_names,
7672
header_params: header_params,
@@ -126,17 +122,13 @@ module Petstore
126122
# http body (model)
127123
post_body = nil
128124

129-
# return_type
130-
return_type = nil
131-
132125
# auth_names
133126
auth_names = ["petstore_auth"]
134127

135128
data, status_code, headers = @api_client.call_api(
136129
http_method: :DELETE,
137130
path: local_var_path,
138131
operation: :"PetApi.delete_pet",
139-
return_type: return_type,
140132
post_body: post_body,
141133
auth_names: auth_names,
142134
header_params: header_params,
@@ -194,17 +186,13 @@ module Petstore
194186
# http body (model)
195187
post_body = nil
196188

197-
# return_type
198-
return_type = "Array(Pet)"
199-
200189
# auth_names
201190
auth_names = ["petstore_auth"]
202191

203192
data, status_code, headers = @api_client.call_api(
204193
http_method: :GET,
205194
path: local_var_path,
206195
operation: :"PetApi.find_pets_by_status",
207-
return_type: return_type,
208196
post_body: post_body,
209197
auth_names: auth_names,
210198
header_params: header_params,
@@ -262,17 +250,13 @@ module Petstore
262250
# http body (model)
263251
post_body = nil
264252

265-
# return_type
266-
return_type = "Array(Pet)"
267-
268253
# auth_names
269254
auth_names = ["petstore_auth"]
270255

271256
data, status_code, headers = @api_client.call_api(
272257
http_method: :GET,
273258
path: local_var_path,
274259
operation: :"PetApi.find_pets_by_tags",
275-
return_type: return_type,
276260
post_body: post_body,
277261
auth_names: auth_names,
278262
header_params: header_params,
@@ -329,17 +313,13 @@ module Petstore
329313
# http body (model)
330314
post_body = nil
331315

332-
# return_type
333-
return_type = "Pet"
334-
335316
# auth_names
336317
auth_names = ["api_key"]
337318

338319
data, status_code, headers = @api_client.call_api(
339320
http_method: :GET,
340321
path: local_var_path,
341322
operation: :"PetApi.get_pet_by_id",
342-
return_type: return_type,
343323
post_body: post_body,
344324
auth_names: auth_names,
345325
header_params: header_params,
@@ -398,17 +378,13 @@ module Petstore
398378
# http body (model)
399379
post_body = pet.to_json
400380

401-
# return_type
402-
return_type = "Pet"
403-
404381
# auth_names
405382
auth_names = ["petstore_auth"]
406383

407384
data, status_code, headers = @api_client.call_api(
408385
http_method: :PUT,
409386
path: local_var_path,
410387
operation: :"PetApi.update_pet",
411-
return_type: return_type,
412388
post_body: post_body,
413389
auth_names: auth_names,
414390
header_params: header_params,
@@ -467,17 +443,13 @@ module Petstore
467443
# http body (model)
468444
post_body = nil
469445

470-
# return_type
471-
return_type = nil
472-
473446
# auth_names
474447
auth_names = ["petstore_auth"]
475448

476449
data, status_code, headers = @api_client.call_api(
477450
http_method: :POST,
478451
path: local_var_path,
479452
operation: :"PetApi.update_pet_with_form",
480-
return_type: return_type,
481453
post_body: post_body,
482454
auth_names: auth_names,
483455
header_params: header_params,
@@ -538,17 +510,13 @@ module Petstore
538510
# http body (model)
539511
post_body = nil
540512

541-
# return_type
542-
return_type = "ApiResponse"
543-
544513
# auth_names
545514
auth_names = ["petstore_auth"]
546515

547516
data, status_code, headers = @api_client.call_api(
548517
http_method: :POST,
549518
path: local_var_path,
550519
operation: :"PetApi.upload_file",
551-
return_type: return_type,
552520
post_body: post_body,
553521
auth_names: auth_names,
554522
header_params: header_params,

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,13 @@ module Petstore
5656
# http body (model)
5757
post_body = nil
5858

59-
# return_type
60-
return_type = nil
61-
6259
# auth_names
6360
auth_names = [] of String
6461

6562
data, status_code, headers = @api_client.call_api(
6663
http_method: :DELETE,
6764
path: local_var_path,
6865
operation: :"StoreApi.delete_order",
69-
return_type: return_type,
7066
post_body: post_body,
7167
auth_names: auth_names,
7268
header_params: header_params,
@@ -117,17 +113,13 @@ module Petstore
117113
# http body (model)
118114
post_body = nil
119115

120-
# return_type
121-
return_type = "Hash(String, Int32)"
122-
123116
# auth_names
124117
auth_names = ["api_key"]
125118

126119
data, status_code, headers = @api_client.call_api(
127120
http_method: :GET,
128121
path: local_var_path,
129122
operation: :"StoreApi.get_inventory",
130-
return_type: return_type,
131123
post_body: post_body,
132124
auth_names: auth_names,
133125
header_params: header_params,
@@ -192,17 +184,13 @@ module Petstore
192184
# http body (model)
193185
post_body = nil
194186

195-
# return_type
196-
return_type = "Order"
197-
198187
# auth_names
199188
auth_names = [] of String
200189

201190
data, status_code, headers = @api_client.call_api(
202191
http_method: :GET,
203192
path: local_var_path,
204193
operation: :"StoreApi.get_order_by_id",
205-
return_type: return_type,
206194
post_body: post_body,
207195
auth_names: auth_names,
208196
header_params: header_params,
@@ -261,17 +249,13 @@ module Petstore
261249
# http body (model)
262250
post_body = order.to_json
263251

264-
# return_type
265-
return_type = "Order"
266-
267252
# auth_names
268253
auth_names = [] of String
269254

270255
data, status_code, headers = @api_client.call_api(
271256
http_method: :POST,
272257
path: local_var_path,
273258
operation: :"StoreApi.place_order",
274-
return_type: return_type,
275259
post_body: post_body,
276260
auth_names: auth_names,
277261
header_params: header_params,

0 commit comments

Comments
 (0)