Ruby: fix class name reference of nested model

and model name in underscore format, e.g. "my_response".

Closes #2140
This commit is contained in:
xhh 2016-02-18 15:12:34 +08:00
parent c4d799a4a7
commit a21493f2db
4 changed files with 40 additions and 12 deletions

View File

@ -316,7 +316,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
if (type == null) {
return null;
}
return type;
return toModelName(type);
}
@Override

View File

@ -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,

View File

@ -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,

View File

@ -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