Merge remote-tracking branch 'origin' into 7.0.x

This commit is contained in:
William Cheng
2023-03-03 21:52:50 +08:00
10595 changed files with 418520 additions and 73194 deletions

View File

@@ -7,7 +7,7 @@
- bundle install -j $(nproc)
parallel:
matrix:
- RUBY_VERSION: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
- RUBY_VERSION: ['2.7', '3.0', '3.1']
image: "ruby:$RUBY_VERSION"
cache:
paths:

View File

@@ -1,12 +1,9 @@
language: ruby
cache: bundler
rvm:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- 3.1
script:
- bundle install --path vendor/bundle
- bundle exec rspec

View File

@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.summary = "OpenAPI Extension with dynamic servers Ruby Gem"
s.description = "This specification shows how to use dynamic servers."
s.license = "Unlicense"
s.required_ruby_version = ">= 2.4"
s.required_ruby_version = ">= 2.7"
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'

View File

@@ -32,6 +32,7 @@ module DynamicServers
end
else
super arg
@message = arg
end
end

View File

@@ -62,6 +62,16 @@ module DynamicServers
# Defines the access token (Bearer) used with OAuth2.
attr_accessor :access_token
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
# Overrides the access_token if set
# @return [Proc]
attr_accessor :access_token_getter
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
# HTTP responses with return type `File` will be returned as a stream of binary data.
# Default to false.
attr_accessor :return_binary_data
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
# details will be logged with `logger.debug` (see the `logger` attribute).
# Default to false.
@@ -208,6 +218,12 @@ module DynamicServers
end
end
# Gets access_token using access_token_getter or uses the static access_token
def access_token_with_refresh
return access_token if access_token_getter.nil?
access_token_getter.call
end
# Gets Basic Auth token string
def basic_auth_token
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")

View File

@@ -89,6 +89,8 @@ describe DynamicServers::ApiClient do
end
end
describe '#deserialize' do
it "handles Array<Integer>" do
api_client = DynamicServers::ApiClient.new