mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
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:
parent
c4d799a4a7
commit
a21493f2db
@ -316,7 +316,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
if (type == null) {
|
if (type == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return type;
|
return toModelName(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -298,7 +298,7 @@ module Petstore
|
|||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
|
||||||
auth_names = ['api_key']
|
auth_names = ['petstore_auth', 'api_key']
|
||||||
data, status_code, headers = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -550,7 +550,7 @@ module Petstore
|
|||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
|
||||||
auth_names = ['api_key']
|
auth_names = ['petstore_auth', 'api_key']
|
||||||
data, status_code, headers = @api_client.call_api(:GET, path,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
|
@ -122,7 +122,7 @@ module Petstore
|
|||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = @api_client.object_to_http_body(opts[:'body'])
|
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,
|
data, status_code, headers = @api_client.call_api(:POST, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
@ -182,7 +182,7 @@ module Petstore
|
|||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = nil
|
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,
|
data, status_code, headers = @api_client.call_api(:GET, path,
|
||||||
:header_params => header_params,
|
:header_params => header_params,
|
||||||
:query_params => query_params,
|
:query_params => query_params,
|
||||||
|
@ -157,13 +157,6 @@ module Petstore
|
|||||||
# Returns Auth Settings hash for api client.
|
# Returns Auth Settings hash for api client.
|
||||||
def auth_settings
|
def auth_settings
|
||||||
{
|
{
|
||||||
'api_key' =>
|
|
||||||
{
|
|
||||||
type: 'api_key',
|
|
||||||
in: 'header',
|
|
||||||
key: 'api_key',
|
|
||||||
value: api_key_with_prefix('api_key')
|
|
||||||
},
|
|
||||||
'petstore_auth' =>
|
'petstore_auth' =>
|
||||||
{
|
{
|
||||||
type: 'oauth2',
|
type: 'oauth2',
|
||||||
@ -171,6 +164,41 @@ module Petstore
|
|||||||
key: 'Authorization',
|
key: 'Authorization',
|
||||||
value: "Bearer #{access_token}"
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user