mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Avoid more monkey-patching
This commit is contained in:
parent
327128dbba
commit
0ac1ef266f
@ -107,7 +107,6 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
supportingFiles.add(new SupportingFile("swagger_client.gemspec.mustache", "", gemName + ".gemspec"));
|
||||
supportingFiles.add(new SupportingFile("swagger_client.mustache", libFolder, gemName + ".rb"));
|
||||
String baseFolder = libFolder + File.separator + gemName;
|
||||
supportingFiles.add(new SupportingFile("monkey.mustache", baseFolder, "monkey.rb"));
|
||||
supportingFiles.add(new SupportingFile("swagger.mustache", baseFolder, "swagger.rb"));
|
||||
String swaggerFolder = baseFolder + File.separator + "swagger";
|
||||
supportingFiles.add(new SupportingFile("swagger" + File.separator + "request.mustache", swaggerFolder, "request.rb"));
|
||||
|
@ -1,31 +0,0 @@
|
||||
class Hash
|
||||
unless Hash.method_defined? :stringify_keys
|
||||
def stringify_keys
|
||||
inject({}) do |options, (key, value)|
|
||||
options[key.to_s] = value
|
||||
options
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
unless Hash.method_defined? :stringify_keys!
|
||||
def stringify_keys!
|
||||
self.replace(self.stringify_keys)
|
||||
end
|
||||
end
|
||||
|
||||
unless Hash.method_defined? :symbolize_keys
|
||||
def symbolize_keys
|
||||
inject({}) do |options, (key, value)|
|
||||
options[(key.to_sym rescue key) || key] = value
|
||||
options
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
unless Hash.method_defined? :symbolize_keys!
|
||||
def symbolize_keys!
|
||||
self.replace(self.symbolize_keys)
|
||||
end
|
||||
end
|
||||
end
|
@ -119,7 +119,7 @@ module {{moduleName}}
|
||||
def make
|
||||
request_options = {
|
||||
:method => self.http_method,
|
||||
:headers => self.headers.stringify_keys,
|
||||
:headers => self.headers,
|
||||
:ssl_verifypeer => Swagger.configuration.verify_ssl,
|
||||
:cainfo => Swagger.configuration.ssl_ca_cert,
|
||||
:verbose => Swagger.configuration.debug
|
||||
|
@ -1,5 +1,4 @@
|
||||
# Swagger common files
|
||||
require '{{gemName}}/monkey'
|
||||
require '{{gemName}}/swagger'
|
||||
require '{{gemName}}/swagger/configuration'
|
||||
require '{{gemName}}/swagger/api_error'
|
||||
|
Loading…
Reference in New Issue
Block a user