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 7efcd21c74d..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', 'petstore_auth'] + 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', 'petstore_auth'] + 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 5b669bca101..828435653b2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -182,7 +182,7 @@ module Petstore # http body (model) post_body = nil - auth_names = ['test_api_key_header', 'test_api_key_query'] + 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 e5f39898027..60f689cda6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -157,26 +157,12 @@ module Petstore # Returns Auth Settings hash for api client. def auth_settings { - 'test_api_key_header' => + 'petstore_auth' => { - type: 'api_key', + type: 'oauth2', in: 'header', - key: 'test_api_key_header', - value: api_key_with_prefix('test_api_key_header') - }, - 'api_key' => - { - type: 'api_key', - in: 'header', - key: 'api_key', - value: api_key_with_prefix('api_key') - }, - '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') + key: 'Authorization', + value: "Bearer #{access_token}" }, 'test_api_client_id' => { @@ -185,6 +171,20 @@ module Petstore 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', @@ -192,12 +192,12 @@ module Petstore key: 'test_api_key_query', value: api_key_with_prefix('test_api_key_query') }, - 'petstore_auth' => + 'test_api_key_header' => { - type: 'oauth2', + type: 'api_key', in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" + key: 'test_api_key_header', + value: api_key_with_prefix('test_api_key_header') }, } end