Skip to content

Commit afdef8f

Browse files
yinmwing328
authored andcommitted
[Ruby] Fix method split (#780)
* Fix methods split for readable * Recreate sample
1 parent d019bbd commit afdef8f

50 files changed

Lines changed: 84 additions & 49 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/ruby-client/api.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ module {{moduleName}}
186186
end
187187
return data, status_code, headers
188188
end
189+
189190
{{/operation}}
190191
end
191192
{{/operations}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.0-SNAPSHOT
1+
3.2.1-SNAPSHOT

samples/client/petstore/ruby/lib/petstore.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -73,5 +73,6 @@ def call_123_test_special_tags_with_http_info(client, opts = {})
7373
end
7474
return data, status_code, headers
7575
end
76+
7677
end
7778
end

samples/client/petstore/ruby/lib/petstore/api/fake_api.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -65,6 +65,7 @@ def fake_outer_boolean_serialize_with_http_info(opts = {})
6565
end
6666
return data, status_code, headers
6767
end
68+
6869
# Test serialization of object with outer number type
6970
# @param [Hash] opts the optional parameters
7071
# @option opts [OuterComposite] :outer_composite Input composite as post body
@@ -111,6 +112,7 @@ def fake_outer_composite_serialize_with_http_info(opts = {})
111112
end
112113
return data, status_code, headers
113114
end
115+
114116
# Test serialization of outer number types
115117
# @param [Hash] opts the optional parameters
116118
# @option opts [Float] :body Input number as post body
@@ -157,6 +159,7 @@ def fake_outer_number_serialize_with_http_info(opts = {})
157159
end
158160
return data, status_code, headers
159161
end
162+
160163
# Test serialization of outer string types
161164
# @param [Hash] opts the optional parameters
162165
# @option opts [String] :body Input string as post body
@@ -203,6 +206,7 @@ def fake_outer_string_serialize_with_http_info(opts = {})
203206
end
204207
return data, status_code, headers
205208
end
209+
206210
# For this test, the body for this request much reference a schema named `File`.
207211
# @param file_schema_test_class
208212
# @param [Hash] opts the optional parameters
@@ -252,6 +256,7 @@ def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {})
252256
end
253257
return data, status_code, headers
254258
end
259+
255260
# @param query
256261
# @param user
257262
# @param [Hash] opts the optional parameters
@@ -306,6 +311,7 @@ def test_body_with_query_params_with_http_info(query, user, opts = {})
306311
end
307312
return data, status_code, headers
308313
end
314+
309315
# To test \"client\" model
310316
# To test \"client\" model
311317
# @param client client model
@@ -360,6 +366,7 @@ def test_client_model_with_http_info(client, opts = {})
360366
end
361367
return data, status_code, headers
362368
end
369+
363370
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
364371
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
365372
# @param number None
@@ -515,6 +522,7 @@ def test_endpoint_parameters_with_http_info(number, double, pattern_without_deli
515522
end
516523
return data, status_code, headers
517524
end
525+
518526
# To test enum parameters
519527
# To test enum parameters
520528
# @param [Hash] opts the optional parameters
@@ -608,6 +616,7 @@ def test_enum_parameters_with_http_info(opts = {})
608616
end
609617
return data, status_code, headers
610618
end
619+
611620
# test inline additionalProperties
612621
# @param request_body request body
613622
# @param [Hash] opts the optional parameters
@@ -657,6 +666,7 @@ def test_inline_additional_properties_with_http_info(request_body, opts = {})
657666
end
658667
return data, status_code, headers
659668
end
669+
660670
# test json serialization of form data
661671
# @param param field1
662672
# @param param2 field2
@@ -714,5 +724,6 @@ def test_json_form_data_with_http_info(param, param2, opts = {})
714724
end
715725
return data, status_code, headers
716726
end
727+
717728
end
718729
end

samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -73,5 +73,6 @@ def test_classname_with_http_info(client, opts = {})
7373
end
7474
return data, status_code, headers
7575
end
76+
7677
end
7778
end

samples/client/petstore/ruby/lib/petstore/api/pet_api.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -68,6 +68,7 @@ def add_pet_with_http_info(pet, opts = {})
6868
end
6969
return data, status_code, headers
7070
end
71+
7172
# Deletes a pet
7273
# @param pet_id Pet id to delete
7374
# @param [Hash] opts the optional parameters
@@ -118,6 +119,7 @@ def delete_pet_with_http_info(pet_id, opts = {})
118119
end
119120
return data, status_code, headers
120121
end
122+
121123
# Finds Pets by status
122124
# Multiple status values can be provided with comma separated strings
123125
# @param status Status values that need to be considered for filter
@@ -171,6 +173,7 @@ def find_pets_by_status_with_http_info(status, opts = {})
171173
end
172174
return data, status_code, headers
173175
end
176+
174177
# Finds Pets by tags
175178
# Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
176179
# @param tags Tags to filter by
@@ -224,6 +227,7 @@ def find_pets_by_tags_with_http_info(tags, opts = {})
224227
end
225228
return data, status_code, headers
226229
end
230+
227231
# Find pet by ID
228232
# Returns a single pet
229233
# @param pet_id ID of pet to return
@@ -276,6 +280,7 @@ def get_pet_by_id_with_http_info(pet_id, opts = {})
276280
end
277281
return data, status_code, headers
278282
end
283+
279284
# Update an existing pet
280285
# @param pet Pet object that needs to be added to the store
281286
# @param [Hash] opts the optional parameters
@@ -325,6 +330,7 @@ def update_pet_with_http_info(pet, opts = {})
325330
end
326331
return data, status_code, headers
327332
end
333+
328334
# Updates a pet in the store with form data
329335
# @param pet_id ID of pet that needs to be updated
330336
# @param [Hash] opts the optional parameters
@@ -380,6 +386,7 @@ def update_pet_with_form_with_http_info(pet_id, opts = {})
380386
end
381387
return data, status_code, headers
382388
end
389+
383390
# uploads an image
384391
# @param pet_id ID of pet to update
385392
# @param [Hash] opts the optional parameters
@@ -438,6 +445,7 @@ def upload_file_with_http_info(pet_id, opts = {})
438445
end
439446
return data, status_code, headers
440447
end
448+
441449
# uploads an image (required)
442450
# @param pet_id ID of pet to update
443451
# @param required_file file to upload
@@ -500,5 +508,6 @@ def upload_file_with_required_file_with_http_info(pet_id, required_file, opts =
500508
end
501509
return data, status_code, headers
502510
end
511+
503512
end
504513
end

samples/client/petstore/ruby/lib/petstore/api/store_api.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -68,6 +68,7 @@ def delete_order_with_http_info(order_id, opts = {})
6868
end
6969
return data, status_code, headers
7070
end
71+
7172
# Returns pet inventories by status
7273
# Returns a map of status codes to quantities
7374
# @param [Hash] opts the optional parameters
@@ -114,6 +115,7 @@ def get_inventory_with_http_info(opts = {})
114115
end
115116
return data, status_code, headers
116117
end
118+
117119
# Find purchase order by ID
118120
# For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
119121
# @param order_id ID of pet that needs to be fetched
@@ -174,6 +176,7 @@ def get_order_by_id_with_http_info(order_id, opts = {})
174176
end
175177
return data, status_code, headers
176178
end
179+
177180
# Place an order for a pet
178181
# @param order order placed for purchasing the pet
179182
# @param [Hash] opts the optional parameters
@@ -224,5 +227,6 @@ def place_order_with_http_info(order, opts = {})
224227
end
225228
return data, status_code, headers
226229
end
230+
227231
end
228232
end

samples/client/petstore/ruby/lib/petstore/api/user_api.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

@@ -68,6 +68,7 @@ def create_user_with_http_info(user, opts = {})
6868
end
6969
return data, status_code, headers
7070
end
71+
7172
# Creates list of users with given input array
7273
# @param user List of user object
7374
# @param [Hash] opts the optional parameters
@@ -115,6 +116,7 @@ def create_users_with_array_input_with_http_info(user, opts = {})
115116
end
116117
return data, status_code, headers
117118
end
119+
118120
# Creates list of users with given input array
119121
# @param user List of user object
120122
# @param [Hash] opts the optional parameters
@@ -162,6 +164,7 @@ def create_users_with_list_input_with_http_info(user, opts = {})
162164
end
163165
return data, status_code, headers
164166
end
167+
165168
# Delete user
166169
# This can only be done by the logged in user.
167170
# @param username The name that needs to be deleted
@@ -211,6 +214,7 @@ def delete_user_with_http_info(username, opts = {})
211214
end
212215
return data, status_code, headers
213216
end
217+
214218
# Get user by user name
215219
# @param username The name that needs to be fetched. Use user1 for testing.
216220
# @param [Hash] opts the optional parameters
@@ -261,6 +265,7 @@ def get_user_by_name_with_http_info(username, opts = {})
261265
end
262266
return data, status_code, headers
263267
end
268+
264269
# Logs user into the system
265270
# @param username The user name for login
266271
# @param password The password for login in clear text
@@ -319,6 +324,7 @@ def login_user_with_http_info(username, password, opts = {})
319324
end
320325
return data, status_code, headers
321326
end
327+
322328
# Logs out current logged in user session
323329
# @param [Hash] opts the optional parameters
324330
# @return [nil]
@@ -360,6 +366,7 @@ def logout_user_with_http_info(opts = {})
360366
end
361367
return data, status_code, headers
362368
end
369+
363370
# Updated user
364371
# This can only be done by the logged in user.
365372
# @param username name that need to be deleted
@@ -415,5 +422,6 @@ def update_user_with_http_info(username, user, opts = {})
415422
end
416423
return data, status_code, headers
417424
end
425+
418426
end
419427
end

samples/client/petstore/ruby/lib/petstore/api_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
OpenAPI spec version: 1.0.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 3.2.0-SNAPSHOT
9+
OpenAPI Generator version: 3.2.1-SNAPSHOT
1010
1111
=end
1212

0 commit comments

Comments
 (0)