Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade swagger codegen to version 2.4.27 #2

Merged
merged 7 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update templates to use Addressable::URI
  • Loading branch information
fotos committed Jun 5, 2022
commit ff01b8e7a1a9c86661e914bf9e22e892c499f670
6 changes: 3 additions & 3 deletions src/main/resources/ruby-client/client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require 'json'
require 'logger'
require 'tempfile'
require 'typhoeus'
require 'uri'
require 'addressable/uri'

module {{moduleName}}
module API
Expand Down Expand Up @@ -56,7 +56,7 @@ module {{moduleName}}
:message => response.return_message)
else
fail API::Error.new(:code => response.code,
:response_headers => response.headers,
:response_headers => response.headers.to_h,
:response_body => response.body),
response.status_message
end
Expand Down Expand Up @@ -264,7 +264,7 @@ module {{moduleName}}
def build_request_url(path)
# Add leading and trailing slashes to path
path = "/#{path}".gsub(/\/+/, '/')
URI.encode(@config.base_url + path)
Addressable::URI.encode(@config.base_url + path)
end

# Builds the HTTP request body
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/ruby-client/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{> api_info}}
=end

require 'uri'
require 'addressable/uri'

module {{moduleName}}
module API
Expand Down Expand Up @@ -168,7 +168,7 @@ module {{moduleName}}

def base_url
url = "#{scheme}:https://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
URI.encode(url)
Addressable::URI.encode(url)
end

# Gets API key (with prefix if set).
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/ruby-client/gemspec.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Gem::Specification.new do |s|

s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0'
end