diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 5c154d8d38e..a557872c805 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -316,7 +316,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { if (type == null) { return null; } - return type; + return toModelName(type); } @Override diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index f6d3a52a760..c8aa23b6565 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -298,7 +298,7 @@ module Petstore # http body (model) post_body = nil - auth_names = ['api_key'] + auth_names = ['petstore_auth', 'api_key'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, @@ -550,7 +550,7 @@ module Petstore # http body (model) post_body = nil - auth_names = ['api_key'] + auth_names = ['petstore_auth', 'api_key'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 40c27f23f8e..828435653b2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -122,7 +122,7 @@ module Petstore # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = [] + auth_names = ['test_api_client_id', 'test_api_client_secret'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, @@ -182,7 +182,7 @@ module Petstore # http body (model) post_body = nil - auth_names = [] + auth_names = ['test_api_key_query', 'test_api_key_header'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 05973753287..60f689cda6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -157,13 +157,6 @@ module Petstore # Returns Auth Settings hash for api client. def auth_settings { - 'api_key' => - { - type: 'api_key', - in: 'header', - key: 'api_key', - value: api_key_with_prefix('api_key') - }, 'petstore_auth' => { type: 'oauth2', @@ -171,6 +164,41 @@ module Petstore key: 'Authorization', value: "Bearer #{access_token}" }, + 'test_api_client_id' => + { + type: 'api_key', + in: 'header', + key: 'x-test_api_client_id', + value: api_key_with_prefix('x-test_api_client_id') + }, + 'test_api_client_secret' => + { + type: 'api_key', + in: 'header', + key: 'x-test_api_client_secret', + value: api_key_with_prefix('x-test_api_client_secret') + }, + 'api_key' => + { + type: 'api_key', + in: 'header', + key: 'api_key', + value: api_key_with_prefix('api_key') + }, + 'test_api_key_query' => + { + type: 'api_key', + in: 'query', + key: 'test_api_key_query', + value: api_key_with_prefix('test_api_key_query') + }, + 'test_api_key_header' => + { + type: 'api_key', + in: 'header', + key: 'test_api_key_header', + value: api_key_with_prefix('test_api_key_header') + }, } end end