diff --git a/.gitignore b/.gitignore
index 23e38e62f4f..9f893291374 100644
--- a/.gitignore
+++ b/.gitignore
@@ -271,6 +271,7 @@ samples/client/petstore/c/*.so
# Ruby
samples/openapi3/client/petstore/ruby/Gemfile.lock
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock
+samples/openapi3/client/petstore/ruby-httpx/Gemfile.lock
# Crystal
samples/client/petstore/crystal/lib
diff --git a/README.md b/README.md
index 98f45c91d67..75e63f56d1e 100644
--- a/README.md
+++ b/README.md
@@ -1006,6 +1006,7 @@ Here is a list of template creators:
* Python (refactored in 7.0.0): @wing328
* R: @ramnov
* Ruby (Faraday): @meganemura @dkliban
+ * Ruby (HTTPX): @honeyryderchuck
* Rust: @farcaller
* Rust (rust-server): @metaswitch
* Scala (scalaz & http4s): @tbrown1979
@@ -1261,5 +1262,3 @@ See the License for the specific language governing permissions and
limitations under the License.
---
-
-
diff --git a/bin/configs/ruby-httpx.yaml b/bin/configs/ruby-httpx.yaml
new file mode 100644
index 00000000000..0c9eda5ebf9
--- /dev/null
+++ b/bin/configs/ruby-httpx.yaml
@@ -0,0 +1,10 @@
+generatorName: ruby
+outputDir: samples/client/petstore/ruby-httpx
+library: httpx
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/ruby-client
+additionalProperties:
+ gemVersion: 1.0.0
+ moduleName: Petstore
+ gemName: petstore
+ skipFormModel: "true"
diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md
index 3b991620aa0..e837c7b97c4 100644
--- a/docs/generators/ruby.md
+++ b/docs/generators/ruby.md
@@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|gemVersion|gem version.| |1.0.0|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **false** The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. |true|
-|library|HTTP library template (sub-template) to use|**faraday** Faraday >= 1.0.1 (https://github.com/lostisland/faraday) **typhoeus** Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus) |typhoeus|
+|library|HTTP library template (sub-template) to use|**faraday** Faraday >= 1.0.1 (https://github.com/lostisland/faraday) **httpx** HTTPX >= 1.0.0 (https://gitlab.com/os85/httpx) **typhoeus** Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus) |typhoeus|
|moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java
index c477efa559f..18127e4fa8b 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java
@@ -49,6 +49,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
public static final String GEM_AUTHOR = "gemAuthor";
public static final String GEM_AUTHOR_EMAIL = "gemAuthorEmail";
public static final String FARADAY = "faraday";
+ public static final String HTTPX = "httpx";
public static final String TYPHOEUS = "typhoeus";
public static final String USE_AUTOLOAD = "useAutoload";
private final Logger LOGGER = LoggerFactory.getLogger(RubyClientCodegen.class);
@@ -176,6 +177,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
defaultValue(Boolean.FALSE.toString()));
supportedLibraries.put(FARADAY, "Faraday >= 1.0.1 (https://github.com/lostisland/faraday)");
+ supportedLibraries.put(HTTPX, "HTTPX >= 1.0.0 (https://gitlab.com/os85/httpx)");
supportedLibraries.put(TYPHOEUS, "Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)");
CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use");
@@ -274,11 +276,15 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
if (TYPHOEUS.equals(getLibrary())) {
// for Typhoeus
+ additionalProperties.put("isTyphoeus", Boolean.TRUE);
} else if (FARADAY.equals(getLibrary())) {
// for Faraday
additionalProperties.put("isFaraday", Boolean.TRUE);
+ } else if (HTTPX.equals(getLibrary())) {
+ // for Faraday
+ additionalProperties.put("isHttpx", Boolean.TRUE);
} else {
- throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported.");
+ throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus and httpx are supported.");
}
// test files should not be overwritten
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache
index 54c6515cb54..8facf344d78 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache
@@ -85,6 +85,10 @@ require '{{{gemName}}}'
# Configure faraday connection
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
{{/isFaraday}}
+ {{#isHttpx}}
+ # Configure httpx session
+ config.configure_session { |session| 'YOUR CONNECTION CONFIG PROC' }
+ {{/isHttpx}}
{{/authMethods}}end
{{/hasAuthMethods}}
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache
index 31e2cf3abec..230d46dc781 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache
@@ -7,13 +7,18 @@ require 'json'
require 'logger'
require 'tempfile'
require 'time'
-{{^isFaraday}}
+{{#isTyphoeus}}
require 'typhoeus'
-{{/isFaraday}}
+{{/isTyphoeus}}
{{#isFaraday}}
require 'faraday'
require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
{{/isFaraday}}
+{{#isHttpx}}
+require 'httpx'
+require 'net/http/status'
+{{/isHttpx}}
+
module {{moduleName}}
class ApiClient
@@ -40,12 +45,15 @@ module {{moduleName}}
@@default ||= ApiClient.new
end
-{{^isFaraday}}
+{{#isTyphoeus}}
{{> api_client_typhoeus_partial}}
-{{/isFaraday}}
+{{/isTyphoeus}}
{{#isFaraday}}
{{> api_client_faraday_partial}}
{{/isFaraday}}
+{{#isHttpx}}
+{{> api_client_httpx_partial}}
+{{/isHttpx}}
# Check if the given MIME is a JSON MIME.
# JSON MIME examples:
# application/json
@@ -67,9 +75,9 @@ module {{moduleName}}
# handle file downloading - return the File instance processed in request callbacks
# note that response body is empty when the file is written in chunks in request on_body callback
- {{^isFaraday}}
+ {{#isTyphoeus}}
return @tempfile if return_type == 'File'
- {{/isFaraday}}
+ {{/isTyphoeus}}
{{#isFaraday}}
if return_type == 'File'
if @config.return_binary_data == true
@@ -98,11 +106,38 @@ module {{moduleName}}
end
end
{{/isFaraday}}
+ {{#isHttpx}}
+ if return_type == 'File'
+ if @config.return_binary_data == true
+ # TODO: force response encoding
+ return body.to_s
+ else
+ content_disposition = response.headers['content-disposition']
+ if content_disposition && content_disposition =~ /filename=/i
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
+ prefix = sanitize_filename(filename)
+ else
+ prefix = 'download-'
+ end
+ prefix = prefix + '-' unless prefix.end_with?('-')
+ encoding = response.body.encoding
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
+ response.copy_to(tempfile)
+ tempfile.close
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
+ "explicitly with `tempfile.delete`"
+
+ return tempfile
+ end
+ end
+ {{/isHttpx}}
return nil if body.nil? || body.empty?
# return response body directly for String return type
- return body if return_type == 'String'
+ return body.to_s if return_type == 'String'
# ensuring a default content type
content_type = response.headers['Content-Type'] || 'application/json'
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_httpx_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_httpx_partial.mustache
new file mode 100644
index 00000000000..a5201fa2ffb
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_httpx_partial.mustache
@@ -0,0 +1,110 @@
+ # Call an API with given options.
+ #
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
+ # the data deserialized from response body (could be nil), response status code and response headers.
+ def call_api(http_method, path, opts = {})
+ begin
+ response = build_request(http_method.to_s, path, opts)
+
+ if config.debugging
+ config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
+ end
+
+ response.raise_for_status
+
+ rescue HTTPX::HTTPError
+ fail ApiError.new(code: response.status,
+ response_headers: response.headers.to_h,
+ response_body: response.body.to_s),
+ Net::HTTP::STATUS_CODES.fetch(response.status, "HTTP Error (#{response.status})")
+ rescue HTTPX::TimeoutError
+ fail ApiError.new('Connection timed out')
+ rescue HTTPX::ConnectionError
+ fail ApiError.new('Connection failed')
+ end
+
+ if opts[:return_type]
+ data = deserialize(response, opts[:return_type])
+ else
+ data = nil
+ end
+ return data, response.status, response.headers.to_h
+ end
+
+ # Builds the HTTP request
+ #
+ # @param [String] http_method HTTP method/verb (e.g. POST)
+ # @param [String] path URL path (e.g. /account/new)
+ # @option opts [Hash] :header_params Header parameters
+ # @option opts [Hash] :query_params Query parameters
+ # @option opts [Hash] :form_params Query parameters
+ # @option opts [Object] :body HTTP body (JSON/XML)
+ # @return [HTTPX::Request] A Request object
+ def build_request(http_method, path, opts = {})
+ url = build_request_url(path, opts)
+
+ header_params = @default_headers.merge(opts[:header_params] || {})
+ query_params = opts[:query_params] || {}
+ form_params = opts[:form_params] || {}
+
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
+
+ if %w[POST PATCH PUT DELETE].include?(http_method)
+ body_params = build_request_body(header_params, form_params, opts[:body])
+ if config.debugging
+ config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
+ end
+ else
+ body_params = {}
+ end
+ req_opts = {
+ :headers => HTTPX::Headers.new(header_params),
+ **body_params
+ }
+ req_opts[:params] = query_params if query_params && !query_params.empty?
+ session.request(http_method, url, **req_opts)
+ end
+
+ # Builds the HTTP request body
+ #
+ # @param [Hash] header_params Header parameters
+ # @param [Hash] form_params Query parameters
+ # @param [Object] body HTTP body (JSON/XML)
+ # @return [Hash{Symbol => Object}] body options as HTTPX handles them
+ def build_request_body(header_params, form_params, body)
+ # http form
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
+ header_params['Content-Type'] == 'multipart/form-data'
+ data = { form: form_params }
+ elsif body
+
+ data = body.is_a?(String) ? { body: body } : { json: body }
+ else
+ data = nil
+ end
+ data
+ end
+
+ def session
+ return @session if defined?(@session)
+
+ session = HTTPX.with(
+ ssl: @config.ssl,
+ timeout: ({ request_timeout: @config.timeout } if @config.timeout && @config.timeout.positive?),
+ origin: "#{@config.scheme}://#{@config.host}",
+ base_path: (@config.base_path.sub(/\/+\z/, '') if @config.base_path)
+ )
+
+ if @config.proxy
+ session = session.plugin(:proxy, proxy: @config.proxy)
+ end
+
+ if @config.username && @config.password
+ session = session.plugin(:basic_auth).basic_auth(@config.username, @config.password)
+ end
+
+ session = @config.configure(session)
+
+ @session = session
+
+ end
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache
index 472fba39d4f..324034c5f46 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache
@@ -43,7 +43,7 @@ describe {{moduleName}}::ApiClient do
end
end
-{{^isFaraday}}
+{{#isTyphoeus}}
describe 'params_encoding in #build_request' do
let(:config) { {{moduleName}}::Configuration.new }
let(:api_client) { {{moduleName}}::ApiClient.new(config) }
@@ -82,7 +82,7 @@ describe {{moduleName}}::ApiClient do
end
end
-{{/isFaraday}}
+{{/isTyphoeus}}
{{#isFaraday}}
describe 'proxy in #build_connection' do
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache
index 9e9aea3912d..518596cb536 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache
@@ -93,12 +93,15 @@ module {{moduleName}}
# @return [true, false]
attr_accessor :client_side_validation
-{{^isFaraday}}
+{{#isTyphoeus}}
{{> configuration_typhoeus_partial}}
-{{/isFaraday}}
+{{/isTyphoeus}}
{{#isFaraday}}
{{> configuration_faraday_partial}}
{{/isFaraday}}
+{{#isHttpx}}
+{{> configuration_httpx_partial}}
+{{/isHttpx}}
attr_accessor :inject_format
@@ -128,14 +131,20 @@ module {{moduleName}}
@return_binary_data = false
@params_encoder = nil
{{/isFaraday}}
- {{^isFaraday}}
+ {{#isTyphoeus}}
@verify_ssl = true
@verify_ssl_host = true
@cert_file = nil
@key_file = nil
@timeout = 0
@params_encoding = nil
- {{/isFaraday}}
+ {{/isTyphoeus}}
+ {{#isHttpx}}
+ @ssl = nil
+ @proxy = nil
+ @timeout = 60
+ @configure_session_blocks = []
+ {{/isHttpx}}
@debugging = false
@inject_format = false
@force_ending_format = false
@@ -446,5 +455,27 @@ module {{moduleName}}
end
end
{{/isFaraday}}
+
+ {{#isHttpx}}
+ # Configure Httpx session directly.
+ #
+ # ```
+ # c.configure_session do |http|
+ # http.plugin(:follow_redirects).with(debug: STDOUT, debug_level: 1)
+ # end
+ # ```
+ #
+ # @param block [Proc] `#call`able object that takes one arg, the connection
+ def configure_session(&block)
+ @configure_session_blocks << block
+ end
+
+
+ def configure(session)
+ @configure_session_blocks.reduce(session) do |configured_sess, block|
+ block.call(configured_sess)
+ end
+ end
+ {{/isHttpx}}
end
end
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration_httpx_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_httpx_partial.mustache
new file mode 100644
index 00000000000..807a30da740
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_httpx_partial.mustache
@@ -0,0 +1,11 @@
+ ### TLS/SSL setting
+ # You can use this to customize SSL Context settings (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html
+ # to know which ones).
+ #
+ # @return [Hash{Symbol => Object}, OpenSSL::SSL::SSLContext, nil]
+ attr_accessor :ssl
+
+ ### Proxy setting
+ # HTTP Proxy settings (see https://honeyryderchuck.gitlab.io/httpx/wiki/Proxy#options)
+ # @return [Hash{Symbol => Object}, nil]
+ attr_accessor :proxy
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration_spec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_spec.mustache
index fa1006253f1..69cd207b1a5 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/configuration_spec.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_spec.mustache
@@ -73,4 +73,39 @@ describe {{moduleName}}::Configuration do
end
end
{{/isFaraday}}
+{{#isHttpx}}
+
+ describe '#configure' do
+ let(:session) { HTTPX::Session.new }
+
+ before do
+ module CustomPlugin
+ module InstanceMethods; end
+ end
+ module AnotherCustomPlugin
+ module InstanceMethods; end
+ end
+
+ config.configure_session do |session|
+ session.plugin(CustomPlugin)
+ end
+ end
+
+ it 'adds a block that will be used to configure the connection' do
+ sess = config.configure(session)
+
+ expect(sess.class.ancestors).to include(CustomPlugin::InstanceMethods)
+ end
+
+ it 'supports multiple configuration blocks' do
+ config.configure_session do |session|
+ session.plugin(AnotherCustomPlugin)
+ end
+ sess = config.configure(session)
+
+ expect(sess.class.ancestors).to include(CustomPlugin::InstanceMethods)
+ expect(sess.class.ancestors).to include(AnotherCustomPlugin::InstanceMethods)
+ end
+ end
+{{/isHttpx}}
end
diff --git a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache
index 64a45113ebb..8fba4b4efd1 100644
--- a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache
+++ b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache
@@ -23,9 +23,12 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
s.add_runtime_dependency 'faraday-multipart'
{{/isFaraday}}
- {{^isFaraday}}
+ {{#isTyphoeus}}
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
- {{/isFaraday}}
+ {{/isTyphoeus}}
+ {{#isHttpx}}
+ s.add_runtime_dependency 'httpx', '~> 1.0', '>= 1.0.0'
+ {{/isHttpx}}
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
diff --git a/pom.xml b/pom.xml
index 24fa8607734..a99ac8a7c02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1165,6 +1165,7 @@
samples/client/petstore/ruby
samples/client/petstore/ruby-faraday
+ samples/client/petstore/ruby-httpx
samples/client/petstore/ruby-autoload
diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb
index a0c48d3c861..f4a681dc6d2 100644
--- a/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb
+++ b/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb
@@ -17,6 +17,7 @@ require 'tempfile'
require 'time'
require 'typhoeus'
+
module Petstore
class ApiClient
# The Configuration object holding settings to be used in the API client.
@@ -222,7 +223,7 @@ module Petstore
return nil if body.nil? || body.empty?
# return response body directly for String return type
- return body if return_type == 'String'
+ return body.to_s if return_type == 'String'
# ensuring a default content type
content_type = response.headers['Content-Type'] || 'application/json'
diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb b/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb
index 5804a8d00e0..674c9c447b6 100644
--- a/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb
+++ b/samples/client/petstore/ruby-autoload/lib/petstore/configuration.rb
@@ -425,5 +425,6 @@ module Petstore
url
end
+
end
end
diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb
index b4687d55898..cb459fa9056 100644
--- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb
+++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb
@@ -18,6 +18,7 @@ require 'time'
require 'faraday'
require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
+
module Petstore
class ApiClient
# The Configuration object holding settings to be used in the API client.
@@ -258,7 +259,7 @@ module Petstore
return nil if body.nil? || body.empty?
# return response body directly for String return type
- return body if return_type == 'String'
+ return body.to_s if return_type == 'String'
# ensuring a default content type
content_type = response.headers['Content-Type'] || 'application/json'
diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb
index d530e543990..f8ebe7e88bb 100644
--- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb
+++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb
@@ -509,5 +509,6 @@ module Petstore
end
end
end
+
end
end
diff --git a/samples/client/petstore/ruby-httpx/.gitignore b/samples/client/petstore/ruby-httpx/.gitignore
new file mode 100644
index 00000000000..05a17cb8f0a
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.gitignore
@@ -0,0 +1,39 @@
+# Generated by: https://openapi-generator.tech
+#
+
+*.gem
+*.rbc
+/.config
+/coverage/
+/InstalledFiles
+/pkg/
+/spec/reports/
+/spec/examples.txt
+/test/tmp/
+/test/version_tmp/
+/tmp/
+
+## Specific to RubyMotion:
+.dat*
+.repl_history
+build/
+
+## Documentation cache and generated files:
+/.yardoc/
+/_yardoc/
+/doc/
+/rdoc/
+
+## Environment normalization:
+/.bundle/
+/vendor/bundle
+/lib/bundler/man/
+
+# for a library or gem, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# Gemfile.lock
+# .ruby-version
+# .ruby-gemset
+
+# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
+.rvmrc
diff --git a/samples/client/petstore/ruby-httpx/.gitlab-ci.yml b/samples/client/petstore/ruby-httpx/.gitlab-ci.yml
new file mode 100644
index 00000000000..3a253c45c05
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.gitlab-ci.yml
@@ -0,0 +1,26 @@
+.ruby: &ruby
+ variables:
+ LANG: "C.UTF-8"
+ before_script:
+ - ruby -v
+ - bundle config set --local deployment true
+ - bundle install -j $(nproc)
+ parallel:
+ matrix:
+ - RUBY_VERSION: ['2.7', '3.0', '3.1']
+ image: "ruby:$RUBY_VERSION"
+ cache:
+ paths:
+ - vendor/ruby
+ key: 'ruby-$RUBY_VERSION'
+
+gem:
+ extends: .ruby
+ script:
+ - bundle exec rspec
+ - bundle exec rake build
+ - bundle exec rake install
+ artifacts:
+ paths:
+ - pkg/*.gem
+
diff --git a/samples/client/petstore/ruby-httpx/.openapi-generator-ignore b/samples/client/petstore/ruby-httpx/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/ruby-httpx/.openapi-generator/FILES b/samples/client/petstore/ruby-httpx/.openapi-generator/FILES
new file mode 100644
index 00000000000..fc02f30778d
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.openapi-generator/FILES
@@ -0,0 +1,132 @@
+.gitignore
+.gitlab-ci.yml
+.rspec
+.rubocop.yml
+.travis.yml
+Gemfile
+README.md
+Rakefile
+docs/AdditionalPropertiesClass.md
+docs/AllOfWithSingleRef.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/ApiResponse.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/Capitalization.md
+docs/Cat.md
+docs/Category.md
+docs/ChildWithNullable.md
+docs/ClassModel.md
+docs/Client.md
+docs/DefaultApi.md
+docs/DeprecatedObject.md
+docs/Dog.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeBigDecimalMap200Response.md
+docs/FakeClassnameTags123Api.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/Foo.md
+docs/FooGetDefaultResponse.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/List.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NullableClass.md
+docs/NumberOnly.md
+docs/ObjectWithDeprecatedFields.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/OuterObjectWithEnumProperty.md
+docs/ParentWithNullable.md
+docs/Pet.md
+docs/PetApi.md
+docs/ReadOnlyFirst.md
+docs/SingleRefType.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/TestInlineFreeformAdditionalPropertiesRequest.md
+docs/User.md
+docs/UserApi.md
+git_push.sh
+lib/petstore.rb
+lib/petstore/api/another_fake_api.rb
+lib/petstore/api/default_api.rb
+lib/petstore/api/fake_api.rb
+lib/petstore/api/fake_classname_tags123_api.rb
+lib/petstore/api/pet_api.rb
+lib/petstore/api/store_api.rb
+lib/petstore/api/user_api.rb
+lib/petstore/api_client.rb
+lib/petstore/api_error.rb
+lib/petstore/configuration.rb
+lib/petstore/models/additional_properties_class.rb
+lib/petstore/models/all_of_with_single_ref.rb
+lib/petstore/models/animal.rb
+lib/petstore/models/api_response.rb
+lib/petstore/models/array_of_array_of_number_only.rb
+lib/petstore/models/array_of_number_only.rb
+lib/petstore/models/array_test.rb
+lib/petstore/models/capitalization.rb
+lib/petstore/models/cat.rb
+lib/petstore/models/category.rb
+lib/petstore/models/child_with_nullable.rb
+lib/petstore/models/class_model.rb
+lib/petstore/models/client.rb
+lib/petstore/models/deprecated_object.rb
+lib/petstore/models/dog.rb
+lib/petstore/models/enum_arrays.rb
+lib/petstore/models/enum_class.rb
+lib/petstore/models/enum_test.rb
+lib/petstore/models/fake_big_decimal_map200_response.rb
+lib/petstore/models/file.rb
+lib/petstore/models/file_schema_test_class.rb
+lib/petstore/models/foo.rb
+lib/petstore/models/foo_get_default_response.rb
+lib/petstore/models/format_test.rb
+lib/petstore/models/has_only_read_only.rb
+lib/petstore/models/health_check_result.rb
+lib/petstore/models/list.rb
+lib/petstore/models/map_test.rb
+lib/petstore/models/mixed_properties_and_additional_properties_class.rb
+lib/petstore/models/model200_response.rb
+lib/petstore/models/model_return.rb
+lib/petstore/models/name.rb
+lib/petstore/models/nullable_class.rb
+lib/petstore/models/number_only.rb
+lib/petstore/models/object_with_deprecated_fields.rb
+lib/petstore/models/order.rb
+lib/petstore/models/outer_composite.rb
+lib/petstore/models/outer_enum.rb
+lib/petstore/models/outer_enum_default_value.rb
+lib/petstore/models/outer_enum_integer.rb
+lib/petstore/models/outer_enum_integer_default_value.rb
+lib/petstore/models/outer_object_with_enum_property.rb
+lib/petstore/models/parent_with_nullable.rb
+lib/petstore/models/pet.rb
+lib/petstore/models/read_only_first.rb
+lib/petstore/models/single_ref_type.rb
+lib/petstore/models/special_model_name.rb
+lib/petstore/models/tag.rb
+lib/petstore/models/test_inline_freeform_additional_properties_request.rb
+lib/petstore/models/user.rb
+lib/petstore/version.rb
+petstore.gemspec
+spec/api_client_spec.rb
+spec/configuration_spec.rb
+spec/spec_helper.rb
diff --git a/samples/client/petstore/ruby-httpx/.openapi-generator/VERSION b/samples/client/petstore/ruby-httpx/.openapi-generator/VERSION
new file mode 100644
index 00000000000..40e36364ab2
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.1.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/ruby-httpx/.rspec b/samples/client/petstore/ruby-httpx/.rspec
new file mode 100644
index 00000000000..83e16f80447
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.rspec
@@ -0,0 +1,2 @@
+--color
+--require spec_helper
diff --git a/samples/client/petstore/ruby-httpx/.rubocop.yml b/samples/client/petstore/ruby-httpx/.rubocop.yml
new file mode 100644
index 00000000000..d32b2b1cdab
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.rubocop.yml
@@ -0,0 +1,148 @@
+# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
+# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
+AllCops:
+ TargetRubyVersion: 2.4
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
+ # to ignore them, so only the ones explicitly set in this file are enabled.
+ DisabledByDefault: true
+ Exclude:
+ - '**/templates/**/*'
+ - '**/vendor/**/*'
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
+
+# Prefer &&/|| over and/or.
+Style/AndOr:
+ Enabled: true
+
+# Align `when` with `case`.
+Layout/CaseIndentation:
+ Enabled: true
+
+# Align comments with method definitions.
+Layout/CommentIndentation:
+ Enabled: true
+
+Layout/ElseAlignment:
+ Enabled: true
+
+Layout/EmptyLineAfterMagicComment:
+ Enabled: true
+
+# In a regular class definition, no empty lines around the body.
+Layout/EmptyLinesAroundClassBody:
+ Enabled: true
+
+# In a regular method definition, no empty lines around the body.
+Layout/EmptyLinesAroundMethodBody:
+ Enabled: true
+
+# In a regular module definition, no empty lines around the body.
+Layout/EmptyLinesAroundModuleBody:
+ Enabled: true
+
+Layout/FirstArgumentIndentation:
+ Enabled: true
+
+# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
+Style/HashSyntax:
+ Enabled: false
+
+# Method definitions after `private` or `protected` isolated calls need one
+# extra level of indentation.
+Layout/IndentationConsistency:
+ Enabled: true
+ EnforcedStyle: indented_internal_methods
+
+# Two spaces, no tabs (for indentation).
+Layout/IndentationWidth:
+ Enabled: true
+
+Layout/LeadingCommentSpace:
+ Enabled: true
+
+Layout/SpaceAfterColon:
+ Enabled: true
+
+Layout/SpaceAfterComma:
+ Enabled: true
+
+Layout/SpaceAroundEqualsInParameterDefault:
+ Enabled: true
+
+Layout/SpaceAroundKeyword:
+ Enabled: true
+
+Layout/SpaceAroundOperators:
+ Enabled: true
+
+Layout/SpaceBeforeComma:
+ Enabled: true
+
+Layout/SpaceBeforeFirstArg:
+ Enabled: true
+
+Style/DefWithParentheses:
+ Enabled: true
+
+# Defining a method with parameters needs parentheses.
+Style/MethodDefParentheses:
+ Enabled: true
+
+Style/FrozenStringLiteralComment:
+ Enabled: false
+ EnforcedStyle: always
+
+# Use `foo {}` not `foo{}`.
+Layout/SpaceBeforeBlockBraces:
+ Enabled: true
+
+# Use `foo { bar }` not `foo {bar}`.
+Layout/SpaceInsideBlockBraces:
+ Enabled: true
+
+# Use `{ a: 1 }` not `{a:1}`.
+Layout/SpaceInsideHashLiteralBraces:
+ Enabled: true
+
+Layout/SpaceInsideParens:
+ Enabled: true
+
+# Check quotes usage according to lint rule below.
+#Style/StringLiterals:
+# Enabled: true
+# EnforcedStyle: single_quotes
+
+# Detect hard tabs, no hard tabs.
+Layout/IndentationStyle:
+ Enabled: true
+
+# Blank lines should not have any spaces.
+Layout/TrailingEmptyLines:
+ Enabled: true
+
+# No trailing whitespace.
+Layout/TrailingWhitespace:
+ Enabled: false
+
+# Use quotes for string literals when they are enough.
+Style/RedundantPercentQ:
+ Enabled: true
+
+# Align `end` with the matching keyword or starting expression except for
+# assignments, where it should be aligned with the LHS.
+Layout/EndAlignment:
+ Enabled: true
+ EnforcedStyleAlignWith: variable
+ AutoCorrect: true
+
+# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
+Lint/RequireParentheses:
+ Enabled: true
+
+Style/RedundantReturn:
+ Enabled: true
+ AllowMultipleReturnValues: true
+
+Style/Semicolon:
+ Enabled: true
+ AllowAsExpressionSeparator: true
diff --git a/samples/client/petstore/ruby-httpx/.travis.yml b/samples/client/petstore/ruby-httpx/.travis.yml
new file mode 100644
index 00000000000..88f8fc7cdfd
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/.travis.yml
@@ -0,0 +1,11 @@
+language: ruby
+cache: bundler
+rvm:
+ - 2.7
+ - 3.0
+ - 3.1
+script:
+ - bundle install --path vendor/bundle
+ - bundle exec rspec
+ - gem build petstore.gemspec
+ - gem install ./petstore-1.0.0.gem
diff --git a/samples/client/petstore/ruby-httpx/Gemfile b/samples/client/petstore/ruby-httpx/Gemfile
new file mode 100644
index 00000000000..c2e3127cdcf
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/Gemfile
@@ -0,0 +1,9 @@
+source 'https://rubygems.org'
+
+gemspec
+
+group :development, :test do
+ gem 'rake', '~> 13.0.1'
+ gem 'pry-byebug'
+ gem 'rubocop', '~> 0.66.0'
+end
diff --git a/samples/client/petstore/ruby-httpx/README.md b/samples/client/petstore/ruby-httpx/README.md
new file mode 100644
index 00000000000..2eec0459c1e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/README.md
@@ -0,0 +1,217 @@
+# petstore
+
+Petstore - the Ruby gem for the OpenAPI Petstore
+
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.RubyClientCodegen
+
+## Installation
+
+### Build a gem
+
+To build the Ruby code into a gem:
+
+```shell
+gem build petstore.gemspec
+```
+
+Then either install the gem locally:
+
+```shell
+gem install ./petstore-1.0.0.gem
+```
+
+(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies)
+
+or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
+
+Finally add this to the Gemfile:
+
+ gem 'petstore', '~> 1.0.0'
+
+### Install from Git
+
+If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
+
+ gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
+
+### Include the Ruby code directly
+
+Include the Ruby code directly using `-I` as follows:
+
+```shell
+ruby -Ilib script.rb
+```
+
+## Getting Started
+
+Please follow the [installation](#installation) procedure and then run the following code:
+
+```ruby
+# Load the gem
+require 'petstore'
+
+api_instance = Petstore::AnotherFakeApi.new
+client = Petstore::Client.new # Client | client model
+
+begin
+ #To test special tags
+ result = api_instance.call_123_test_special_tags(client)
+ p result
+rescue Petstore::ApiError => e
+ puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}"
+end
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
+*Petstore::FakeApi* | [**fake_big_decimal_map**](docs/FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap |
+*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*Petstore::FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+*Petstore::FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
+*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*Petstore::FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
+*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+*Petstore::FakeApi* | [**test_nullable**](docs/FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property
+*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
+*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [Petstore::AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
+ - [Petstore::Animal](docs/Animal.md)
+ - [Petstore::ApiResponse](docs/ApiResponse.md)
+ - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [Petstore::ArrayTest](docs/ArrayTest.md)
+ - [Petstore::Capitalization](docs/Capitalization.md)
+ - [Petstore::Cat](docs/Cat.md)
+ - [Petstore::Category](docs/Category.md)
+ - [Petstore::ChildWithNullable](docs/ChildWithNullable.md)
+ - [Petstore::ClassModel](docs/ClassModel.md)
+ - [Petstore::Client](docs/Client.md)
+ - [Petstore::DeprecatedObject](docs/DeprecatedObject.md)
+ - [Petstore::Dog](docs/Dog.md)
+ - [Petstore::EnumArrays](docs/EnumArrays.md)
+ - [Petstore::EnumClass](docs/EnumClass.md)
+ - [Petstore::EnumTest](docs/EnumTest.md)
+ - [Petstore::FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md)
+ - [Petstore::File](docs/File.md)
+ - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [Petstore::Foo](docs/Foo.md)
+ - [Petstore::FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
+ - [Petstore::FormatTest](docs/FormatTest.md)
+ - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [Petstore::HealthCheckResult](docs/HealthCheckResult.md)
+ - [Petstore::List](docs/List.md)
+ - [Petstore::MapTest](docs/MapTest.md)
+ - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Petstore::Model200Response](docs/Model200Response.md)
+ - [Petstore::ModelReturn](docs/ModelReturn.md)
+ - [Petstore::Name](docs/Name.md)
+ - [Petstore::NullableClass](docs/NullableClass.md)
+ - [Petstore::NumberOnly](docs/NumberOnly.md)
+ - [Petstore::ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
+ - [Petstore::Order](docs/Order.md)
+ - [Petstore::OuterComposite](docs/OuterComposite.md)
+ - [Petstore::OuterEnum](docs/OuterEnum.md)
+ - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [Petstore::OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
+ - [Petstore::ParentWithNullable](docs/ParentWithNullable.md)
+ - [Petstore::Pet](docs/Pet.md)
+ - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [Petstore::SingleRefType](docs/SingleRefType.md)
+ - [Petstore::SpecialModelName](docs/SpecialModelName.md)
+ - [Petstore::Tag](docs/Tag.md)
+ - [Petstore::TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md)
+ - [Petstore::User](docs/User.md)
+
+
+## Documentation for Authorization
+
+
+Authentication schemes defined for the API:
+### petstore_auth
+
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+### api_key
+
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### http_basic_test
+
+- **Type**: HTTP basic authentication
+
+### bearer_test
+
+- **Type**: Bearer authentication (JWT)
+
+### http_signature_test
+
+- **Type**: HTTP signature authentication
+
diff --git a/samples/client/petstore/ruby-httpx/Rakefile b/samples/client/petstore/ruby-httpx/Rakefile
new file mode 100644
index 00000000000..c72ca30d454
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/Rakefile
@@ -0,0 +1,10 @@
+require "bundler/gem_tasks"
+
+begin
+ require 'rspec/core/rake_task'
+
+ RSpec::Core::RakeTask.new(:spec)
+ task default: :spec
+rescue LoadError
+ # no rspec available
+end
diff --git a/samples/client/petstore/ruby-httpx/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby-httpx/docs/AdditionalPropertiesClass.md
new file mode 100644
index 00000000000..4e1cdc869f5
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,20 @@
+# Petstore::AdditionalPropertiesClass
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **map_property** | **Hash<String, String>** | | [optional] |
+| **map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::AdditionalPropertiesClass.new(
+ map_property: null,
+ map_of_map_property: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/AllOfWithSingleRef.md b/samples/client/petstore/ruby-httpx/docs/AllOfWithSingleRef.md
new file mode 100644
index 00000000000..3c14ac91c4a
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/AllOfWithSingleRef.md
@@ -0,0 +1,20 @@
+# Petstore::AllOfWithSingleRef
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **username** | **String** | | [optional] |
+| **single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::AllOfWithSingleRef.new(
+ username: null,
+ single_ref_type: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Animal.md b/samples/client/petstore/ruby-httpx/docs/Animal.md
new file mode 100644
index 00000000000..286ce80cb21
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Animal.md
@@ -0,0 +1,20 @@
+# Petstore::Animal
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **class_name** | **String** | | |
+| **color** | **String** | | [optional][default to 'red'] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Animal.new(
+ class_name: null,
+ color: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md
new file mode 100644
index 00000000000..52f3f5a72e9
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/AnotherFakeApi.md
@@ -0,0 +1,72 @@
+# Petstore::AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags |
+
+
+## call_123_test_special_tags
+
+> call_123_test_special_tags(client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::AnotherFakeApi.new
+client = Petstore::Client.new # Client | client model
+
+begin
+ # To test special tags
+ result = api_instance.call_123_test_special_tags(client)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling AnotherFakeApi->call_123_test_special_tags: #{e}"
+end
+```
+
+#### Using the call_123_test_special_tags_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> call_123_test_special_tags_with_http_info(client)
+
+```ruby
+begin
+ # To test special tags
+ data, status_code, headers = api_instance.call_123_test_special_tags_with_http_info(client)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling AnotherFakeApi->call_123_test_special_tags_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **client** | [**Client**](Client.md) | client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ApiResponse.md b/samples/client/petstore/ruby-httpx/docs/ApiResponse.md
new file mode 100644
index 00000000000..be28c4fbb5a
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ApiResponse.md
@@ -0,0 +1,22 @@
+# Petstore::ApiResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **code** | **Integer** | | [optional] |
+| **type** | **String** | | [optional] |
+| **message** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ApiResponse.new(
+ code: null,
+ type: null,
+ message: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/ruby-httpx/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 00000000000..eb5b3f43bcd
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,18 @@
+# Petstore::ArrayOfArrayOfNumberOnly
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **array_array_number** | **Array<Array<Float>>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ArrayOfArrayOfNumberOnly.new(
+ array_array_number: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ArrayOfNumberOnly.md b/samples/client/petstore/ruby-httpx/docs/ArrayOfNumberOnly.md
new file mode 100644
index 00000000000..18b6c0f6904
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,18 @@
+# Petstore::ArrayOfNumberOnly
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **array_number** | **Array<Float>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ArrayOfNumberOnly.new(
+ array_number: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ArrayTest.md b/samples/client/petstore/ruby-httpx/docs/ArrayTest.md
new file mode 100644
index 00000000000..8ee02d169ea
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ArrayTest.md
@@ -0,0 +1,22 @@
+# Petstore::ArrayTest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **array_of_string** | **Array<String>** | | [optional] |
+| **array_array_of_integer** | **Array<Array<Integer>>** | | [optional] |
+| **array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ArrayTest.new(
+ array_of_string: null,
+ array_array_of_integer: null,
+ array_array_of_model: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Capitalization.md b/samples/client/petstore/ruby-httpx/docs/Capitalization.md
new file mode 100644
index 00000000000..a34377e7976
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Capitalization.md
@@ -0,0 +1,28 @@
+# Petstore::Capitalization
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **small_camel** | **String** | | [optional] |
+| **capital_camel** | **String** | | [optional] |
+| **small_snake** | **String** | | [optional] |
+| **capital_snake** | **String** | | [optional] |
+| **sca_eth_flow_points** | **String** | | [optional] |
+| **att_name** | **String** | Name of the pet | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Capitalization.new(
+ small_camel: null,
+ capital_camel: null,
+ small_snake: null,
+ capital_snake: null,
+ sca_eth_flow_points: null,
+ att_name: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Cat.md b/samples/client/petstore/ruby-httpx/docs/Cat.md
new file mode 100644
index 00000000000..67168c77660
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Cat.md
@@ -0,0 +1,18 @@
+# Petstore::Cat
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **declawed** | **Boolean** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Cat.new(
+ declawed: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Category.md b/samples/client/petstore/ruby-httpx/docs/Category.md
new file mode 100644
index 00000000000..f92706fd24d
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Category.md
@@ -0,0 +1,20 @@
+# Petstore::Category
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **Integer** | | [optional] |
+| **name** | **String** | | [default to 'default-name'] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Category.new(
+ id: null,
+ name: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ChildWithNullable.md b/samples/client/petstore/ruby-httpx/docs/ChildWithNullable.md
new file mode 100644
index 00000000000..3e6ffffc4d3
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ChildWithNullable.md
@@ -0,0 +1,18 @@
+# Petstore::ChildWithNullable
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **other_property** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ChildWithNullable.new(
+ other_property: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ClassModel.md b/samples/client/petstore/ruby-httpx/docs/ClassModel.md
new file mode 100644
index 00000000000..e88b4c0c7b4
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ClassModel.md
@@ -0,0 +1,18 @@
+# Petstore::ClassModel
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **_class** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ClassModel.new(
+ _class: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Client.md b/samples/client/petstore/ruby-httpx/docs/Client.md
new file mode 100644
index 00000000000..17778a6b0f2
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Client.md
@@ -0,0 +1,18 @@
+# Petstore::Client
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **client** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Client.new(
+ client: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/DefaultApi.md b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md
new file mode 100644
index 00000000000..86925bb7c88
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/DefaultApi.md
@@ -0,0 +1,67 @@
+# Petstore::DefaultApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | |
+
+
+## foo_get
+
+> foo_get
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::DefaultApi.new
+
+begin
+
+ result = api_instance.foo_get
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling DefaultApi->foo_get: #{e}"
+end
+```
+
+#### Using the foo_get_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> foo_get_with_http_info
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.foo_get_with_http_info
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling DefaultApi->foo_get_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/samples/client/petstore/ruby-httpx/docs/DeprecatedObject.md b/samples/client/petstore/ruby-httpx/docs/DeprecatedObject.md
new file mode 100644
index 00000000000..143be46c411
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/DeprecatedObject.md
@@ -0,0 +1,18 @@
+# Petstore::DeprecatedObject
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **name** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::DeprecatedObject.new(
+ name: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Dog.md b/samples/client/petstore/ruby-httpx/docs/Dog.md
new file mode 100644
index 00000000000..2649c58c005
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Dog.md
@@ -0,0 +1,18 @@
+# Petstore::Dog
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **breed** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Dog.new(
+ breed: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/EnumArrays.md b/samples/client/petstore/ruby-httpx/docs/EnumArrays.md
new file mode 100644
index 00000000000..cd3d076ad97
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/EnumArrays.md
@@ -0,0 +1,20 @@
+# Petstore::EnumArrays
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **just_symbol** | **String** | | [optional] |
+| **array_enum** | **Array<String>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::EnumArrays.new(
+ just_symbol: null,
+ array_enum: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/EnumClass.md b/samples/client/petstore/ruby-httpx/docs/EnumClass.md
new file mode 100644
index 00000000000..099e6e47ec8
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/EnumClass.md
@@ -0,0 +1,15 @@
+# Petstore::EnumClass
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::EnumClass.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/EnumTest.md b/samples/client/petstore/ruby-httpx/docs/EnumTest.md
new file mode 100644
index 00000000000..fad21de8ae1
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/EnumTest.md
@@ -0,0 +1,32 @@
+# Petstore::EnumTest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **enum_string** | **String** | | [optional] |
+| **enum_string_required** | **String** | | |
+| **enum_integer** | **Integer** | | [optional] |
+| **enum_number** | **Float** | | [optional] |
+| **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] |
+| **outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] |
+| **outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional][default to 'placed'] |
+| **outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional][default to OuterEnumIntegerDefaultValue::N0] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::EnumTest.new(
+ enum_string: null,
+ enum_string_required: null,
+ enum_integer: null,
+ enum_number: null,
+ outer_enum: null,
+ outer_enum_integer: null,
+ outer_enum_default_value: null,
+ outer_enum_integer_default_value: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FakeApi.md b/samples/client/petstore/ruby-httpx/docs/FakeApi.md
new file mode 100644
index 00000000000..f43e4402cf1
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FakeApi.md
@@ -0,0 +1,1387 @@
+# Petstore::FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**fake_big_decimal_map**](FakeApi.md#fake_big_decimal_map) | **GET** /fake/BigDecimalMap | |
+| [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint |
+| [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication |
+| [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | |
+| [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | |
+| [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | |
+| [**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | |
+| [**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int | |
+| [**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary | |
+| [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | |
+| [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | |
+| [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model |
+| [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
+| [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters |
+| [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
+| [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
+| [**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties |
+| [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data |
+| [**test_nullable**](FakeApi.md#test_nullable) | **POST** /fake/nullable | test nullable parent property |
+| [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | |
+
+
+## fake_big_decimal_map
+
+> fake_big_decimal_map
+
+
+
+for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+
+begin
+
+ result = api_instance.fake_big_decimal_map
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_big_decimal_map: #{e}"
+end
+```
+
+#### Using the fake_big_decimal_map_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> fake_big_decimal_map_with_http_info
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_big_decimal_map_with_http_info
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_big_decimal_map_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: */*
+
+
+## fake_health_get
+
+> fake_health_get
+
+Health check endpoint
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+
+begin
+ # Health check endpoint
+ result = api_instance.fake_health_get
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_health_get: #{e}"
+end
+```
+
+#### Using the fake_health_get_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> fake_health_get_with_http_info
+
+```ruby
+begin
+ # Health check endpoint
+ data, status_code, headers = api_instance.fake_health_get_with_http_info
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_health_get_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## fake_http_signature_test
+
+> fake_http_signature_test(pet, opts)
+
+test http signature authentication
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+end
+
+api_instance = Petstore::FakeApi.new
+pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
+opts = {
+ query_1: 'query_1_example', # String | query parameter
+ header_1: 'header_1_example' # String | header parameter
+}
+
+begin
+ # test http signature authentication
+ api_instance.fake_http_signature_test(pet, opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_http_signature_test: #{e}"
+end
+```
+
+#### Using the fake_http_signature_test_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> fake_http_signature_test_with_http_info(pet, opts)
+
+```ruby
+begin
+ # test http signature authentication
+ data, status_code, headers = api_instance.fake_http_signature_test_with_http_info(pet, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_http_signature_test_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | |
+| **query_1** | **String** | query parameter | [optional] |
+| **header_1** | **String** | header parameter | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+
+## fake_outer_boolean_serialize
+
+> Boolean fake_outer_boolean_serialize(opts)
+
+
+
+Test serialization of outer boolean types
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ body: true # Boolean | Input boolean as post body
+}
+
+begin
+
+ result = api_instance.fake_outer_boolean_serialize(opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_boolean_serialize: #{e}"
+end
+```
+
+#### Using the fake_outer_boolean_serialize_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> fake_outer_boolean_serialize_with_http_info(opts)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_outer_boolean_serialize_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => Boolean
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_boolean_serialize_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **body** | **Boolean** | Input boolean as post body | [optional] |
+
+### Return type
+
+**Boolean**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+
+## fake_outer_composite_serialize
+
+> fake_outer_composite_serialize(opts)
+
+
+
+Test serialization of object with outer number type
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body
+}
+
+begin
+
+ result = api_instance.fake_outer_composite_serialize(opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_composite_serialize: #{e}"
+end
+```
+
+#### Using the fake_outer_composite_serialize_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> fake_outer_composite_serialize_with_http_info(opts)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_outer_composite_serialize_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_composite_serialize_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **outer_composite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] |
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+
+## fake_outer_number_serialize
+
+> Float fake_outer_number_serialize(opts)
+
+
+
+Test serialization of outer number types
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ body: 8.14 # Float | Input number as post body
+}
+
+begin
+
+ result = api_instance.fake_outer_number_serialize(opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_number_serialize: #{e}"
+end
+```
+
+#### Using the fake_outer_number_serialize_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> fake_outer_number_serialize_with_http_info(opts)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_outer_number_serialize_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => Float
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_number_serialize_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **body** | **Float** | Input number as post body | [optional] |
+
+### Return type
+
+**Float**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+
+## fake_outer_string_serialize
+
+> String fake_outer_string_serialize(opts)
+
+
+
+Test serialization of outer string types
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ body: 'body_example' # String | Input string as post body
+}
+
+begin
+
+ result = api_instance.fake_outer_string_serialize(opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_string_serialize: #{e}"
+end
+```
+
+#### Using the fake_outer_string_serialize_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> fake_outer_string_serialize_with_http_info(opts)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_outer_string_serialize_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => String
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_outer_string_serialize_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **body** | **String** | Input string as post body | [optional] |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+
+## fake_property_enum_integer_serialize
+
+> fake_property_enum_integer_serialize(outer_object_with_enum_property)
+
+
+
+Test serialization of enum (int) properties with examples
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+outer_object_with_enum_property = Petstore::OuterObjectWithEnumProperty.new({value: Petstore::OuterEnumInteger::N0}) # OuterObjectWithEnumProperty | Input enum (int) as post body
+
+begin
+
+ result = api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_property_enum_integer_serialize: #{e}"
+end
+```
+
+#### Using the fake_property_enum_integer_serialize_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->fake_property_enum_integer_serialize_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) | Input enum (int) as post body | |
+
+### Return type
+
+[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+
+## test_body_with_binary
+
+> test_body_with_binary(body)
+
+
+
+For this test, the body has to be a binary file.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+body = File.new('/path/to/some/file') # File | image to upload
+
+begin
+
+ api_instance.test_body_with_binary(body)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_binary: #{e}"
+end
+```
+
+#### Using the test_body_with_binary_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_body_with_binary_with_http_info(body)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.test_body_with_binary_with_http_info(body)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_binary_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **body** | **File** | image to upload | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: image/png
+- **Accept**: Not defined
+
+
+## test_body_with_file_schema
+
+> test_body_with_file_schema(file_schema_test_class)
+
+
+
+For this test, the body for this request must reference a schema named `File`.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass |
+
+begin
+
+ api_instance.test_body_with_file_schema(file_schema_test_class)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_file_schema: #{e}"
+end
+```
+
+#### Using the test_body_with_file_schema_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_body_with_file_schema_with_http_info(file_schema_test_class)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.test_body_with_file_schema_with_http_info(file_schema_test_class)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_file_schema_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## test_body_with_query_params
+
+> test_body_with_query_params(query, user)
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+query = 'query_example' # String |
+user = Petstore::User.new # User |
+
+begin
+
+ api_instance.test_body_with_query_params(query, user)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_query_params: #{e}"
+end
+```
+
+#### Using the test_body_with_query_params_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_body_with_query_params_with_http_info(query, user)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.test_body_with_query_params_with_http_info(query, user)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_body_with_query_params_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **query** | **String** | | |
+| **user** | [**User**](User.md) | | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## test_client_model
+
+> test_client_model(client)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+client = Petstore::Client.new # Client | client model
+
+begin
+ # To test \"client\" model
+ result = api_instance.test_client_model(client)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_client_model: #{e}"
+end
+```
+
+#### Using the test_client_model_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> test_client_model_with_http_info(client)
+
+```ruby
+begin
+ # To test \"client\" model
+ data, status_code, headers = api_instance.test_client_model_with_http_info(client)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_client_model_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **client** | [**Client**](Client.md) | client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## test_endpoint_parameters
+
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure HTTP basic authorization: http_basic_test
+ config.username = 'YOUR USERNAME'
+ config.password = 'YOUR PASSWORD'
+end
+
+api_instance = Petstore::FakeApi.new
+number = 8.14 # Float | None
+double = 1.2 # Float | None
+pattern_without_delimiter = 'pattern_without_delimiter_example' # String | None
+byte = 'BYTE_ARRAY_DATA_HERE' # String | None
+opts = {
+ integer: 56, # Integer | None
+ int32: 56, # Integer | None
+ int64: 789, # Integer | None
+ float: 3.4, # Float | None
+ string: 'string_example', # String | None
+ binary: File.new('/path/to/some/file'), # File | None
+ date: Date.parse('2013-10-20'), # Date | None
+ date_time: Time.parse('2013-10-20T19:20:30+01:00'), # Time | None
+ password: 'password_example', # String | None
+ callback: 'callback_example' # String | None
+}
+
+begin
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_endpoint_parameters: #{e}"
+end
+```
+
+#### Using the test_endpoint_parameters_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts)
+
+```ruby
+begin
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ data, status_code, headers = api_instance.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_endpoint_parameters_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **number** | **Float** | None | |
+| **double** | **Float** | None | |
+| **pattern_without_delimiter** | **String** | None | |
+| **byte** | **String** | None | |
+| **integer** | **Integer** | None | [optional] |
+| **int32** | **Integer** | None | [optional] |
+| **int64** | **Integer** | None | [optional] |
+| **float** | **Float** | None | [optional] |
+| **string** | **String** | None | [optional] |
+| **binary** | **File** | None | [optional] |
+| **date** | **Date** | None | [optional] |
+| **date_time** | **Time** | None | [optional] |
+| **password** | **String** | None | [optional] |
+| **callback** | **String** | None | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+
+## test_enum_parameters
+
+> test_enum_parameters(opts)
+
+To test enum parameters
+
+To test enum parameters
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ enum_header_string_array: ['>'], # Array | Header parameter enum test (string array)
+ enum_header_string: '_abc', # String | Header parameter enum test (string)
+ enum_query_string_array: ['>'], # Array | Query parameter enum test (string array)
+ enum_query_string: '_abc', # String | Query parameter enum test (string)
+ enum_query_integer: 1, # Integer | Query parameter enum test (double)
+ enum_query_double: 1.1, # Float | Query parameter enum test (double)
+ enum_query_model_array: [Petstore::EnumClass::ABC], # Array |
+ enum_form_string_array: ['>'], # Array | Form parameter enum test (string array)
+ enum_form_string: '_abc' # String | Form parameter enum test (string)
+}
+
+begin
+ # To test enum parameters
+ api_instance.test_enum_parameters(opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_enum_parameters: #{e}"
+end
+```
+
+#### Using the test_enum_parameters_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_enum_parameters_with_http_info(opts)
+
+```ruby
+begin
+ # To test enum parameters
+ data, status_code, headers = api_instance.test_enum_parameters_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_enum_parameters_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **enum_header_string_array** | [**Array<String>**](String.md) | Header parameter enum test (string array) | [optional] |
+| **enum_header_string** | **String** | Header parameter enum test (string) | [optional][default to '-efg'] |
+| **enum_query_string_array** | [**Array<String>**](String.md) | Query parameter enum test (string array) | [optional] |
+| **enum_query_string** | **String** | Query parameter enum test (string) | [optional][default to '-efg'] |
+| **enum_query_integer** | **Integer** | Query parameter enum test (double) | [optional] |
+| **enum_query_double** | **Float** | Query parameter enum test (double) | [optional] |
+| **enum_query_model_array** | [**Array<EnumClass>**](EnumClass.md) | | [optional] |
+| **enum_form_string_array** | [**Array<String>**](String.md) | Form parameter enum test (string array) | [optional][default to '$'] |
+| **enum_form_string** | **String** | Form parameter enum test (string) | [optional][default to '-efg'] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+
+## test_group_parameters
+
+> test_group_parameters(opts)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure Bearer authorization (JWT): bearer_test
+ config.access_token = 'YOUR_BEARER_TOKEN'
+end
+
+api_instance = Petstore::FakeApi.new
+opts = {
+ required_string_group: 56, # Integer | Required String in group parameters (required)
+ required_boolean_group: true, # Boolean | Required Boolean in group parameters (required)
+ required_int64_group: 789, # Integer | Required Integer in group parameters (required)
+ string_group: 56, # Integer | String in group parameters
+ boolean_group: true, # Boolean | Boolean in group parameters
+ int64_group: 789, # Integer | Integer in group parameters
+}
+
+begin
+ # Fake endpoint to test group parameters (optional)
+ api_instance.test_group_parameters(opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_group_parameters: #{e}"
+end
+```
+
+#### Using the test_group_parameters_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_group_parameters_with_http_info(opts)
+
+```ruby
+begin
+ # Fake endpoint to test group parameters (optional)
+ data, status_code, headers = api_instance.test_group_parameters_with_http_info(opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_group_parameters_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **required_string_group** | **Integer** | Required String in group parameters | |
+| **required_boolean_group** | **Boolean** | Required Boolean in group parameters | |
+| **required_int64_group** | **Integer** | Required Integer in group parameters | |
+| **string_group** | **Integer** | String in group parameters | [optional] |
+| **boolean_group** | **Boolean** | Boolean in group parameters | [optional] |
+| **int64_group** | **Integer** | Integer in group parameters | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+
+## test_inline_additional_properties
+
+> test_inline_additional_properties(request_body)
+
+test inline additionalProperties
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+request_body = { key: 'inner_example'} # Hash | request body
+
+begin
+ # test inline additionalProperties
+ api_instance.test_inline_additional_properties(request_body)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_inline_additional_properties: #{e}"
+end
+```
+
+#### Using the test_inline_additional_properties_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_inline_additional_properties_with_http_info(request_body)
+
+```ruby
+begin
+ # test inline additionalProperties
+ data, status_code, headers = api_instance.test_inline_additional_properties_with_http_info(request_body)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_inline_additional_properties_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **request_body** | [**Hash<String, String>**](String.md) | request body | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## test_inline_freeform_additional_properties
+
+> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request)
+
+test inline free-form additionalProperties
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+test_inline_freeform_additional_properties_request = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new # TestInlineFreeformAdditionalPropertiesRequest | request body
+
+begin
+ # test inline free-form additionalProperties
+ api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_inline_freeform_additional_properties: #{e}"
+end
+```
+
+#### Using the test_inline_freeform_additional_properties_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request)
+
+```ruby
+begin
+ # test inline free-form additionalProperties
+ data, status_code, headers = api_instance.test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_inline_freeform_additional_properties_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## test_json_form_data
+
+> test_json_form_data(param, param2)
+
+test json serialization of form data
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+param = 'param_example' # String | field1
+param2 = 'param2_example' # String | field2
+
+begin
+ # test json serialization of form data
+ api_instance.test_json_form_data(param, param2)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_json_form_data: #{e}"
+end
+```
+
+#### Using the test_json_form_data_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_json_form_data_with_http_info(param, param2)
+
+```ruby
+begin
+ # test json serialization of form data
+ data, status_code, headers = api_instance.test_json_form_data_with_http_info(param, param2)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_json_form_data_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **param** | **String** | field1 | |
+| **param2** | **String** | field2 | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+
+## test_nullable
+
+> test_nullable(child_with_nullable)
+
+test nullable parent property
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+child_with_nullable = Petstore::ChildWithNullable.new # ChildWithNullable | request body
+
+begin
+ # test nullable parent property
+ api_instance.test_nullable(child_with_nullable)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_nullable: #{e}"
+end
+```
+
+#### Using the test_nullable_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_nullable_with_http_info(child_with_nullable)
+
+```ruby
+begin
+ # test nullable parent property
+ data, status_code, headers = api_instance.test_nullable_with_http_info(child_with_nullable)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_nullable_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **child_with_nullable** | [**ChildWithNullable**](ChildWithNullable.md) | request body | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## test_query_parameter_collection_format
+
+> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts)
+
+
+
+To test the collection format in query parameters
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::FakeApi.new
+pipe = ['inner_example'] # Array |
+ioutil = ['inner_example'] # Array |
+http = ['inner_example'] # Array |
+url = ['inner_example'] # Array |
+context = ['inner_example'] # Array |
+allow_empty = 'allow_empty_example' # String |
+opts = {
+ language: { key: 'inner_example'} # Hash |
+}
+
+begin
+
+ api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_query_parameter_collection_format: #{e}"
+end
+```
+
+#### Using the test_query_parameter_collection_format_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts)
+
+```ruby
+begin
+
+ data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeApi->test_query_parameter_collection_format_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pipe** | [**Array<String>**](String.md) | | |
+| **ioutil** | [**Array<String>**](String.md) | | |
+| **http** | [**Array<String>**](String.md) | | |
+| **url** | [**Array<String>**](String.md) | | |
+| **context** | [**Array<String>**](String.md) | | |
+| **allow_empty** | **String** | | |
+| **language** | [**Hash<String, String>**](String.md) | | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/ruby-httpx/docs/FakeBigDecimalMap200Response.md
new file mode 100644
index 00000000000..f564c4385e8
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FakeBigDecimalMap200Response.md
@@ -0,0 +1,20 @@
+# Petstore::FakeBigDecimalMap200Response
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **some_id** | **Float** | | [optional] |
+| **some_map** | **Hash<String, Float>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::FakeBigDecimalMap200Response.new(
+ some_id: null,
+ some_map: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md
new file mode 100644
index 00000000000..32d3ff8ebdd
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,79 @@
+# Petstore::FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case |
+
+
+## test_classname
+
+> test_classname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure API key authorization: api_key_query
+ config.api_key['api_key_query'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['api_key_query'] = 'Bearer'
+end
+
+api_instance = Petstore::FakeClassnameTags123Api.new
+client = Petstore::Client.new # Client | client model
+
+begin
+ # To test class name in snake case
+ result = api_instance.test_classname(client)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeClassnameTags123Api->test_classname: #{e}"
+end
+```
+
+#### Using the test_classname_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> test_classname_with_http_info(client)
+
+```ruby
+begin
+ # To test class name in snake case
+ data, status_code, headers = api_instance.test_classname_with_http_info(client)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling FakeClassnameTags123Api->test_classname_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **client** | [**Client**](Client.md) | client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
diff --git a/samples/client/petstore/ruby-httpx/docs/File.md b/samples/client/petstore/ruby-httpx/docs/File.md
new file mode 100644
index 00000000000..5cbc1297909
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/File.md
@@ -0,0 +1,18 @@
+# Petstore::File
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **source_uri** | **String** | Test capitalization | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::File.new(
+ source_uri: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FileSchemaTestClass.md b/samples/client/petstore/ruby-httpx/docs/FileSchemaTestClass.md
new file mode 100644
index 00000000000..d9dbef2348e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FileSchemaTestClass.md
@@ -0,0 +1,20 @@
+# Petstore::FileSchemaTestClass
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **file** | **File** | | [optional] |
+| **files** | **Array<File>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::FileSchemaTestClass.new(
+ file: null,
+ files: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Foo.md b/samples/client/petstore/ruby-httpx/docs/Foo.md
new file mode 100644
index 00000000000..3a826f6ae70
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Foo.md
@@ -0,0 +1,18 @@
+# Petstore::Foo
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **bar** | **String** | | [optional][default to 'bar'] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Foo.new(
+ bar: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FooGetDefaultResponse.md b/samples/client/petstore/ruby-httpx/docs/FooGetDefaultResponse.md
new file mode 100644
index 00000000000..915e059d924
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FooGetDefaultResponse.md
@@ -0,0 +1,18 @@
+# Petstore::FooGetDefaultResponse
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **string** | [**Foo**](Foo.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::FooGetDefaultResponse.new(
+ string: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/FormatTest.md b/samples/client/petstore/ruby-httpx/docs/FormatTest.md
new file mode 100644
index 00000000000..a790ce44835
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/FormatTest.md
@@ -0,0 +1,48 @@
+# Petstore::FormatTest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **integer** | **Integer** | | [optional] |
+| **int32** | **Integer** | | [optional] |
+| **int64** | **Integer** | | [optional] |
+| **number** | **Float** | | |
+| **float** | **Float** | | [optional] |
+| **double** | **Float** | | [optional] |
+| **decimal** | **Float** | | [optional] |
+| **string** | **String** | | [optional] |
+| **byte** | **String** | | |
+| **binary** | **File** | | [optional] |
+| **date** | **Date** | | |
+| **date_time** | **Time** | | [optional] |
+| **uuid** | **String** | | [optional] |
+| **password** | **String** | | |
+| **pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] |
+| **pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::FormatTest.new(
+ integer: null,
+ int32: null,
+ int64: null,
+ number: null,
+ float: null,
+ double: null,
+ decimal: null,
+ string: null,
+ byte: null,
+ binary: null,
+ date: null,
+ date_time: null,
+ uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84,
+ password: null,
+ pattern_with_digits: null,
+ pattern_with_digits_and_delimiter: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/HasOnlyReadOnly.md b/samples/client/petstore/ruby-httpx/docs/HasOnlyReadOnly.md
new file mode 100644
index 00000000000..6d8dbfd0ad6
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/HasOnlyReadOnly.md
@@ -0,0 +1,20 @@
+# Petstore::HasOnlyReadOnly
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **bar** | **String** | | [optional][readonly] |
+| **foo** | **String** | | [optional][readonly] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::HasOnlyReadOnly.new(
+ bar: null,
+ foo: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/HealthCheckResult.md b/samples/client/petstore/ruby-httpx/docs/HealthCheckResult.md
new file mode 100644
index 00000000000..5695ceb488e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/HealthCheckResult.md
@@ -0,0 +1,18 @@
+# Petstore::HealthCheckResult
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **nullable_message** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::HealthCheckResult.new(
+ nullable_message: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/List.md b/samples/client/petstore/ruby-httpx/docs/List.md
new file mode 100644
index 00000000000..42467415e72
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/List.md
@@ -0,0 +1,18 @@
+# Petstore::List
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **_123_list** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::List.new(
+ _123_list: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/MapTest.md b/samples/client/petstore/ruby-httpx/docs/MapTest.md
new file mode 100644
index 00000000000..58bc1327247
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/MapTest.md
@@ -0,0 +1,24 @@
+# Petstore::MapTest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] |
+| **map_of_enum_string** | **Hash<String, String>** | | [optional] |
+| **direct_map** | **Hash<String, Boolean>** | | [optional] |
+| **indirect_map** | **Hash<String, Boolean>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::MapTest.new(
+ map_map_of_string: null,
+ map_of_enum_string: null,
+ direct_map: null,
+ indirect_map: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/ruby-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..c7d57c85ddd
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,22 @@
+# Petstore::MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **uuid** | **String** | | [optional] |
+| **date_time** | **Time** | | [optional] |
+| **map** | [**Hash<String, Animal>**](Animal.md) | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new(
+ uuid: null,
+ date_time: null,
+ map: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Model200Response.md b/samples/client/petstore/ruby-httpx/docs/Model200Response.md
new file mode 100644
index 00000000000..2eee7ded759
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Model200Response.md
@@ -0,0 +1,20 @@
+# Petstore::Model200Response
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **name** | **Integer** | | [optional] |
+| **_class** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Model200Response.new(
+ name: null,
+ _class: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ModelReturn.md b/samples/client/petstore/ruby-httpx/docs/ModelReturn.md
new file mode 100644
index 00000000000..bbcb5307f4b
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ModelReturn.md
@@ -0,0 +1,18 @@
+# Petstore::ModelReturn
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **_return** | **Integer** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ModelReturn.new(
+ _return: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Name.md b/samples/client/petstore/ruby-httpx/docs/Name.md
new file mode 100644
index 00000000000..9ff05587cbd
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Name.md
@@ -0,0 +1,24 @@
+# Petstore::Name
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **name** | **Integer** | | |
+| **snake_case** | **Integer** | | [optional][readonly] |
+| **property** | **String** | | [optional] |
+| **_123_number** | **Integer** | | [optional][readonly] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Name.new(
+ name: null,
+ snake_case: null,
+ property: null,
+ _123_number: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/NullableClass.md b/samples/client/petstore/ruby-httpx/docs/NullableClass.md
new file mode 100644
index 00000000000..761bfd80732
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/NullableClass.md
@@ -0,0 +1,40 @@
+# Petstore::NullableClass
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **integer_prop** | **Integer** | | [optional] |
+| **number_prop** | **Float** | | [optional] |
+| **boolean_prop** | **Boolean** | | [optional] |
+| **string_prop** | **String** | | [optional] |
+| **date_prop** | **Date** | | [optional] |
+| **datetime_prop** | **Time** | | [optional] |
+| **array_nullable_prop** | **Array<Object>** | | [optional] |
+| **array_and_items_nullable_prop** | **Array<Object>** | | [optional] |
+| **array_items_nullable** | **Array<Object>** | | [optional] |
+| **object_nullable_prop** | **Hash<String, Object>** | | [optional] |
+| **object_and_items_nullable_prop** | **Hash<String, Object>** | | [optional] |
+| **object_items_nullable** | **Hash<String, Object>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::NullableClass.new(
+ integer_prop: null,
+ number_prop: null,
+ boolean_prop: null,
+ string_prop: null,
+ date_prop: null,
+ datetime_prop: null,
+ array_nullable_prop: null,
+ array_and_items_nullable_prop: null,
+ array_items_nullable: null,
+ object_nullable_prop: null,
+ object_and_items_nullable_prop: null,
+ object_items_nullable: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/NumberOnly.md b/samples/client/petstore/ruby-httpx/docs/NumberOnly.md
new file mode 100644
index 00000000000..540e736c8a5
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/NumberOnly.md
@@ -0,0 +1,18 @@
+# Petstore::NumberOnly
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **just_number** | **Float** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::NumberOnly.new(
+ just_number: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/ruby-httpx/docs/ObjectWithDeprecatedFields.md
new file mode 100644
index 00000000000..6658759209b
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ObjectWithDeprecatedFields.md
@@ -0,0 +1,24 @@
+# Petstore::ObjectWithDeprecatedFields
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **uuid** | **String** | | [optional] |
+| **id** | **Float** | | [optional] |
+| **deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] |
+| **bars** | **Array<String>** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ObjectWithDeprecatedFields.new(
+ uuid: null,
+ id: null,
+ deprecated_ref: null,
+ bars: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Order.md b/samples/client/petstore/ruby-httpx/docs/Order.md
new file mode 100644
index 00000000000..a3fd5513806
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Order.md
@@ -0,0 +1,28 @@
+# Petstore::Order
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **Integer** | | [optional] |
+| **pet_id** | **Integer** | | [optional] |
+| **quantity** | **Integer** | | [optional] |
+| **ship_date** | **Time** | | [optional] |
+| **status** | **String** | Order Status | [optional] |
+| **complete** | **Boolean** | | [optional][default to false] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Order.new(
+ id: null,
+ pet_id: null,
+ quantity: null,
+ ship_date: null,
+ status: null,
+ complete: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterComposite.md b/samples/client/petstore/ruby-httpx/docs/OuterComposite.md
new file mode 100644
index 00000000000..03f9386e5f1
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterComposite.md
@@ -0,0 +1,22 @@
+# Petstore::OuterComposite
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **my_number** | **Float** | | [optional] |
+| **my_string** | **String** | | [optional] |
+| **my_boolean** | **Boolean** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterComposite.new(
+ my_number: null,
+ my_string: null,
+ my_boolean: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterEnum.md b/samples/client/petstore/ruby-httpx/docs/OuterEnum.md
new file mode 100644
index 00000000000..9c81b44ae77
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterEnum.md
@@ -0,0 +1,15 @@
+# Petstore::OuterEnum
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterEnum.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterEnumDefaultValue.md b/samples/client/petstore/ruby-httpx/docs/OuterEnumDefaultValue.md
new file mode 100644
index 00000000000..be1f48a846f
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterEnumDefaultValue.md
@@ -0,0 +1,15 @@
+# Petstore::OuterEnumDefaultValue
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterEnumDefaultValue.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterEnumInteger.md b/samples/client/petstore/ruby-httpx/docs/OuterEnumInteger.md
new file mode 100644
index 00000000000..80f46c1e0d0
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterEnumInteger.md
@@ -0,0 +1,15 @@
+# Petstore::OuterEnumInteger
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterEnumInteger.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/ruby-httpx/docs/OuterEnumIntegerDefaultValue.md
new file mode 100644
index 00000000000..38fbfd638ac
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,15 @@
+# Petstore::OuterEnumIntegerDefaultValue
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterEnumIntegerDefaultValue.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/ruby-httpx/docs/OuterObjectWithEnumProperty.md
new file mode 100644
index 00000000000..dfd9de4596e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/OuterObjectWithEnumProperty.md
@@ -0,0 +1,18 @@
+# Petstore::OuterObjectWithEnumProperty
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::OuterObjectWithEnumProperty.new(
+ value: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ParentWithNullable.md b/samples/client/petstore/ruby-httpx/docs/ParentWithNullable.md
new file mode 100644
index 00000000000..0c77bf999dc
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ParentWithNullable.md
@@ -0,0 +1,20 @@
+# Petstore::ParentWithNullable
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **type** | **String** | | [optional] |
+| **nullable_property** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ParentWithNullable.new(
+ type: null,
+ nullable_property: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Pet.md b/samples/client/petstore/ruby-httpx/docs/Pet.md
new file mode 100644
index 00000000000..13f34d7d167
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Pet.md
@@ -0,0 +1,28 @@
+# Petstore::Pet
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **Integer** | | [optional] |
+| **category** | [**Category**](Category.md) | | [optional] |
+| **name** | **String** | | |
+| **photo_urls** | **Array<String>** | | |
+| **tags** | [**Array<Tag>**](Tag.md) | | [optional] |
+| **status** | **String** | pet status in the store | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Pet.new(
+ id: null,
+ category: null,
+ name: doggie,
+ photo_urls: null,
+ tags: null,
+ status: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/PetApi.md b/samples/client/petstore/ruby-httpx/docs/PetApi.md
new file mode 100644
index 00000000000..b28334ae2c5
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/PetApi.md
@@ -0,0 +1,657 @@
+# Petstore::PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store |
+| [**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet |
+| [**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status |
+| [**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags |
+| [**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID |
+| [**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet |
+| [**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data |
+| [**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image |
+| [**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
+
+
+## add_pet
+
+> add_pet(pet)
+
+Add a new pet to the store
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
+
+begin
+ # Add a new pet to the store
+ api_instance.add_pet(pet)
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->add_pet: #{e}"
+end
+```
+
+#### Using the add_pet_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> add_pet_with_http_info(pet)
+
+```ruby
+begin
+ # Add a new pet to the store
+ data, status_code, headers = api_instance.add_pet_with_http_info(pet)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->add_pet_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+
+## delete_pet
+
+> delete_pet(pet_id, opts)
+
+Deletes a pet
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet_id = 789 # Integer | Pet id to delete
+opts = {
+ api_key: 'api_key_example' # String |
+}
+
+begin
+ # Deletes a pet
+ api_instance.delete_pet(pet_id, opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->delete_pet: #{e}"
+end
+```
+
+#### Using the delete_pet_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_pet_with_http_info(pet_id, opts)
+
+```ruby
+begin
+ # Deletes a pet
+ data, status_code, headers = api_instance.delete_pet_with_http_info(pet_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->delete_pet_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet_id** | **Integer** | Pet id to delete | |
+| **api_key** | **String** | | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+
+## find_pets_by_status
+
+> > find_pets_by_status(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+status = ['available'] # Array | Status values that need to be considered for filter
+
+begin
+ # Finds Pets by status
+ result = api_instance.find_pets_by_status(status)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->find_pets_by_status: #{e}"
+end
+```
+
+#### Using the find_pets_by_status_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> find_pets_by_status_with_http_info(status)
+
+```ruby
+begin
+ # Finds Pets by status
+ data, status_code, headers = api_instance.find_pets_by_status_with_http_info(status)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->find_pets_by_status_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **status** | [**Array<String>**](String.md) | Status values that need to be considered for filter | |
+
+### Return type
+
+[**Array<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## find_pets_by_tags
+
+> > find_pets_by_tags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+tags = ['inner_example'] # Array | Tags to filter by
+
+begin
+ # Finds Pets by tags
+ result = api_instance.find_pets_by_tags(tags)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->find_pets_by_tags: #{e}"
+end
+```
+
+#### Using the find_pets_by_tags_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> >, Integer, Hash)> find_pets_by_tags_with_http_info(tags)
+
+```ruby
+begin
+ # Finds Pets by tags
+ data, status_code, headers = api_instance.find_pets_by_tags_with_http_info(tags)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => >
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->find_pets_by_tags_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **tags** | [**Array<String>**](String.md) | Tags to filter by | |
+
+### Return type
+
+[**Array<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## get_pet_by_id
+
+> get_pet_by_id(pet_id)
+
+Find pet by ID
+
+Returns a single pet
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure API key authorization: api_key
+ config.api_key['api_key'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['api_key'] = 'Bearer'
+end
+
+api_instance = Petstore::PetApi.new
+pet_id = 789 # Integer | ID of pet to return
+
+begin
+ # Find pet by ID
+ result = api_instance.get_pet_by_id(pet_id)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->get_pet_by_id: #{e}"
+end
+```
+
+#### Using the get_pet_by_id_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_pet_by_id_with_http_info(pet_id)
+
+```ruby
+begin
+ # Find pet by ID
+ data, status_code, headers = api_instance.get_pet_by_id_with_http_info(pet_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->get_pet_by_id_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet_id** | **Integer** | ID of pet to return | |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## update_pet
+
+> update_pet(pet)
+
+Update an existing pet
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet = Petstore::Pet.new({name: 'doggie', photo_urls: ['photo_urls_example']}) # Pet | Pet object that needs to be added to the store
+
+begin
+ # Update an existing pet
+ api_instance.update_pet(pet)
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->update_pet: #{e}"
+end
+```
+
+#### Using the update_pet_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_pet_with_http_info(pet)
+
+```ruby
+begin
+ # Update an existing pet
+ data, status_code, headers = api_instance.update_pet_with_http_info(pet)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->update_pet_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+
+## update_pet_with_form
+
+> update_pet_with_form(pet_id, opts)
+
+Updates a pet in the store with form data
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet_id = 789 # Integer | ID of pet that needs to be updated
+opts = {
+ name: 'name_example', # String | Updated name of the pet
+ status: 'status_example' # String | Updated status of the pet
+}
+
+begin
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id, opts)
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->update_pet_with_form: #{e}"
+end
+```
+
+#### Using the update_pet_with_form_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_pet_with_form_with_http_info(pet_id, opts)
+
+```ruby
+begin
+ # Updates a pet in the store with form data
+ data, status_code, headers = api_instance.update_pet_with_form_with_http_info(pet_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->update_pet_with_form_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet_id** | **Integer** | ID of pet that needs to be updated | |
+| **name** | **String** | Updated name of the pet | [optional] |
+| **status** | **String** | Updated status of the pet | [optional] |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+
+## upload_file
+
+> upload_file(pet_id, opts)
+
+uploads an image
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet_id = 789 # Integer | ID of pet to update
+opts = {
+ additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server
+ file: File.new('/path/to/some/file') # File | file to upload
+}
+
+begin
+ # uploads an image
+ result = api_instance.upload_file(pet_id, opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->upload_file: #{e}"
+end
+```
+
+#### Using the upload_file_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> upload_file_with_http_info(pet_id, opts)
+
+```ruby
+begin
+ # uploads an image
+ data, status_code, headers = api_instance.upload_file_with_http_info(pet_id, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->upload_file_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet_id** | **Integer** | ID of pet to update | |
+| **additional_metadata** | **String** | Additional data to pass to server | [optional] |
+| **file** | **File** | file to upload | [optional] |
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+
+## upload_file_with_required_file
+
+> upload_file_with_required_file(pet_id, required_file, opts)
+
+uploads an image (required)
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure OAuth2 access token for authorization: petstore_auth
+ config.access_token = 'YOUR ACCESS TOKEN'
+end
+
+api_instance = Petstore::PetApi.new
+pet_id = 789 # Integer | ID of pet to update
+required_file = File.new('/path/to/some/file') # File | file to upload
+opts = {
+ additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server
+}
+
+begin
+ # uploads an image (required)
+ result = api_instance.upload_file_with_required_file(pet_id, required_file, opts)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->upload_file_with_required_file: #{e}"
+end
+```
+
+#### Using the upload_file_with_required_file_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> upload_file_with_required_file_with_http_info(pet_id, required_file, opts)
+
+```ruby
+begin
+ # uploads an image (required)
+ data, status_code, headers = api_instance.upload_file_with_required_file_with_http_info(pet_id, required_file, opts)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling PetApi->upload_file_with_required_file_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **pet_id** | **Integer** | ID of pet to update | |
+| **required_file** | **File** | file to upload | |
+| **additional_metadata** | **String** | Additional data to pass to server | [optional] |
+
+### Return type
+
+[**ApiResponse**](ApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
diff --git a/samples/client/petstore/ruby-httpx/docs/ReadOnlyFirst.md b/samples/client/petstore/ruby-httpx/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..bed355e261c
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/ReadOnlyFirst.md
@@ -0,0 +1,20 @@
+# Petstore::ReadOnlyFirst
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **bar** | **String** | | [optional][readonly] |
+| **baz** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::ReadOnlyFirst.new(
+ bar: null,
+ baz: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/SingleRefType.md b/samples/client/petstore/ruby-httpx/docs/SingleRefType.md
new file mode 100644
index 00000000000..1f997e7bf8d
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/SingleRefType.md
@@ -0,0 +1,15 @@
+# Petstore::SingleRefType
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::SingleRefType.new()
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/SpecialModelName.md b/samples/client/petstore/ruby-httpx/docs/SpecialModelName.md
new file mode 100644
index 00000000000..6a5169191d3
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/SpecialModelName.md
@@ -0,0 +1,18 @@
+# Petstore::SpecialModelName
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **special_property_name** | **Integer** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::SpecialModelName.new(
+ special_property_name: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/StoreApi.md b/samples/client/petstore/ruby-httpx/docs/StoreApi.md
new file mode 100644
index 00000000000..52c551498cf
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/StoreApi.md
@@ -0,0 +1,270 @@
+# Petstore::StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID |
+| [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status |
+| [**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID |
+| [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet |
+
+
+## delete_order
+
+> delete_order(order_id)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::StoreApi.new
+order_id = 'order_id_example' # String | ID of the order that needs to be deleted
+
+begin
+ # Delete purchase order by ID
+ api_instance.delete_order(order_id)
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->delete_order: #{e}"
+end
+```
+
+#### Using the delete_order_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_order_with_http_info(order_id)
+
+```ruby
+begin
+ # Delete purchase order by ID
+ data, status_code, headers = api_instance.delete_order_with_http_info(order_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->delete_order_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **order_id** | **String** | ID of the order that needs to be deleted | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+
+## get_inventory
+
+> Hash<String, Integer> get_inventory
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+# setup authorization
+Petstore.configure do |config|
+ # Configure API key authorization: api_key
+ config.api_key['api_key'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['api_key'] = 'Bearer'
+end
+
+api_instance = Petstore::StoreApi.new
+
+begin
+ # Returns pet inventories by status
+ result = api_instance.get_inventory
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->get_inventory: #{e}"
+end
+```
+
+#### Using the get_inventory_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> get_inventory_with_http_info
+
+```ruby
+begin
+ # Returns pet inventories by status
+ data, status_code, headers = api_instance.get_inventory_with_http_info
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => Hash<String, Integer>
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->get_inventory_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**Hash<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## get_order_by_id
+
+> get_order_by_id(order_id)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::StoreApi.new
+order_id = 789 # Integer | ID of pet that needs to be fetched
+
+begin
+ # Find purchase order by ID
+ result = api_instance.get_order_by_id(order_id)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->get_order_by_id: #{e}"
+end
+```
+
+#### Using the get_order_by_id_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_order_by_id_with_http_info(order_id)
+
+```ruby
+begin
+ # Find purchase order by ID
+ data, status_code, headers = api_instance.get_order_by_id_with_http_info(order_id)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->get_order_by_id_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **order_id** | **Integer** | ID of pet that needs to be fetched | |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## place_order
+
+> place_order(order)
+
+Place an order for a pet
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::StoreApi.new
+order = Petstore::Order.new # Order | order placed for purchasing the pet
+
+begin
+ # Place an order for a pet
+ result = api_instance.place_order(order)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->place_order: #{e}"
+end
+```
+
+#### Using the place_order_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> place_order_with_http_info(order)
+
+```ruby
+begin
+ # Place an order for a pet
+ data, status_code, headers = api_instance.place_order_with_http_info(order)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling StoreApi->place_order_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **order** | [**Order**](Order.md) | order placed for purchasing the pet | |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/xml, application/json
+
diff --git a/samples/client/petstore/ruby-httpx/docs/Tag.md b/samples/client/petstore/ruby-httpx/docs/Tag.md
new file mode 100644
index 00000000000..f29ee058b01
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/Tag.md
@@ -0,0 +1,20 @@
+# Petstore::Tag
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **Integer** | | [optional] |
+| **name** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::Tag.new(
+ id: null,
+ name: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/ruby-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md
new file mode 100644
index 00000000000..c976800c181
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/TestInlineFreeformAdditionalPropertiesRequest.md
@@ -0,0 +1,18 @@
+# Petstore::TestInlineFreeformAdditionalPropertiesRequest
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **some_property** | **String** | | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::TestInlineFreeformAdditionalPropertiesRequest.new(
+ some_property: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/User.md b/samples/client/petstore/ruby-httpx/docs/User.md
new file mode 100644
index 00000000000..1dab27adba2
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/User.md
@@ -0,0 +1,32 @@
+# Petstore::User
+
+## Properties
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **id** | **Integer** | | [optional] |
+| **username** | **String** | | [optional] |
+| **first_name** | **String** | | [optional] |
+| **last_name** | **String** | | [optional] |
+| **email** | **String** | | [optional] |
+| **password** | **String** | | [optional] |
+| **phone** | **String** | | [optional] |
+| **user_status** | **Integer** | User Status | [optional] |
+
+## Example
+
+```ruby
+require 'petstore'
+
+instance = Petstore::User.new(
+ id: null,
+ username: null,
+ first_name: null,
+ last_name: null,
+ email: null,
+ password: null,
+ phone: null,
+ user_status: null
+)
+```
+
diff --git a/samples/client/petstore/ruby-httpx/docs/UserApi.md b/samples/client/petstore/ruby-httpx/docs/UserApi.md
new file mode 100644
index 00000000000..348f5f9c429
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/docs/UserApi.md
@@ -0,0 +1,522 @@
+# Petstore::UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+| ------ | ------------ | ----------- |
+| [**create_user**](UserApi.md#create_user) | **POST** /user | Create user |
+| [**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array |
+| [**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array |
+| [**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user |
+| [**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name |
+| [**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system |
+| [**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session |
+| [**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user |
+
+
+## create_user
+
+> create_user(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+user = Petstore::User.new # User | Created user object
+
+begin
+ # Create user
+ api_instance.create_user(user)
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_user: #{e}"
+end
+```
+
+#### Using the create_user_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> create_user_with_http_info(user)
+
+```ruby
+begin
+ # Create user
+ data, status_code, headers = api_instance.create_user_with_http_info(user)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_user_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **user** | [**User**](User.md) | Created user object | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## create_users_with_array_input
+
+> create_users_with_array_input(user)
+
+Creates list of users with given input array
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+user = [Petstore::User.new] # Array | List of user object
+
+begin
+ # Creates list of users with given input array
+ api_instance.create_users_with_array_input(user)
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_users_with_array_input: #{e}"
+end
+```
+
+#### Using the create_users_with_array_input_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> create_users_with_array_input_with_http_info(user)
+
+```ruby
+begin
+ # Creates list of users with given input array
+ data, status_code, headers = api_instance.create_users_with_array_input_with_http_info(user)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_users_with_array_input_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **user** | [**Array<User>**](User.md) | List of user object | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## create_users_with_list_input
+
+> create_users_with_list_input(user)
+
+Creates list of users with given input array
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+user = [Petstore::User.new] # Array | List of user object
+
+begin
+ # Creates list of users with given input array
+ api_instance.create_users_with_list_input(user)
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_users_with_list_input: #{e}"
+end
+```
+
+#### Using the create_users_with_list_input_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> create_users_with_list_input_with_http_info(user)
+
+```ruby
+begin
+ # Creates list of users with given input array
+ data, status_code, headers = api_instance.create_users_with_list_input_with_http_info(user)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->create_users_with_list_input_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **user** | [**Array<User>**](User.md) | List of user object | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+
+## delete_user
+
+> delete_user(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+username = 'username_example' # String | The name that needs to be deleted
+
+begin
+ # Delete user
+ api_instance.delete_user(username)
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->delete_user: #{e}"
+end
+```
+
+#### Using the delete_user_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> delete_user_with_http_info(username)
+
+```ruby
+begin
+ # Delete user
+ data, status_code, headers = api_instance.delete_user_with_http_info(username)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->delete_user_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **username** | **String** | The name that needs to be deleted | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+
+## get_user_by_name
+
+> get_user_by_name(username)
+
+Get user by user name
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing.
+
+begin
+ # Get user by user name
+ result = api_instance.get_user_by_name(username)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->get_user_by_name: #{e}"
+end
+```
+
+#### Using the get_user_by_name_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> , Integer, Hash)> get_user_by_name_with_http_info(username)
+
+```ruby
+begin
+ # Get user by user name
+ data, status_code, headers = api_instance.get_user_by_name_with_http_info(username)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # =>
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->get_user_by_name_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **username** | **String** | The name that needs to be fetched. Use user1 for testing. | |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## login_user
+
+> String login_user(username, password)
+
+Logs user into the system
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+username = 'username_example' # String | The user name for login
+password = 'password_example' # String | The password for login in clear text
+
+begin
+ # Logs user into the system
+ result = api_instance.login_user(username, password)
+ p result
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->login_user: #{e}"
+end
+```
+
+#### Using the login_user_with_http_info variant
+
+This returns an Array which contains the response data, status code and headers.
+
+> login_user_with_http_info(username, password)
+
+```ruby
+begin
+ # Logs user into the system
+ data, status_code, headers = api_instance.login_user_with_http_info(username, password)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => String
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->login_user_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **username** | **String** | The user name for login | |
+| **password** | **String** | The password for login in clear text | |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+
+## logout_user
+
+> logout_user
+
+Logs out current logged in user session
+
+
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+
+begin
+ # Logs out current logged in user session
+ api_instance.logout_user
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->logout_user: #{e}"
+end
+```
+
+#### Using the logout_user_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> logout_user_with_http_info
+
+```ruby
+begin
+ # Logs out current logged in user session
+ data, status_code, headers = api_instance.logout_user_with_http_info
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->logout_user_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+
+## update_user
+
+> update_user(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Examples
+
+```ruby
+require 'time'
+require 'petstore'
+
+api_instance = Petstore::UserApi.new
+username = 'username_example' # String | name that need to be deleted
+user = Petstore::User.new # User | Updated user object
+
+begin
+ # Updated user
+ api_instance.update_user(username, user)
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->update_user: #{e}"
+end
+```
+
+#### Using the update_user_with_http_info variant
+
+This returns an Array which contains the response data (`nil` in this case), status code and headers.
+
+> update_user_with_http_info(username, user)
+
+```ruby
+begin
+ # Updated user
+ data, status_code, headers = api_instance.update_user_with_http_info(username, user)
+ p status_code # => 2xx
+ p headers # => { ... }
+ p data # => nil
+rescue Petstore::ApiError => e
+ puts "Error when calling UserApi->update_user_with_http_info: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **username** | **String** | name that need to be deleted | |
+| **user** | [**User**](User.md) | Updated user object | |
+
+### Return type
+
+nil (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
diff --git a/samples/client/petstore/ruby-httpx/git_push.sh b/samples/client/petstore/ruby-httpx/git_push.sh
new file mode 100644
index 00000000000..f53a75d4fab
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore.rb b/samples/client/petstore/ruby-httpx/lib/petstore.rb
new file mode 100644
index 00000000000..1eb267a633d
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore.rb
@@ -0,0 +1,96 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+# Common files
+require 'petstore/api_client'
+require 'petstore/api_error'
+require 'petstore/version'
+require 'petstore/configuration'
+
+# Models
+require 'petstore/models/additional_properties_class'
+require 'petstore/models/all_of_with_single_ref'
+require 'petstore/models/animal'
+require 'petstore/models/api_response'
+require 'petstore/models/array_of_array_of_number_only'
+require 'petstore/models/array_of_number_only'
+require 'petstore/models/array_test'
+require 'petstore/models/capitalization'
+require 'petstore/models/category'
+require 'petstore/models/class_model'
+require 'petstore/models/client'
+require 'petstore/models/deprecated_object'
+require 'petstore/models/enum_arrays'
+require 'petstore/models/enum_class'
+require 'petstore/models/enum_test'
+require 'petstore/models/fake_big_decimal_map200_response'
+require 'petstore/models/file'
+require 'petstore/models/file_schema_test_class'
+require 'petstore/models/foo'
+require 'petstore/models/foo_get_default_response'
+require 'petstore/models/format_test'
+require 'petstore/models/has_only_read_only'
+require 'petstore/models/health_check_result'
+require 'petstore/models/list'
+require 'petstore/models/map_test'
+require 'petstore/models/mixed_properties_and_additional_properties_class'
+require 'petstore/models/model200_response'
+require 'petstore/models/model_return'
+require 'petstore/models/name'
+require 'petstore/models/nullable_class'
+require 'petstore/models/number_only'
+require 'petstore/models/object_with_deprecated_fields'
+require 'petstore/models/order'
+require 'petstore/models/outer_composite'
+require 'petstore/models/outer_enum'
+require 'petstore/models/outer_enum_default_value'
+require 'petstore/models/outer_enum_integer'
+require 'petstore/models/outer_enum_integer_default_value'
+require 'petstore/models/outer_object_with_enum_property'
+require 'petstore/models/parent_with_nullable'
+require 'petstore/models/pet'
+require 'petstore/models/read_only_first'
+require 'petstore/models/single_ref_type'
+require 'petstore/models/special_model_name'
+require 'petstore/models/tag'
+require 'petstore/models/test_inline_freeform_additional_properties_request'
+require 'petstore/models/user'
+require 'petstore/models/cat'
+require 'petstore/models/child_with_nullable'
+require 'petstore/models/dog'
+
+# APIs
+require 'petstore/api/another_fake_api'
+require 'petstore/api/default_api'
+require 'petstore/api/fake_api'
+require 'petstore/api/fake_classname_tags123_api'
+require 'petstore/api/pet_api'
+require 'petstore/api/store_api'
+require 'petstore/api/user_api'
+
+module Petstore
+ class << self
+ # Customize default settings for the SDK using block.
+ # Petstore.configure do |config|
+ # config.username = "xxx"
+ # config.password = "xxx"
+ # end
+ # If no block given, return the default Configuration object.
+ def configure
+ if block_given?
+ yield(Configuration.default)
+ else
+ Configuration.default
+ end
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb
new file mode 100644
index 00000000000..a3bdc5af0bf
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/another_fake_api.rb
@@ -0,0 +1,90 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class AnotherFakeApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # To test special tags
+ # To test special tags and operation ID starting with number
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Client]
+ def call_123_test_special_tags(client, opts = {})
+ data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts)
+ data
+ end
+
+ # To test special tags
+ # To test special tags and operation ID starting with number
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers
+ def call_123_test_special_tags_with_http_info(client, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...'
+ end
+ # verify the required parameter 'client' is set
+ if @api_client.config.client_side_validation && client.nil?
+ fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags"
+ end
+ # resource path
+ local_var_path = '/another-fake/dummy'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(client)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Client'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"AnotherFakeApi.call_123_test_special_tags",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb
new file mode 100644
index 00000000000..f9fc19208aa
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/default_api.rb
@@ -0,0 +1,75 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class DefaultApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # @param [Hash] opts the optional parameters
+ # @return [FooGetDefaultResponse]
+ def foo_get(opts = {})
+ data, _status_code, _headers = foo_get_with_http_info(opts)
+ data
+ end
+
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(FooGetDefaultResponse, Integer, Hash)>] FooGetDefaultResponse data, response status code and response headers
+ def foo_get_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: DefaultApi.foo_get ...'
+ end
+ # resource path
+ local_var_path = '/foo'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'FooGetDefaultResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"DefaultApi.foo_get",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: DefaultApi#foo_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb
new file mode 100644
index 00000000000..e3235d6990d
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_api.rb
@@ -0,0 +1,1527 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class FakeApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
+ # @param [Hash] opts the optional parameters
+ # @return [FakeBigDecimalMap200Response]
+ def fake_big_decimal_map(opts = {})
+ data, _status_code, _headers = fake_big_decimal_map_with_http_info(opts)
+ data
+ end
+
+ # for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(FakeBigDecimalMap200Response, Integer, Hash)>] FakeBigDecimalMap200Response data, response status code and response headers
+ def fake_big_decimal_map_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_big_decimal_map ...'
+ end
+ # resource path
+ local_var_path = '/fake/BigDecimalMap'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'FakeBigDecimalMap200Response'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_big_decimal_map",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_big_decimal_map\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Health check endpoint
+ # @param [Hash] opts the optional parameters
+ # @return [HealthCheckResult]
+ def fake_health_get(opts = {})
+ data, _status_code, _headers = fake_health_get_with_http_info(opts)
+ data
+ end
+
+ # Health check endpoint
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers
+ def fake_health_get_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...'
+ end
+ # resource path
+ local_var_path = '/fake/health'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'HealthCheckResult'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_health_get",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # test http signature authentication
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :query_1 query parameter
+ # @option opts [String] :header_1 header parameter
+ # @return [nil]
+ def fake_http_signature_test(pet, opts = {})
+ fake_http_signature_test_with_http_info(pet, opts)
+ nil
+ end
+
+ # test http signature authentication
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :query_1 query parameter
+ # @option opts [String] :header_1 header parameter
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def fake_http_signature_test_with_http_info(pet, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...'
+ end
+ # verify the required parameter 'pet' is set
+ if @api_client.config.client_side_validation && pet.nil?
+ fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test"
+ end
+ # resource path
+ local_var_path = '/fake/http-signature-test'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json', 'application/xml'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+ header_params['header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pet)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['http_signature_test']
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_http_signature_test",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Test serialization of outer boolean types
+ # @param [Hash] opts the optional parameters
+ # @option opts [Boolean] :body Input boolean as post body
+ # @return [Boolean]
+ def fake_outer_boolean_serialize(opts = {})
+ data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts)
+ data
+ end
+
+ # Test serialization of outer boolean types
+ # @param [Hash] opts the optional parameters
+ # @option opts [Boolean] :body Input boolean as post body
+ # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers
+ def fake_outer_boolean_serialize_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...'
+ end
+ # resource path
+ local_var_path = '/fake/outer/boolean'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Boolean'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_outer_boolean_serialize",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Test serialization of object with outer number type
+ # @param [Hash] opts the optional parameters
+ # @option opts [OuterComposite] :outer_composite Input composite as post body
+ # @return [OuterComposite]
+ def fake_outer_composite_serialize(opts = {})
+ data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts)
+ data
+ end
+
+ # Test serialization of object with outer number type
+ # @param [Hash] opts the optional parameters
+ # @option opts [OuterComposite] :outer_composite Input composite as post body
+ # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers
+ def fake_outer_composite_serialize_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...'
+ end
+ # resource path
+ local_var_path = '/fake/outer/composite'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'outer_composite'])
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'OuterComposite'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_outer_composite_serialize",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Test serialization of outer number types
+ # @param [Hash] opts the optional parameters
+ # @option opts [Float] :body Input number as post body
+ # @return [Float]
+ def fake_outer_number_serialize(opts = {})
+ data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts)
+ data
+ end
+
+ # Test serialization of outer number types
+ # @param [Hash] opts the optional parameters
+ # @option opts [Float] :body Input number as post body
+ # @return [Array<(Float, Integer, Hash)>] Float data, response status code and response headers
+ def fake_outer_number_serialize_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...'
+ end
+ # resource path
+ local_var_path = '/fake/outer/number'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Float'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_outer_number_serialize",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Test serialization of outer string types
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :body Input string as post body
+ # @return [String]
+ def fake_outer_string_serialize(opts = {})
+ data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts)
+ data
+ end
+
+ # Test serialization of outer string types
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :body Input string as post body
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
+ def fake_outer_string_serialize_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...'
+ end
+ # resource path
+ local_var_path = '/fake/outer/string'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'String'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_outer_string_serialize",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Test serialization of enum (int) properties with examples
+ # @param outer_object_with_enum_property [OuterObjectWithEnumProperty] Input enum (int) as post body
+ # @param [Hash] opts the optional parameters
+ # @return [OuterObjectWithEnumProperty]
+ def fake_property_enum_integer_serialize(outer_object_with_enum_property, opts = {})
+ data, _status_code, _headers = fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, opts)
+ data
+ end
+
+ # Test serialization of enum (int) properties with examples
+ # @param outer_object_with_enum_property [OuterObjectWithEnumProperty] Input enum (int) as post body
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(OuterObjectWithEnumProperty, Integer, Hash)>] OuterObjectWithEnumProperty data, response status code and response headers
+ def fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.fake_property_enum_integer_serialize ...'
+ end
+ # verify the required parameter 'outer_object_with_enum_property' is set
+ if @api_client.config.client_side_validation && outer_object_with_enum_property.nil?
+ fail ArgumentError, "Missing the required parameter 'outer_object_with_enum_property' when calling FakeApi.fake_property_enum_integer_serialize"
+ end
+ # resource path
+ local_var_path = '/fake/property/enum-int'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(outer_object_with_enum_property)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'OuterObjectWithEnumProperty'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.fake_property_enum_integer_serialize",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#fake_property_enum_integer_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # For this test, the body has to be a binary file.
+ # @param body [File] image to upload
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_body_with_binary(body, opts = {})
+ test_body_with_binary_with_http_info(body, opts)
+ nil
+ end
+
+ # For this test, the body has to be a binary file.
+ # @param body [File] image to upload
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_body_with_binary_with_http_info(body, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_binary ...'
+ end
+ # resource path
+ local_var_path = '/fake/body-with-binary'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['image/png'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_body_with_binary",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_body_with_binary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # For this test, the body for this request must reference a schema named `File`.
+ # @param file_schema_test_class [FileSchemaTestClass]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_body_with_file_schema(file_schema_test_class, opts = {})
+ test_body_with_file_schema_with_http_info(file_schema_test_class, opts)
+ nil
+ end
+
+ # For this test, the body for this request must reference a schema named `File`.
+ # @param file_schema_test_class [FileSchemaTestClass]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...'
+ end
+ # verify the required parameter 'file_schema_test_class' is set
+ if @api_client.config.client_side_validation && file_schema_test_class.nil?
+ fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema"
+ end
+ # resource path
+ local_var_path = '/fake/body-with-file-schema'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(file_schema_test_class)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_body_with_file_schema",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # @param query [String]
+ # @param user [User]
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_body_with_query_params(query, user, opts = {})
+ test_body_with_query_params_with_http_info(query, user, opts)
+ nil
+ end
+
+ # @param query [String]
+ # @param user [User]
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_body_with_query_params_with_http_info(query, user, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...'
+ end
+ # verify the required parameter 'query' is set
+ if @api_client.config.client_side_validation && query.nil?
+ fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params"
+ end
+ # verify the required parameter 'user' is set
+ if @api_client.config.client_side_validation && user.nil?
+ fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params"
+ end
+ # resource path
+ local_var_path = '/fake/body-with-query-params'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'query'] = query
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_body_with_query_params",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # To test \"client\" model
+ # To test \"client\" model
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Client]
+ def test_client_model(client, opts = {})
+ data, _status_code, _headers = test_client_model_with_http_info(client, opts)
+ data
+ end
+
+ # To test \"client\" model
+ # To test \"client\" model
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers
+ def test_client_model_with_http_info(client, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...'
+ end
+ # verify the required parameter 'client' is set
+ if @api_client.config.client_side_validation && client.nil?
+ fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model"
+ end
+ # resource path
+ local_var_path = '/fake'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(client)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Client'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_client_model",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ # @param number [Float] None
+ # @param double [Float] None
+ # @param pattern_without_delimiter [String] None
+ # @param byte [String] None
+ # @param [Hash] opts the optional parameters
+ # @option opts [Integer] :integer None
+ # @option opts [Integer] :int32 None
+ # @option opts [Integer] :int64 None
+ # @option opts [Float] :float None
+ # @option opts [String] :string None
+ # @option opts [File] :binary None
+ # @option opts [Date] :date None
+ # @option opts [Time] :date_time None
+ # @option opts [String] :password None
+ # @option opts [String] :callback None
+ # @return [nil]
+ def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts = {})
+ test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts)
+ nil
+ end
+
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ # @param number [Float] None
+ # @param double [Float] None
+ # @param pattern_without_delimiter [String] None
+ # @param byte [String] None
+ # @param [Hash] opts the optional parameters
+ # @option opts [Integer] :integer None
+ # @option opts [Integer] :int32 None
+ # @option opts [Integer] :int64 None
+ # @option opts [Float] :float None
+ # @option opts [String] :string None
+ # @option opts [File] :binary None
+ # @option opts [Date] :date None
+ # @option opts [Time] :date_time None
+ # @option opts [String] :password None
+ # @option opts [String] :callback None
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...'
+ end
+ # verify the required parameter 'number' is set
+ if @api_client.config.client_side_validation && number.nil?
+ fail ArgumentError, "Missing the required parameter 'number' when calling FakeApi.test_endpoint_parameters"
+ end
+ if @api_client.config.client_side_validation && number > 543.2
+ fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 543.2.'
+ end
+
+ if @api_client.config.client_side_validation && number < 32.1
+ fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 32.1.'
+ end
+
+ # verify the required parameter 'double' is set
+ if @api_client.config.client_side_validation && double.nil?
+ fail ArgumentError, "Missing the required parameter 'double' when calling FakeApi.test_endpoint_parameters"
+ end
+ if @api_client.config.client_side_validation && double > 123.4
+ fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 123.4.'
+ end
+
+ if @api_client.config.client_side_validation && double < 67.8
+ fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 67.8.'
+ end
+
+ # verify the required parameter 'pattern_without_delimiter' is set
+ if @api_client.config.client_side_validation && pattern_without_delimiter.nil?
+ fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters"
+ end
+ pattern = Regexp.new(/^[A-Z].*/)
+ if @api_client.config.client_side_validation && pattern_without_delimiter !~ pattern
+ fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}."
+ end
+
+ # verify the required parameter 'byte' is set
+ if @api_client.config.client_side_validation && byte.nil?
+ fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters"
+ end
+ if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] > 100
+ fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] < 10
+ fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] > 200
+ fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] < 20
+ fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'float'].nil? && opts[:'float'] > 987.6
+ fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.'
+ end
+
+ pattern = Regexp.new(/[a-z]/i)
+ if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ pattern
+ fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}."
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64
+ fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.'
+ end
+
+ if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length < 10
+ fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.'
+ end
+
+ # resource path
+ local_var_path = '/fake'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['number'] = number
+ form_params['double'] = double
+ form_params['pattern_without_delimiter'] = pattern_without_delimiter
+ form_params['byte'] = byte
+ form_params['integer'] = opts[:'integer'] if !opts[:'integer'].nil?
+ form_params['int32'] = opts[:'int32'] if !opts[:'int32'].nil?
+ form_params['int64'] = opts[:'int64'] if !opts[:'int64'].nil?
+ form_params['float'] = opts[:'float'] if !opts[:'float'].nil?
+ form_params['string'] = opts[:'string'] if !opts[:'string'].nil?
+ form_params['binary'] = opts[:'binary'] if !opts[:'binary'].nil?
+ form_params['date'] = opts[:'date'] if !opts[:'date'].nil?
+ form_params['dateTime'] = opts[:'date_time'] if !opts[:'date_time'].nil?
+ form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
+ form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil?
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['http_basic_test']
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_endpoint_parameters",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # To test enum parameters
+ # To test enum parameters
+ # @param [Hash] opts the optional parameters
+ # @option opts [Array] :enum_header_string_array Header parameter enum test (string array)
+ # @option opts [String] :enum_header_string Header parameter enum test (string) (default to '-efg')
+ # @option opts [Array] :enum_query_string_array Query parameter enum test (string array)
+ # @option opts [String] :enum_query_string Query parameter enum test (string) (default to '-efg')
+ # @option opts [Integer] :enum_query_integer Query parameter enum test (double)
+ # @option opts [Float] :enum_query_double Query parameter enum test (double)
+ # @option opts [Array] :enum_query_model_array
+ # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) (default to '$')
+ # @option opts [String] :enum_form_string Form parameter enum test (string) (default to '-efg')
+ # @return [nil]
+ def test_enum_parameters(opts = {})
+ test_enum_parameters_with_http_info(opts)
+ nil
+ end
+
+ # To test enum parameters
+ # To test enum parameters
+ # @param [Hash] opts the optional parameters
+ # @option opts [Array] :enum_header_string_array Header parameter enum test (string array)
+ # @option opts [String] :enum_header_string Header parameter enum test (string) (default to '-efg')
+ # @option opts [Array] :enum_query_string_array Query parameter enum test (string array)
+ # @option opts [String] :enum_query_string Query parameter enum test (string) (default to '-efg')
+ # @option opts [Integer] :enum_query_integer Query parameter enum test (double)
+ # @option opts [Float] :enum_query_double Query parameter enum test (double)
+ # @option opts [Array] :enum_query_model_array
+ # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) (default to '$')
+ # @option opts [String] :enum_form_string Form parameter enum test (string) (default to '-efg')
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_enum_parameters_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...'
+ end
+ allowable_values = [">", "$"]
+ if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| allowable_values.include?(item) }
+ fail ArgumentError, "invalid value for \"enum_header_string_array\", must include one of #{allowable_values}"
+ end
+ allowable_values = ["_abc", "-efg", "(xyz)"]
+ if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !allowable_values.include?(opts[:'enum_header_string'])
+ fail ArgumentError, "invalid value for \"enum_header_string\", must be one of #{allowable_values}"
+ end
+ allowable_values = [">", "$"]
+ if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| allowable_values.include?(item) }
+ fail ArgumentError, "invalid value for \"enum_query_string_array\", must include one of #{allowable_values}"
+ end
+ allowable_values = ["_abc", "-efg", "(xyz)"]
+ if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !allowable_values.include?(opts[:'enum_query_string'])
+ fail ArgumentError, "invalid value for \"enum_query_string\", must be one of #{allowable_values}"
+ end
+ allowable_values = [1, -2]
+ if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !allowable_values.include?(opts[:'enum_query_integer'])
+ fail ArgumentError, "invalid value for \"enum_query_integer\", must be one of #{allowable_values}"
+ end
+ allowable_values = [1.1, -1.2]
+ if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !allowable_values.include?(opts[:'enum_query_double'])
+ fail ArgumentError, "invalid value for \"enum_query_double\", must be one of #{allowable_values}"
+ end
+ allowable_values = [">", "$"]
+ if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| allowable_values.include?(item) }
+ fail ArgumentError, "invalid value for \"enum_form_string_array\", must include one of #{allowable_values}"
+ end
+ allowable_values = ["_abc", "-efg", "(xyz)"]
+ if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !allowable_values.include?(opts[:'enum_form_string'])
+ fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{allowable_values}"
+ end
+ # resource path
+ local_var_path = '/fake'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil?
+ query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil?
+ query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil?
+ query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil?
+ query_params[:'enum_query_model_array'] = @api_client.build_collection_param(opts[:'enum_query_model_array'], :multi) if !opts[:'enum_query_model_array'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+ header_params['enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil?
+ header_params['enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil?
+ form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil?
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_enum_parameters",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Fake endpoint to test group parameters (optional)
+ # Fake endpoint to test group parameters (optional)
+ # @param [Hash] opts the parameters
+ # @option opts [Integer] :required_string_group Required String in group parameters (required)
+ # @option opts [Boolean] :required_boolean_group Required Boolean in group parameters (required)
+ # @option opts [Integer] :required_int64_group Required Integer in group parameters (required)
+ # @option opts [Integer] :string_group String in group parameters
+ # @option opts [Boolean] :boolean_group Boolean in group parameters
+ # @option opts [Integer] :int64_group Integer in group parameters
+ # @return [nil]
+ def test_group_parameters(opts = {})
+ test_group_parameters_with_http_info(opts)
+ nil
+ end
+
+ # Fake endpoint to test group parameters (optional)
+ # Fake endpoint to test group parameters (optional)
+ # @param [Hash] opts the parameters
+ # @option opts [Integer] :required_string_group Required String in group parameters (required)
+ # @option opts [Boolean] :required_boolean_group Required Boolean in group parameters (required)
+ # @option opts [Integer] :required_int64_group Required Integer in group parameters (required)
+ # @option opts [Integer] :string_group String in group parameters
+ # @option opts [Boolean] :boolean_group Boolean in group parameters
+ # @option opts [Integer] :int64_group Integer in group parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_group_parameters_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...'
+ end
+ # unbox the parameters from the hash
+ required_string_group = opts[:'required_string_group']
+ required_boolean_group = opts[:'required_boolean_group']
+ required_int64_group = opts[:'required_int64_group']
+ # verify the required parameter 'required_string_group' is set
+ if @api_client.config.client_side_validation && required_string_group.nil?
+ fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters"
+ end
+ # verify the required parameter 'required_boolean_group' is set
+ if @api_client.config.client_side_validation && required_boolean_group.nil?
+ fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters"
+ end
+ # verify the required parameter 'required_int64_group' is set
+ if @api_client.config.client_side_validation && required_int64_group.nil?
+ fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters"
+ end
+ # resource path
+ local_var_path = '/fake'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'required_string_group'] = required_string_group
+ query_params[:'required_int64_group'] = required_int64_group
+ query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil?
+ query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ header_params['required_boolean_group'] = required_boolean_group
+ header_params['boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['bearer_test']
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_group_parameters",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # test inline additionalProperties
+ #
+ # @param request_body [Hash] request body
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_inline_additional_properties(request_body, opts = {})
+ test_inline_additional_properties_with_http_info(request_body, opts)
+ nil
+ end
+
+ # test inline additionalProperties
+ #
+ # @param request_body [Hash] request body
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_inline_additional_properties_with_http_info(request_body, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...'
+ end
+ # verify the required parameter 'request_body' is set
+ if @api_client.config.client_side_validation && request_body.nil?
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties"
+ end
+ # resource path
+ local_var_path = '/fake/inline-additionalProperties'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_inline_additional_properties",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # test inline free-form additionalProperties
+ #
+ # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request, opts = {})
+ test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts)
+ nil
+ end
+
+ # test inline free-form additionalProperties
+ #
+ # @param test_inline_freeform_additional_properties_request [TestInlineFreeformAdditionalPropertiesRequest] request body
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_inline_freeform_additional_properties_with_http_info(test_inline_freeform_additional_properties_request, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_freeform_additional_properties ...'
+ end
+ # verify the required parameter 'test_inline_freeform_additional_properties_request' is set
+ if @api_client.config.client_side_validation && test_inline_freeform_additional_properties_request.nil?
+ fail ArgumentError, "Missing the required parameter 'test_inline_freeform_additional_properties_request' when calling FakeApi.test_inline_freeform_additional_properties"
+ end
+ # resource path
+ local_var_path = '/fake/inline-freeform-additionalProperties'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(test_inline_freeform_additional_properties_request)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_inline_freeform_additional_properties",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_inline_freeform_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # test json serialization of form data
+ #
+ # @param param [String] field1
+ # @param param2 [String] field2
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_json_form_data(param, param2, opts = {})
+ test_json_form_data_with_http_info(param, param2, opts)
+ nil
+ end
+
+ # test json serialization of form data
+ #
+ # @param param [String] field1
+ # @param param2 [String] field2
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_json_form_data_with_http_info(param, param2, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_json_form_data ...'
+ end
+ # verify the required parameter 'param' is set
+ if @api_client.config.client_side_validation && param.nil?
+ fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_json_form_data"
+ end
+ # verify the required parameter 'param2' is set
+ if @api_client.config.client_side_validation && param2.nil?
+ fail ArgumentError, "Missing the required parameter 'param2' when calling FakeApi.test_json_form_data"
+ end
+ # resource path
+ local_var_path = '/fake/jsonFormData'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['param'] = param
+ form_params['param2'] = param2
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_json_form_data",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_json_form_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # test nullable parent property
+ #
+ # @param child_with_nullable [ChildWithNullable] request body
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def test_nullable(child_with_nullable, opts = {})
+ test_nullable_with_http_info(child_with_nullable, opts)
+ nil
+ end
+
+ # test nullable parent property
+ #
+ # @param child_with_nullable [ChildWithNullable] request body
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_nullable_with_http_info(child_with_nullable, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_nullable ...'
+ end
+ # verify the required parameter 'child_with_nullable' is set
+ if @api_client.config.client_side_validation && child_with_nullable.nil?
+ fail ArgumentError, "Missing the required parameter 'child_with_nullable' when calling FakeApi.test_nullable"
+ end
+ # resource path
+ local_var_path = '/fake/nullable'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(child_with_nullable)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_nullable",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_nullable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # To test the collection format in query parameters
+ # @param pipe [Array]
+ # @param ioutil [Array]
+ # @param http [Array]
+ # @param url [Array]
+ # @param context [Array]
+ # @param allow_empty [String]
+ # @param [Hash] opts the optional parameters
+ # @option opts [Hash] :language
+ # @return [nil]
+ def test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts = {})
+ test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts)
+ nil
+ end
+
+ # To test the collection format in query parameters
+ # @param pipe [Array]
+ # @param ioutil [Array]
+ # @param http [Array]
+ # @param url [Array]
+ # @param context [Array]
+ # @param allow_empty [String]
+ # @param [Hash] opts the optional parameters
+ # @option opts [Hash] :language
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...'
+ end
+ # verify the required parameter 'pipe' is set
+ if @api_client.config.client_side_validation && pipe.nil?
+ fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # verify the required parameter 'ioutil' is set
+ if @api_client.config.client_side_validation && ioutil.nil?
+ fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # verify the required parameter 'http' is set
+ if @api_client.config.client_side_validation && http.nil?
+ fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # verify the required parameter 'url' is set
+ if @api_client.config.client_side_validation && url.nil?
+ fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # verify the required parameter 'context' is set
+ if @api_client.config.client_side_validation && context.nil?
+ fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # verify the required parameter 'allow_empty' is set
+ if @api_client.config.client_side_validation && allow_empty.nil?
+ fail ArgumentError, "Missing the required parameter 'allow_empty' when calling FakeApi.test_query_parameter_collection_format"
+ end
+ # resource path
+ local_var_path = '/fake/test-query-parameters'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'pipe'] = @api_client.build_collection_param(pipe, :pipes)
+ query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv)
+ query_params[:'http'] = @api_client.build_collection_param(http, :ssv)
+ query_params[:'url'] = @api_client.build_collection_param(url, :csv)
+ query_params[:'context'] = @api_client.build_collection_param(context, :multi)
+ query_params[:'allowEmpty'] = allow_empty
+ query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"FakeApi.test_query_parameter_collection_format",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb
new file mode 100644
index 00000000000..3665b113790
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/fake_classname_tags123_api.rb
@@ -0,0 +1,90 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class FakeClassnameTags123Api
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # To test class name in snake case
+ # To test class name in snake case
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Client]
+ def test_classname(client, opts = {})
+ data, _status_code, _headers = test_classname_with_http_info(client, opts)
+ data
+ end
+
+ # To test class name in snake case
+ # To test class name in snake case
+ # @param client [Client] client model
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers
+ def test_classname_with_http_info(client, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...'
+ end
+ # verify the required parameter 'client' is set
+ if @api_client.config.client_side_validation && client.nil?
+ fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname"
+ end
+ # resource path
+ local_var_path = '/fake_classname_test'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(client)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Client'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['api_key_query']
+
+ new_options = opts.merge(
+ :operation => :"FakeClassnameTags123Api.test_classname",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb
new file mode 100644
index 00000000000..c3972cea110
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/pet_api.rb
@@ -0,0 +1,633 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class PetApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Add a new pet to the store
+ #
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def add_pet(pet, opts = {})
+ add_pet_with_http_info(pet, opts)
+ nil
+ end
+
+ # Add a new pet to the store
+ #
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def add_pet_with_http_info(pet, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...'
+ end
+ # verify the required parameter 'pet' is set
+ if @api_client.config.client_side_validation && pet.nil?
+ fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet"
+ end
+ # resource path
+ local_var_path = '/pet'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json', 'application/xml'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pet)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.add_pet",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Deletes a pet
+ #
+ # @param pet_id [Integer] Pet id to delete
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :api_key
+ # @return [nil]
+ def delete_pet(pet_id, opts = {})
+ delete_pet_with_http_info(pet_id, opts)
+ nil
+ end
+
+ # Deletes a pet
+ #
+ # @param pet_id [Integer] Pet id to delete
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :api_key
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_pet_with_http_info(pet_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...'
+ end
+ # verify the required parameter 'pet_id' is set
+ if @api_client.config.client_side_validation && pet_id.nil?
+ fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet"
+ end
+ # resource path
+ local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ header_params['api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil?
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.delete_pet",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Finds Pets by status
+ # Multiple status values can be provided with comma separated strings
+ # @param status [Array] Status values that need to be considered for filter
+ # @param [Hash] opts the optional parameters
+ # @return [Array]
+ def find_pets_by_status(status, opts = {})
+ data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts)
+ data
+ end
+
+ # Finds Pets by status
+ # Multiple status values can be provided with comma separated strings
+ # @param status [Array] Status values that need to be considered for filter
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def find_pets_by_status_with_http_info(status, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...'
+ end
+ # verify the required parameter 'status' is set
+ if @api_client.config.client_side_validation && status.nil?
+ fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status"
+ end
+ # resource path
+ local_var_path = '/pet/findByStatus'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'status'] = @api_client.build_collection_param(status, :csv)
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.find_pets_by_status",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Finds Pets by tags
+ # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ # @param tags [Array] Tags to filter by
+ # @param [Hash] opts the optional parameters
+ # @return [Array]
+ def find_pets_by_tags(tags, opts = {})
+ data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts)
+ data
+ end
+
+ # Finds Pets by tags
+ # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ # @param tags [Array] Tags to filter by
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
+ def find_pets_by_tags_with_http_info(tags, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...'
+ end
+ # verify the required parameter 'tags' is set
+ if @api_client.config.client_side_validation && tags.nil?
+ fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags"
+ end
+ # resource path
+ local_var_path = '/pet/findByTags'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'tags'] = @api_client.build_collection_param(tags, :csv)
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Array'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.find_pets_by_tags",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Find pet by ID
+ # Returns a single pet
+ # @param pet_id [Integer] ID of pet to return
+ # @param [Hash] opts the optional parameters
+ # @return [Pet]
+ def get_pet_by_id(pet_id, opts = {})
+ data, _status_code, _headers = get_pet_by_id_with_http_info(pet_id, opts)
+ data
+ end
+
+ # Find pet by ID
+ # Returns a single pet
+ # @param pet_id [Integer] ID of pet to return
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers
+ def get_pet_by_id_with_http_info(pet_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...'
+ end
+ # verify the required parameter 'pet_id' is set
+ if @api_client.config.client_side_validation && pet_id.nil?
+ fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id"
+ end
+ # resource path
+ local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Pet'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['api_key']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.get_pet_by_id",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Update an existing pet
+ #
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_pet(pet, opts = {})
+ update_pet_with_http_info(pet, opts)
+ nil
+ end
+
+ # Update an existing pet
+ #
+ # @param pet [Pet] Pet object that needs to be added to the store
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_pet_with_http_info(pet, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...'
+ end
+ # verify the required parameter 'pet' is set
+ if @api_client.config.client_side_validation && pet.nil?
+ fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet"
+ end
+ # resource path
+ local_var_path = '/pet'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json', 'application/xml'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pet)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.update_pet",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Updates a pet in the store with form data
+ #
+ # @param pet_id [Integer] ID of pet that needs to be updated
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :name Updated name of the pet
+ # @option opts [String] :status Updated status of the pet
+ # @return [nil]
+ def update_pet_with_form(pet_id, opts = {})
+ update_pet_with_form_with_http_info(pet_id, opts)
+ nil
+ end
+
+ # Updates a pet in the store with form data
+ #
+ # @param pet_id [Integer] ID of pet that needs to be updated
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :name Updated name of the pet
+ # @option opts [String] :status Updated status of the pet
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_pet_with_form_with_http_info(pet_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...'
+ end
+ # verify the required parameter 'pet_id' is set
+ if @api_client.config.client_side_validation && pet_id.nil?
+ fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form"
+ end
+ # resource path
+ local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
+ form_params['status'] = opts[:'status'] if !opts[:'status'].nil?
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.update_pet_with_form",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # uploads an image
+ #
+ # @param pet_id [Integer] ID of pet to update
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :additional_metadata Additional data to pass to server
+ # @option opts [File] :file file to upload
+ # @return [ApiResponse]
+ def upload_file(pet_id, opts = {})
+ data, _status_code, _headers = upload_file_with_http_info(pet_id, opts)
+ data
+ end
+
+ # uploads an image
+ #
+ # @param pet_id [Integer] ID of pet to update
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :additional_metadata Additional data to pass to server
+ # @option opts [File] :file file to upload
+ # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers
+ def upload_file_with_http_info(pet_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...'
+ end
+ # verify the required parameter 'pet_id' is set
+ if @api_client.config.client_side_validation && pet_id.nil?
+ fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file"
+ end
+ # resource path
+ local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil?
+ form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'ApiResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.upload_file",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # uploads an image (required)
+ #
+ # @param pet_id [Integer] ID of pet to update
+ # @param required_file [File] file to upload
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :additional_metadata Additional data to pass to server
+ # @return [ApiResponse]
+ def upload_file_with_required_file(pet_id, required_file, opts = {})
+ data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts)
+ data
+ end
+
+ # uploads an image (required)
+ #
+ # @param pet_id [Integer] ID of pet to update
+ # @param required_file [File] file to upload
+ # @param [Hash] opts the optional parameters
+ # @option opts [String] :additional_metadata Additional data to pass to server
+ # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers
+ def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...'
+ end
+ # verify the required parameter 'pet_id' is set
+ if @api_client.config.client_side_validation && pet_id.nil?
+ fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file"
+ end
+ # verify the required parameter 'required_file' is set
+ if @api_client.config.client_side_validation && required_file.nil?
+ fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file"
+ end
+ # resource path
+ local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+ form_params['requiredFile'] = required_file
+ form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil?
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'ApiResponse'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['petstore_auth']
+
+ new_options = opts.merge(
+ :operation => :"PetApi.upload_file_with_required_file",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb
new file mode 100644
index 00000000000..df4f0c3f7e8
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/store_api.rb
@@ -0,0 +1,279 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class StoreApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Delete purchase order by ID
+ # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ # @param order_id [String] ID of the order that needs to be deleted
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_order(order_id, opts = {})
+ delete_order_with_http_info(order_id, opts)
+ nil
+ end
+
+ # Delete purchase order by ID
+ # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ # @param order_id [String] ID of the order that needs to be deleted
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_order_with_http_info(order_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...'
+ end
+ # verify the required parameter 'order_id' is set
+ if @api_client.config.client_side_validation && order_id.nil?
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order"
+ end
+ # resource path
+ local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"StoreApi.delete_order",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Returns pet inventories by status
+ # Returns a map of status codes to quantities
+ # @param [Hash] opts the optional parameters
+ # @return [Hash]
+ def get_inventory(opts = {})
+ data, _status_code, _headers = get_inventory_with_http_info(opts)
+ data
+ end
+
+ # Returns pet inventories by status
+ # Returns a map of status codes to quantities
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers
+ def get_inventory_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...'
+ end
+ # resource path
+ local_var_path = '/store/inventory'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Hash'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || ['api_key']
+
+ new_options = opts.merge(
+ :operation => :"StoreApi.get_inventory",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Find purchase order by ID
+ # For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+ # @param order_id [Integer] ID of pet that needs to be fetched
+ # @param [Hash] opts the optional parameters
+ # @return [Order]
+ def get_order_by_id(order_id, opts = {})
+ data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts)
+ data
+ end
+
+ # Find purchase order by ID
+ # For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+ # @param order_id [Integer] ID of pet that needs to be fetched
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers
+ def get_order_by_id_with_http_info(order_id, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...'
+ end
+ # verify the required parameter 'order_id' is set
+ if @api_client.config.client_side_validation && order_id.nil?
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id"
+ end
+ if @api_client.config.client_side_validation && order_id > 5
+ fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.'
+ end
+
+ if @api_client.config.client_side_validation && order_id < 1
+ fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.'
+ end
+
+ # resource path
+ local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Order'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"StoreApi.get_order_by_id",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Place an order for a pet
+ #
+ # @param order [Order] order placed for purchasing the pet
+ # @param [Hash] opts the optional parameters
+ # @return [Order]
+ def place_order(order, opts = {})
+ data, _status_code, _headers = place_order_with_http_info(order, opts)
+ data
+ end
+
+ # Place an order for a pet
+ #
+ # @param order [Order] order placed for purchasing the pet
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers
+ def place_order_with_http_info(order, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...'
+ end
+ # verify the required parameter 'order' is set
+ if @api_client.config.client_side_validation && order.nil?
+ fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order"
+ end
+ # resource path
+ local_var_path = '/store/order'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(order)
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'Order'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"StoreApi.place_order",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb
new file mode 100644
index 00000000000..9c4d48a9605
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api/user_api.rb
@@ -0,0 +1,542 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'cgi'
+
+module Petstore
+ class UserApi
+ attr_accessor :api_client
+
+ def initialize(api_client = ApiClient.default)
+ @api_client = api_client
+ end
+ # Create user
+ # This can only be done by the logged in user.
+ # @param user [User] Created user object
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def create_user(user, opts = {})
+ create_user_with_http_info(user, opts)
+ nil
+ end
+
+ # Create user
+ # This can only be done by the logged in user.
+ # @param user [User] Created user object
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def create_user_with_http_info(user, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.create_user ...'
+ end
+ # verify the required parameter 'user' is set
+ if @api_client.config.client_side_validation && user.nil?
+ fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user"
+ end
+ # resource path
+ local_var_path = '/user'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.create_user",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Creates list of users with given input array
+ #
+ # @param user [Array] List of user object
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def create_users_with_array_input(user, opts = {})
+ create_users_with_array_input_with_http_info(user, opts)
+ nil
+ end
+
+ # Creates list of users with given input array
+ #
+ # @param user [Array] List of user object
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def create_users_with_array_input_with_http_info(user, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...'
+ end
+ # verify the required parameter 'user' is set
+ if @api_client.config.client_side_validation && user.nil?
+ fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input"
+ end
+ # resource path
+ local_var_path = '/user/createWithArray'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.create_users_with_array_input",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Creates list of users with given input array
+ #
+ # @param user [Array] List of user object
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def create_users_with_list_input(user, opts = {})
+ create_users_with_list_input_with_http_info(user, opts)
+ nil
+ end
+
+ # Creates list of users with given input array
+ #
+ # @param user [Array] List of user object
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def create_users_with_list_input_with_http_info(user, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...'
+ end
+ # verify the required parameter 'user' is set
+ if @api_client.config.client_side_validation && user.nil?
+ fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input"
+ end
+ # resource path
+ local_var_path = '/user/createWithList'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.create_users_with_list_input",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Delete user
+ # This can only be done by the logged in user.
+ # @param username [String] The name that needs to be deleted
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def delete_user(username, opts = {})
+ delete_user_with_http_info(username, opts)
+ nil
+ end
+
+ # Delete user
+ # This can only be done by the logged in user.
+ # @param username [String] The name that needs to be deleted
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def delete_user_with_http_info(username, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...'
+ end
+ # verify the required parameter 'username' is set
+ if @api_client.config.client_side_validation && username.nil?
+ fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user"
+ end
+ # resource path
+ local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.delete_user",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Get user by user name
+ #
+ # @param username [String] The name that needs to be fetched. Use user1 for testing.
+ # @param [Hash] opts the optional parameters
+ # @return [User]
+ def get_user_by_name(username, opts = {})
+ data, _status_code, _headers = get_user_by_name_with_http_info(username, opts)
+ data
+ end
+
+ # Get user by user name
+ #
+ # @param username [String] The name that needs to be fetched. Use user1 for testing.
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
+ def get_user_by_name_with_http_info(username, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...'
+ end
+ # verify the required parameter 'username' is set
+ if @api_client.config.client_side_validation && username.nil?
+ fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name"
+ end
+ # resource path
+ local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'User'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.get_user_by_name",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Logs user into the system
+ #
+ # @param username [String] The user name for login
+ # @param password [String] The password for login in clear text
+ # @param [Hash] opts the optional parameters
+ # @return [String]
+ def login_user(username, password, opts = {})
+ data, _status_code, _headers = login_user_with_http_info(username, password, opts)
+ data
+ end
+
+ # Logs user into the system
+ #
+ # @param username [String] The user name for login
+ # @param password [String] The password for login in clear text
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
+ def login_user_with_http_info(username, password, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.login_user ...'
+ end
+ # verify the required parameter 'username' is set
+ if @api_client.config.client_side_validation && username.nil?
+ fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.login_user"
+ end
+ # verify the required parameter 'password' is set
+ if @api_client.config.client_side_validation && password.nil?
+ fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user"
+ end
+ # resource path
+ local_var_path = '/user/login'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+ query_params[:'username'] = username
+ query_params[:'password'] = password
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json'])
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type] || 'String'
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.login_user",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Logs out current logged in user session
+ #
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def logout_user(opts = {})
+ logout_user_with_http_info(opts)
+ nil
+ end
+
+ # Logs out current logged in user session
+ #
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def logout_user_with_http_info(opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...'
+ end
+ # resource path
+ local_var_path = '/user/logout'
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body]
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.logout_user",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+
+ # Updated user
+ # This can only be done by the logged in user.
+ # @param username [String] name that need to be deleted
+ # @param user [User] Updated user object
+ # @param [Hash] opts the optional parameters
+ # @return [nil]
+ def update_user(username, user, opts = {})
+ update_user_with_http_info(username, user, opts)
+ nil
+ end
+
+ # Updated user
+ # This can only be done by the logged in user.
+ # @param username [String] name that need to be deleted
+ # @param user [User] Updated user object
+ # @param [Hash] opts the optional parameters
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
+ def update_user_with_http_info(username, user, opts = {})
+ if @api_client.config.debugging
+ @api_client.config.logger.debug 'Calling API: UserApi.update_user ...'
+ end
+ # verify the required parameter 'username' is set
+ if @api_client.config.client_side_validation && username.nil?
+ fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user"
+ end
+ # verify the required parameter 'user' is set
+ if @api_client.config.client_side_validation && user.nil?
+ fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user"
+ end
+ # resource path
+ local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s))
+
+ # query parameters
+ query_params = opts[:query_params] || {}
+
+ # header parameters
+ header_params = opts[:header_params] || {}
+ # HTTP header 'Content-Type'
+ content_type = @api_client.select_header_content_type(['application/json'])
+ if !content_type.nil?
+ header_params['Content-Type'] = content_type
+ end
+
+ # form parameters
+ form_params = opts[:form_params] || {}
+
+ # http body (model)
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
+
+ # return_type
+ return_type = opts[:debug_return_type]
+
+ # auth_names
+ auth_names = opts[:debug_auth_names] || []
+
+ new_options = opts.merge(
+ :operation => :"UserApi.update_user",
+ :header_params => header_params,
+ :query_params => query_params,
+ :form_params => form_params,
+ :body => post_body,
+ :auth_names => auth_names,
+ :return_type => return_type
+ )
+
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
+ if @api_client.config.debugging
+ @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
+ end
+ return data, status_code, headers
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb
new file mode 100644
index 00000000000..8b688192ef1
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb
@@ -0,0 +1,375 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'json'
+require 'logger'
+require 'tempfile'
+require 'time'
+require 'httpx'
+require 'net/http/status'
+
+
+module Petstore
+ class ApiClient
+ # The Configuration object holding settings to be used in the API client.
+ attr_accessor :config
+
+ # Defines the headers to be used in HTTP requests of all API calls by default.
+ #
+ # @return [Hash]
+ attr_accessor :default_headers
+
+ # Initializes the ApiClient
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
+ def initialize(config = Configuration.default)
+ @config = config
+ @user_agent = "OpenAPI-Generator/#{VERSION}/ruby"
+ @default_headers = {
+ 'Content-Type' => 'application/json',
+ 'User-Agent' => @user_agent
+ }
+ end
+
+ def self.default
+ @@default ||= ApiClient.new
+ end
+
+ # Call an API with given options.
+ #
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
+ # the data deserialized from response body (could be nil), response status code and response headers.
+ def call_api(http_method, path, opts = {})
+ begin
+ response = build_request(http_method.to_s, path, opts)
+
+ if config.debugging
+ config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
+ end
+
+ response.raise_for_status
+
+ rescue HTTPX::HTTPError
+ fail ApiError.new(code: response.status,
+ response_headers: response.headers.to_h,
+ response_body: response.body.to_s),
+ Net::HTTP::STATUS_CODES.fetch(response.status, "HTTP Error (#{response.status})")
+ rescue HTTPX::TimeoutError
+ fail ApiError.new('Connection timed out')
+ rescue HTTPX::ConnectionError
+ fail ApiError.new('Connection failed')
+ end
+
+ if opts[:return_type]
+ data = deserialize(response, opts[:return_type])
+ else
+ data = nil
+ end
+ return data, response.status, response.headers.to_h
+ end
+
+ # Builds the HTTP request
+ #
+ # @param [String] http_method HTTP method/verb (e.g. POST)
+ # @param [String] path URL path (e.g. /account/new)
+ # @option opts [Hash] :header_params Header parameters
+ # @option opts [Hash] :query_params Query parameters
+ # @option opts [Hash] :form_params Query parameters
+ # @option opts [Object] :body HTTP body (JSON/XML)
+ # @return [HTTPX::Request] A Request object
+ def build_request(http_method, path, opts = {})
+ url = build_request_url(path, opts)
+
+ header_params = @default_headers.merge(opts[:header_params] || {})
+ query_params = opts[:query_params] || {}
+ form_params = opts[:form_params] || {}
+
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
+
+ if %w[POST PATCH PUT DELETE].include?(http_method)
+ body_params = build_request_body(header_params, form_params, opts[:body])
+ if config.debugging
+ config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
+ end
+ else
+ body_params = {}
+ end
+ req_opts = {
+ :headers => HTTPX::Headers.new(header_params),
+ **body_params
+ }
+ req_opts[:params] = query_params if query_params && !query_params.empty?
+ session.request(http_method, url, **req_opts)
+ end
+
+ # Builds the HTTP request body
+ #
+ # @param [Hash] header_params Header parameters
+ # @param [Hash] form_params Query parameters
+ # @param [Object] body HTTP body (JSON/XML)
+ # @return [Hash{Symbol => Object}] body options as HTTPX handles them
+ def build_request_body(header_params, form_params, body)
+ # http form
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
+ header_params['Content-Type'] == 'multipart/form-data'
+ data = { form: form_params }
+ elsif body
+
+ data = body.is_a?(String) ? { body: body } : { json: body }
+ else
+ data = nil
+ end
+ data
+ end
+
+ def session
+ return @session if defined?(@session)
+
+ session = HTTPX.with(
+ ssl: @config.ssl,
+ timeout: ({ request_timeout: @config.timeout } if @config.timeout && @config.timeout.positive?),
+ origin: "#{@config.scheme}://#{@config.host}",
+ base_path: (@config.base_path.sub(/\/+\z/, '') if @config.base_path)
+ )
+
+ if @config.proxy
+ session = session.plugin(:proxy, proxy: @config.proxy)
+ end
+
+ if @config.username && @config.password
+ session = session.plugin(:basic_auth).basic_auth(@config.username, @config.password)
+ end
+
+ session = @config.configure(session)
+
+ @session = session
+
+ end
+
+ # Check if the given MIME is a JSON MIME.
+ # JSON MIME examples:
+ # application/json
+ # application/json; charset=UTF8
+ # APPLICATION/JSON
+ # */*
+ # @param [String] mime MIME
+ # @return [Boolean] True if the MIME is application/json
+ def json_mime?(mime)
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
+ end
+
+ # Deserialize the response to the given return type.
+ #
+ # @param [Response] response HTTP response
+ # @param [String] return_type some examples: "User", "Array", "Hash"
+ def deserialize(response, return_type)
+ body = response.body
+
+ # handle file downloading - return the File instance processed in request callbacks
+ # note that response body is empty when the file is written in chunks in request on_body callback
+ if return_type == 'File'
+ if @config.return_binary_data == true
+ # TODO: force response encoding
+ return body.to_s
+ else
+ content_disposition = response.headers['content-disposition']
+ if content_disposition && content_disposition =~ /filename=/i
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
+ prefix = sanitize_filename(filename)
+ else
+ prefix = 'download-'
+ end
+ prefix = prefix + '-' unless prefix.end_with?('-')
+ encoding = response.body.encoding
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
+ response.copy_to(tempfile)
+ tempfile.close
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
+ "explicitly with `tempfile.delete`"
+
+ return tempfile
+ end
+ end
+
+ return nil if body.nil? || body.empty?
+
+ # return response body directly for String return type
+ return body.to_s if return_type == 'String'
+
+ # ensuring a default content type
+ content_type = response.headers['Content-Type'] || 'application/json'
+
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
+
+ begin
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
+ rescue JSON::ParserError => e
+ if %w(String Date Time).include?(return_type)
+ data = body
+ else
+ raise e
+ end
+ end
+
+ convert_to_type data, return_type
+ end
+
+ # Convert data to the given return type.
+ # @param [Object] data Data to be converted
+ # @param [String] return_type Return type
+ # @return [Mixed] Data in a particular type
+ def convert_to_type(data, return_type)
+ return nil if data.nil?
+ case return_type
+ when 'String'
+ data.to_s
+ when 'Integer'
+ data.to_i
+ when 'Float'
+ data.to_f
+ when 'Boolean'
+ data == true
+ when 'Time'
+ # parse date time (expecting ISO 8601 format)
+ Time.parse data
+ when 'Date'
+ # parse date time (expecting ISO 8601 format)
+ Date.parse data
+ when 'Object'
+ # generic object (usually a Hash), return directly
+ data
+ when /\AArray<(.+)>\z/
+ # e.g. Array
+ sub_type = $1
+ data.map { |item| convert_to_type(item, sub_type) }
+ when /\AHash\\z/
+ # e.g. Hash
+ sub_type = $1
+ {}.tap do |hash|
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
+ end
+ else
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(return_type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
+ end
+ end
+
+ # Sanitize filename by removing path.
+ # e.g. ../../sun.gif becomes sun.gif
+ #
+ # @param [String] filename the filename to be sanitized
+ # @return [String] the sanitized filename
+ def sanitize_filename(filename)
+ filename.gsub(/.*[\/\\]/, '')
+ end
+
+ def build_request_url(path, opts = {})
+ # Add leading and trailing slashes to path
+ path = "/#{path}".gsub(/\/+/, '/')
+ @config.base_url(opts[:operation]) + path
+ end
+
+ # Update header and query params based on authentication settings.
+ #
+ # @param [Hash] header_params Header parameters
+ # @param [Hash] query_params Query parameters
+ # @param [String] auth_names Authentication scheme name
+ def update_params_for_auth!(header_params, query_params, auth_names)
+ Array(auth_names).each do |auth_name|
+ auth_setting = @config.auth_settings[auth_name]
+ next unless auth_setting
+ case auth_setting[:in]
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
+ else fail ArgumentError, 'Authentication token must be in `query` or `header`'
+ end
+ end
+ end
+
+ # Sets user agent in HTTP header
+ #
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
+ def user_agent=(user_agent)
+ @user_agent = user_agent
+ @default_headers['User-Agent'] = @user_agent
+ end
+
+ # Return Accept header based on an array of accepts provided.
+ # @param [Array] accepts array for Accept
+ # @return [String] the Accept header (e.g. application/json)
+ def select_header_accept(accepts)
+ return nil if accepts.nil? || accepts.empty?
+ # use JSON when present, otherwise use all of the provided
+ json_accept = accepts.find { |s| json_mime?(s) }
+ json_accept || accepts.join(',')
+ end
+
+ # Return Content-Type header based on an array of content types provided.
+ # @param [Array] content_types array for Content-Type
+ # @return [String] the Content-Type header (e.g. application/json)
+ def select_header_content_type(content_types)
+ # return nil by default
+ return if content_types.nil? || content_types.empty?
+ # use JSON when present, otherwise use the first one
+ json_content_type = content_types.find { |s| json_mime?(s) }
+ json_content_type || content_types.first
+ end
+
+ # Convert object (array, hash, object, etc) to JSON string.
+ # @param [Object] model object to be converted into JSON string
+ # @return [String] JSON string representation of the object
+ def object_to_http_body(model)
+ return model if model.nil? || model.is_a?(String)
+ local_body = nil
+ if model.is_a?(Array)
+ local_body = model.map { |m| object_to_hash(m) }
+ else
+ local_body = object_to_hash(model)
+ end
+ local_body.to_json
+ end
+
+ # Convert object(non-array) to hash.
+ # @param [Object] obj object to be converted into JSON string
+ # @return [String] JSON string representation of the object
+ def object_to_hash(obj)
+ if obj.respond_to?(:to_hash)
+ obj.to_hash
+ else
+ obj
+ end
+ end
+
+ # Build parameter value according to the given collection format.
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
+ def build_collection_param(param, collection_format)
+ case collection_format
+ when :csv
+ param.join(',')
+ when :ssv
+ param.join(' ')
+ when :tsv
+ param.join("\t")
+ when :pipes
+ param.join('|')
+ when :multi
+ # return the array directly as typhoeus will handle it as expected
+ param
+ else
+ fail "unknown collection format: #{collection_format.inspect}"
+ end
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api_error.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api_error.rb
new file mode 100644
index 00000000000..e220ece388a
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/api_error.rb
@@ -0,0 +1,58 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+module Petstore
+ class ApiError < StandardError
+ attr_reader :code, :response_headers, :response_body
+
+ # Usage examples:
+ # ApiError.new
+ # ApiError.new("message")
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
+ # ApiError.new(:code => 404, :message => "Not Found")
+ def initialize(arg = nil)
+ if arg.is_a? Hash
+ if arg.key?(:message) || arg.key?('message')
+ super(arg[:message] || arg['message'])
+ else
+ super arg
+ end
+
+ arg.each do |k, v|
+ instance_variable_set "@#{k}", v
+ end
+ else
+ super arg
+ @message = arg
+ end
+ end
+
+ # Override to_s to display a friendly error message
+ def to_s
+ message
+ end
+
+ def message
+ if @message.nil?
+ msg = "Error message: the server returns an error"
+ else
+ msg = @message
+ end
+
+ msg += "\nHTTP status code: #{code}" if code
+ msg += "\nResponse headers: #{response_headers}" if response_headers
+ msg += "\nResponse body: #{response_body}" if response_body
+
+ msg
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb
new file mode 100644
index 00000000000..debb792f26c
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/configuration.rb
@@ -0,0 +1,417 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+module Petstore
+ class Configuration
+ # Defines url scheme
+ attr_accessor :scheme
+
+ # Defines url host
+ attr_accessor :host
+
+ # Defines url base path
+ attr_accessor :base_path
+
+ # Define server configuration index
+ attr_accessor :server_index
+
+ # Define server operation configuration index
+ attr_accessor :server_operation_index
+
+ # Default server variables
+ attr_accessor :server_variables
+
+ # Default server operation variables
+ attr_accessor :server_operation_variables
+
+ # Defines API keys used with API Key authentications.
+ #
+ # @return [Hash] key: parameter name, value: parameter value (API key)
+ #
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
+ # config.api_key['api_key'] = 'xxx'
+ attr_accessor :api_key
+
+ # Defines API key prefixes used with API Key authentications.
+ #
+ # @return [Hash] key: parameter name, value: API key prefix
+ #
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
+ # config.api_key_prefix['api_key'] = 'Token'
+ attr_accessor :api_key_prefix
+
+ # Defines the username used with HTTP basic authentication.
+ #
+ # @return [String]
+ attr_accessor :username
+
+ # Defines the password used with HTTP basic authentication.
+ #
+ # @return [String]
+ attr_accessor :password
+
+ # 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.
+ #
+ # @return [true, false]
+ attr_accessor :debugging
+
+ # Defines the logger used for debugging.
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
+ #
+ # @return [#debug]
+ attr_accessor :logger
+
+ # Defines the temporary folder to store downloaded files
+ # (for API endpoints that have file response).
+ # Default to use `Tempfile`.
+ #
+ # @return [String]
+ attr_accessor :temp_folder_path
+
+ # The time limit for HTTP request in seconds.
+ # Default to 0 (never times out).
+ attr_accessor :timeout
+
+ # Set this to false to skip client side validation in the operation.
+ # Default to true.
+ # @return [true, false]
+ attr_accessor :client_side_validation
+
+ ### TLS/SSL setting
+ # You can use this to customize SSL Context settings (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html
+ # to know which ones).
+ #
+ # @return [Hash{Symbol => Object}, OpenSSL::SSL::SSLContext, nil]
+ attr_accessor :ssl
+
+ ### Proxy setting
+ # HTTP Proxy settings (see https://honeyryderchuck.gitlab.io/httpx/wiki/Proxy#options)
+ # @return [Hash{Symbol => Object}, nil]
+ attr_accessor :proxy
+
+
+ attr_accessor :inject_format
+
+ attr_accessor :force_ending_format
+
+ def initialize
+ @scheme = 'http'
+ @host = 'petstore.swagger.io'
+ @base_path = '/v2'
+ @server_index = nil
+ @server_operation_index = {}
+ @server_variables = {}
+ @server_operation_variables = {}
+ @api_key = {}
+ @api_key_prefix = {}
+ @client_side_validation = true
+ @ssl = nil
+ @proxy = nil
+ @timeout = 60
+ @configure_session_blocks = []
+ @debugging = false
+ @inject_format = false
+ @force_ending_format = false
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
+
+ yield(self) if block_given?
+ end
+
+ # The default Configuration object.
+ def self.default
+ @@default ||= Configuration.new
+ end
+
+ def configure
+ yield(self) if block_given?
+ end
+
+ def scheme=(scheme)
+ # remove :// from scheme
+ @scheme = scheme.sub(/:\/\//, '')
+ end
+
+ def host=(host)
+ # remove http(s):// and anything after a slash
+ @host = host.sub(/https?:\/\//, '').split('/').first
+ end
+
+ def base_path=(base_path)
+ # Add leading and trailing slashes to base_path
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
+ @base_path = '' if @base_path == '/'
+ end
+
+ # Returns base URL for specified operation based on server settings
+ def base_url(operation = nil)
+ if operation_server_settings.key?(operation) then
+ index = server_operation_index.fetch(operation, server_index)
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
+ else
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
+ end
+ end
+
+ # Gets API key (with prefix if set).
+ # @param [String] param_name the parameter name of API key auth
+ def api_key_with_prefix(param_name, param_alias = nil)
+ key = @api_key[param_name]
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
+ if @api_key_prefix[param_name]
+ "#{@api_key_prefix[param_name]} #{key}"
+ else
+ key
+ 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")
+ end
+
+ # Returns Auth Settings hash for api client.
+ def auth_settings
+ {
+ 'petstore_auth' =>
+ {
+ type: 'oauth2',
+ in: 'header',
+ key: 'Authorization',
+ value: "Bearer #{access_token_with_refresh}"
+ },
+ 'api_key' =>
+ {
+ type: 'api_key',
+ in: 'header',
+ key: 'api_key',
+ value: api_key_with_prefix('api_key')
+ },
+ 'api_key_query' =>
+ {
+ type: 'api_key',
+ in: 'query',
+ key: 'api_key_query',
+ value: api_key_with_prefix('api_key_query')
+ },
+ 'http_basic_test' =>
+ {
+ type: 'basic',
+ in: 'header',
+ key: 'Authorization',
+ value: basic_auth_token
+ },
+ 'bearer_test' =>
+ {
+ type: 'bearer',
+ in: 'header',
+ format: 'JWT',
+ key: 'Authorization',
+ value: "Bearer #{access_token_with_refresh}"
+ },
+ }
+ end
+
+ # Returns an array of Server setting
+ def server_settings
+ [
+ {
+ url: "http://{server}.swagger.io:{port}/v2",
+ description: "petstore server",
+ variables: {
+ server: {
+ description: "No description provided",
+ default_value: "petstore",
+ enum_values: [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ port: {
+ description: "No description provided",
+ default_value: "80",
+ enum_values: [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ },
+ {
+ url: "https://localhost:8080/{version}",
+ description: "The local server",
+ variables: {
+ version: {
+ description: "No description provided",
+ default_value: "v2",
+ enum_values: [
+ "v1",
+ "v2"
+ ]
+ }
+ }
+ },
+ {
+ url: "https://127.0.0.1/no_varaible",
+ description: "The local server without variables",
+ }
+ ]
+ end
+
+ def operation_server_settings
+ {
+ "PetApi.add_pet": [
+ {
+ url: "http://petstore.swagger.io/v2",
+ description: "No description provided",
+ },
+ {
+ url: "http://path-server-test.petstore.local/v2",
+ description: "No description provided",
+ },
+ {
+ url: "http://{server}.swagger.io:{port}/v2",
+ description: "test server with variables",
+ variables: {
+ server: {
+ description: "target server",
+ default_value: "petstore",
+ enum_values: [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ port: {
+ description: "No description provided",
+ default_value: "80",
+ enum_values: [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ }
+ ],
+ "PetApi.update_pet": [
+ {
+ url: "http://petstore.swagger.io/v2",
+ description: "No description provided",
+ },
+ {
+ url: "http://path-server-test.petstore.local/v2",
+ description: "No description provided",
+ },
+ {
+ url: "http://{server}.swagger.io:{port}/v2",
+ description: "test server with variables",
+ variables: {
+ server: {
+ description: "target server",
+ default_value: "petstore",
+ enum_values: [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ port: {
+ description: "No description provided",
+ default_value: "80",
+ enum_values: [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ }
+ ],
+ }
+ end
+
+ # Returns URL based on server settings
+ #
+ # @param index array index of the server settings
+ # @param variables hash of variable and the corresponding value
+ def server_url(index, variables = {}, servers = nil)
+ servers = server_settings if servers == nil
+
+ # check array index out of bound
+ if (index.nil? || index < 0 || index >= servers.size)
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
+ end
+
+ server = servers[index]
+ url = server[:url]
+
+ return url unless server.key? :variables
+
+ # go through variable and assign a value
+ server[:variables].each do |name, variable|
+ if variables.key?(name)
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
+ url.gsub! "{" + name.to_s + "}", variables[name]
+ else
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
+ end
+ else
+ # use default value
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
+ end
+ end
+
+ url
+ end
+
+
+ # Configure Httpx session directly.
+ #
+ # ```
+ # c.configure_session do |http|
+ # http.plugin(:follow_redirects).with(debug: STDOUT, debug_level: 1)
+ # end
+ # ```
+ #
+ # @param block [Proc] `#call`able object that takes one arg, the connection
+ def configure_session(&block)
+ @configure_session_blocks << block
+ end
+
+
+ def configure(session)
+ @configure_session_blocks.reduce(session) do |configured_sess, block|
+ block.call(configured_sess)
+ end
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/additional_properties_class.rb
new file mode 100644
index 00000000000..c28fba75cbf
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/additional_properties_class.rb
@@ -0,0 +1,227 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class AdditionalPropertiesClass
+ attr_accessor :map_property
+
+ attr_accessor :map_of_map_property
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'map_property' => :'map_property',
+ :'map_of_map_property' => :'map_of_map_property'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'map_property' => :'Hash',
+ :'map_of_map_property' => :'Hash>'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesClass` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'map_property')
+ if (value = attributes[:'map_property']).is_a?(Hash)
+ self.map_property = value
+ end
+ end
+
+ if attributes.key?(:'map_of_map_property')
+ if (value = attributes[:'map_of_map_property']).is_a?(Hash)
+ self.map_of_map_property = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ map_property == o.map_property &&
+ map_of_map_property == o.map_of_map_property
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [map_property, map_of_map_property].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/all_of_with_single_ref.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/all_of_with_single_ref.rb
new file mode 100644
index 00000000000..99c49ee3e41
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/all_of_with_single_ref.rb
@@ -0,0 +1,245 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class AllOfWithSingleRef
+ attr_accessor :username
+
+ attr_accessor :single_ref_type
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'username' => :'username',
+ :'single_ref_type' => :'SingleRefType'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'username' => :'String',
+ :'single_ref_type' => :'SingleRefType'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AllOfWithSingleRef` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AllOfWithSingleRef`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'username')
+ self.username = attributes[:'username']
+ end
+
+ if attributes.key?(:'single_ref_type')
+ self.single_ref_type = attributes[:'single_ref_type']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ username == o.username &&
+ single_ref_type == o.single_ref_type
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [username, single_ref_type].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/animal.rb
new file mode 100644
index 00000000000..38c3e4ae50c
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/animal.rb
@@ -0,0 +1,237 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Animal
+ attr_accessor :class_name
+
+ attr_accessor :color
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'class_name' => :'className',
+ :'color' => :'color'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'class_name' => :'String',
+ :'color' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # discriminator's property name in OpenAPI v3
+ def self.openapi_discriminator_name
+ :'class_name'
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Animal` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'class_name')
+ self.class_name = attributes[:'class_name']
+ else
+ self.class_name = nil
+ end
+
+ if attributes.key?(:'color')
+ self.color = attributes[:'color']
+ else
+ self.color = 'red'
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @class_name.nil?
+ invalid_properties.push('invalid value for "class_name", class_name cannot be nil.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @class_name.nil?
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ class_name == o.class_name &&
+ color == o.color
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [class_name, color].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/api_response.rb
new file mode 100644
index 00000000000..3f05081ca8f
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/api_response.rb
@@ -0,0 +1,232 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class ApiResponse
+ attr_accessor :code
+
+ attr_accessor :type
+
+ attr_accessor :message
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'code' => :'code',
+ :'type' => :'type',
+ :'message' => :'message'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'code' => :'Integer',
+ :'type' => :'String',
+ :'message' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ApiResponse` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'code')
+ self.code = attributes[:'code']
+ end
+
+ if attributes.key?(:'type')
+ self.type = attributes[:'type']
+ end
+
+ if attributes.key?(:'message')
+ self.message = attributes[:'message']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ code == o.code &&
+ type == o.type &&
+ message == o.message
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [code, type, message].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_array_of_number_only.rb
new file mode 100644
index 00000000000..e3fc2196934
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_array_of_number_only.rb
@@ -0,0 +1,216 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class ArrayOfArrayOfNumberOnly
+ attr_accessor :array_array_number
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'array_array_number' => :'ArrayArrayNumber'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'array_array_number' => :'Array>'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfArrayOfNumberOnly` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'array_array_number')
+ if (value = attributes[:'array_array_number']).is_a?(Array)
+ self.array_array_number = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ array_array_number == o.array_array_number
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [array_array_number].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_number_only.rb
new file mode 100644
index 00000000000..c84931a3d2c
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_of_number_only.rb
@@ -0,0 +1,216 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class ArrayOfNumberOnly
+ attr_accessor :array_number
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'array_number' => :'ArrayNumber'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'array_number' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfNumberOnly` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'array_number')
+ if (value = attributes[:'array_number']).is_a?(Array)
+ self.array_number = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ array_number == o.array_number
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [array_number].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_test.rb
new file mode 100644
index 00000000000..3d4fe2a619b
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/array_test.rb
@@ -0,0 +1,266 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class ArrayTest
+ attr_accessor :array_of_string
+
+ attr_accessor :array_array_of_integer
+
+ attr_accessor :array_array_of_model
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'array_of_string' => :'array_of_string',
+ :'array_array_of_integer' => :'array_array_of_integer',
+ :'array_array_of_model' => :'array_array_of_model'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'array_of_string' => :'Array',
+ :'array_array_of_integer' => :'Array>',
+ :'array_array_of_model' => :'Array>'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayTest` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'array_of_string')
+ if (value = attributes[:'array_of_string']).is_a?(Array)
+ self.array_of_string = value
+ end
+ end
+
+ if attributes.key?(:'array_array_of_integer')
+ if (value = attributes[:'array_array_of_integer']).is_a?(Array)
+ self.array_array_of_integer = value
+ end
+ end
+
+ if attributes.key?(:'array_array_of_model')
+ if (value = attributes[:'array_array_of_model']).is_a?(Array)
+ self.array_array_of_model = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if !@array_of_string.nil? && @array_of_string.length > 3
+ invalid_properties.push('invalid value for "array_of_string", number of items must be less than or equal to 3.')
+ end
+
+ if !@array_of_string.nil? && @array_of_string.length < 0
+ invalid_properties.push('invalid value for "array_of_string", number of items must be greater than or equal to 0.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if !@array_of_string.nil? && @array_of_string.length > 3
+ return false if !@array_of_string.nil? && @array_of_string.length < 0
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] array_of_string Value to be assigned
+ def array_of_string=(array_of_string)
+ if array_of_string.nil?
+ fail ArgumentError, 'array_of_string cannot be nil'
+ end
+
+ if array_of_string.length > 3
+ fail ArgumentError, 'invalid value for "array_of_string", number of items must be less than or equal to 3.'
+ end
+
+ if array_of_string.length < 0
+ fail ArgumentError, 'invalid value for "array_of_string", number of items must be greater than or equal to 0.'
+ end
+
+ @array_of_string = array_of_string
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ array_of_string == o.array_of_string &&
+ array_array_of_integer == o.array_array_of_integer &&
+ array_array_of_model == o.array_array_of_model
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [array_of_string, array_array_of_integer, array_array_of_model].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/capitalization.rb
new file mode 100644
index 00000000000..535ca7697ba
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/capitalization.rb
@@ -0,0 +1,260 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Capitalization
+ attr_accessor :small_camel
+
+ attr_accessor :capital_camel
+
+ attr_accessor :small_snake
+
+ attr_accessor :capital_snake
+
+ attr_accessor :sca_eth_flow_points
+
+ # Name of the pet
+ attr_accessor :att_name
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'small_camel' => :'smallCamel',
+ :'capital_camel' => :'CapitalCamel',
+ :'small_snake' => :'small_Snake',
+ :'capital_snake' => :'Capital_Snake',
+ :'sca_eth_flow_points' => :'SCA_ETH_Flow_Points',
+ :'att_name' => :'ATT_NAME'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'small_camel' => :'String',
+ :'capital_camel' => :'String',
+ :'small_snake' => :'String',
+ :'capital_snake' => :'String',
+ :'sca_eth_flow_points' => :'String',
+ :'att_name' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Capitalization` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'small_camel')
+ self.small_camel = attributes[:'small_camel']
+ end
+
+ if attributes.key?(:'capital_camel')
+ self.capital_camel = attributes[:'capital_camel']
+ end
+
+ if attributes.key?(:'small_snake')
+ self.small_snake = attributes[:'small_snake']
+ end
+
+ if attributes.key?(:'capital_snake')
+ self.capital_snake = attributes[:'capital_snake']
+ end
+
+ if attributes.key?(:'sca_eth_flow_points')
+ self.sca_eth_flow_points = attributes[:'sca_eth_flow_points']
+ end
+
+ if attributes.key?(:'att_name')
+ self.att_name = attributes[:'att_name']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ small_camel == o.small_camel &&
+ capital_camel == o.capital_camel &&
+ small_snake == o.small_snake &&
+ capital_snake == o.capital_snake &&
+ sca_eth_flow_points == o.sca_eth_flow_points &&
+ att_name == o.att_name
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/cat.rb
new file mode 100644
index 00000000000..ddc6268f175
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/cat.rb
@@ -0,0 +1,225 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Cat < Animal
+ attr_accessor :declawed
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'declawed' => :'declawed'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
+ def self.acceptable_attributes
+ attribute_map.values.concat(superclass.acceptable_attributes)
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'declawed' => :'Boolean'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # List of class defined in allOf (OpenAPI v3)
+ def self.openapi_all_of
+ [
+ :'Animal'
+ ]
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Cat` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ # call parent's initialize
+ super(attributes)
+
+ if attributes.key?(:'declawed')
+ self.declawed = attributes[:'declawed']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = super
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true && super
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ declawed == o.declawed && super(o)
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [declawed].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ super(attributes)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = super
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/category.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/category.rb
new file mode 100644
index 00000000000..029ecca4bf6
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/category.rb
@@ -0,0 +1,230 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Category
+ attr_accessor :id
+
+ attr_accessor :name
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'id' => :'id',
+ :'name' => :'name'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'id' => :'Integer',
+ :'name' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Category` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'id')
+ self.id = attributes[:'id']
+ end
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ else
+ self.name = 'default-name'
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @name.nil?
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @name.nil?
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ id == o.id &&
+ name == o.name
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [id, name].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/child_with_nullable.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/child_with_nullable.rb
new file mode 100644
index 00000000000..a40a99e9b45
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/child_with_nullable.rb
@@ -0,0 +1,247 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class ChildWithNullable < ParentWithNullable
+ attr_accessor :other_property
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'other_property' => :'otherProperty'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
+ def self.acceptable_attributes
+ attribute_map.values.concat(superclass.acceptable_attributes)
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'other_property' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # List of class defined in allOf (OpenAPI v3)
+ def self.openapi_all_of
+ [
+ :'ParentWithNullable'
+ ]
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ChildWithNullable` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ChildWithNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ # call parent's initialize
+ super(attributes)
+
+ if attributes.key?(:'other_property')
+ self.other_property = attributes[:'other_property']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = super
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true && super
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ other_property == o.other_property && super(o)
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [other_property].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ super(attributes)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = super
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/class_model.rb
new file mode 100644
index 00000000000..a69c0c3d8b1
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/class_model.rb
@@ -0,0 +1,215 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Model for testing model with \"_class\" property
+ class ClassModel
+ attr_accessor :_class
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'_class' => :'_class'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'_class' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ClassModel` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'_class')
+ self._class = attributes[:'_class']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ _class == o._class
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [_class].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/client.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/client.rb
new file mode 100644
index 00000000000..d100b51d25e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/client.rb
@@ -0,0 +1,214 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Client
+ attr_accessor :client
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'client' => :'client'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'client' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Client` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'client')
+ self.client = attributes[:'client']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ client == o.client
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [client].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/deprecated_object.rb
new file mode 100644
index 00000000000..c13b9812ce8
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/deprecated_object.rb
@@ -0,0 +1,214 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class DeprecatedObject
+ attr_accessor :name
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'name' => :'name'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'name' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::DeprecatedObject` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DeprecatedObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ name == o.name
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [name].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/dog.rb
new file mode 100644
index 00000000000..baf8aed83ae
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/dog.rb
@@ -0,0 +1,225 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Dog < Animal
+ attr_accessor :breed
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'breed' => :'breed'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
+ def self.acceptable_attributes
+ attribute_map.values.concat(superclass.acceptable_attributes)
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'breed' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # List of class defined in allOf (OpenAPI v3)
+ def self.openapi_all_of
+ [
+ :'Animal'
+ ]
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Dog` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ # call parent's initialize
+ super(attributes)
+
+ if attributes.key?(:'breed')
+ self.breed = attributes[:'breed']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = super
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true && super
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ breed == o.breed && super(o)
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [breed].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ super(attributes)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = super
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_arrays.rb
new file mode 100644
index 00000000000..b53d022ccbe
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_arrays.rb
@@ -0,0 +1,259 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class EnumArrays
+ attr_accessor :just_symbol
+
+ attr_accessor :array_enum
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'just_symbol' => :'just_symbol',
+ :'array_enum' => :'array_enum'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'just_symbol' => :'String',
+ :'array_enum' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumArrays` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'just_symbol')
+ self.just_symbol = attributes[:'just_symbol']
+ end
+
+ if attributes.key?(:'array_enum')
+ if (value = attributes[:'array_enum']).is_a?(Array)
+ self.array_enum = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"])
+ return false unless just_symbol_validator.valid?(@just_symbol)
+ true
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] just_symbol Object to be assigned
+ def just_symbol=(just_symbol)
+ validator = EnumAttributeValidator.new('String', [">=", "$"])
+ unless validator.valid?(just_symbol)
+ fail ArgumentError, "invalid value for \"just_symbol\", must be one of #{validator.allowable_values}."
+ end
+ @just_symbol = just_symbol
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ just_symbol == o.just_symbol &&
+ array_enum == o.array_enum
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [just_symbol, array_enum].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_class.rb
new file mode 100644
index 00000000000..f842e0f451f
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_class.rb
@@ -0,0 +1,41 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class EnumClass
+ ABC = "_abc".freeze
+ EFG = "-efg".freeze
+ XYZ = "(xyz)".freeze
+
+ def self.all_vars
+ @all_vars ||= [ABC, EFG, XYZ].freeze
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def self.build_from_hash(value)
+ new.build_from_hash(value)
+ end
+
+ # Builds the enum from string
+ # @param [String] The enum value in the form of the string
+ # @return [String] The enum value
+ def build_from_hash(value)
+ return value if EnumClass.all_vars.include?(value)
+ raise "Invalid ENUM value #{value} for class #EnumClass"
+ end
+ end
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_test.rb
new file mode 100644
index 00000000000..f71d804b6d5
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/enum_test.rb
@@ -0,0 +1,359 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class EnumTest
+ attr_accessor :enum_string
+
+ attr_accessor :enum_string_required
+
+ attr_accessor :enum_integer
+
+ attr_accessor :enum_number
+
+ attr_accessor :outer_enum
+
+ attr_accessor :outer_enum_integer
+
+ attr_accessor :outer_enum_default_value
+
+ attr_accessor :outer_enum_integer_default_value
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'enum_string' => :'enum_string',
+ :'enum_string_required' => :'enum_string_required',
+ :'enum_integer' => :'enum_integer',
+ :'enum_number' => :'enum_number',
+ :'outer_enum' => :'outerEnum',
+ :'outer_enum_integer' => :'outerEnumInteger',
+ :'outer_enum_default_value' => :'outerEnumDefaultValue',
+ :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'enum_string' => :'String',
+ :'enum_string_required' => :'String',
+ :'enum_integer' => :'Integer',
+ :'enum_number' => :'Float',
+ :'outer_enum' => :'OuterEnum',
+ :'outer_enum_integer' => :'OuterEnumInteger',
+ :'outer_enum_default_value' => :'OuterEnumDefaultValue',
+ :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'outer_enum',
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumTest` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'enum_string')
+ self.enum_string = attributes[:'enum_string']
+ end
+
+ if attributes.key?(:'enum_string_required')
+ self.enum_string_required = attributes[:'enum_string_required']
+ else
+ self.enum_string_required = nil
+ end
+
+ if attributes.key?(:'enum_integer')
+ self.enum_integer = attributes[:'enum_integer']
+ end
+
+ if attributes.key?(:'enum_number')
+ self.enum_number = attributes[:'enum_number']
+ end
+
+ if attributes.key?(:'outer_enum')
+ self.outer_enum = attributes[:'outer_enum']
+ end
+
+ if attributes.key?(:'outer_enum_integer')
+ self.outer_enum_integer = attributes[:'outer_enum_integer']
+ end
+
+ if attributes.key?(:'outer_enum_default_value')
+ self.outer_enum_default_value = attributes[:'outer_enum_default_value']
+ else
+ self.outer_enum_default_value = 'placed'
+ end
+
+ if attributes.key?(:'outer_enum_integer_default_value')
+ self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value']
+ else
+ self.outer_enum_integer_default_value = OuterEnumIntegerDefaultValue::N0
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @enum_string_required.nil?
+ invalid_properties.push('invalid value for "enum_string_required", enum_string_required cannot be nil.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""])
+ return false unless enum_string_validator.valid?(@enum_string)
+ return false if @enum_string_required.nil?
+ enum_string_required_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""])
+ return false unless enum_string_required_validator.valid?(@enum_string_required)
+ enum_integer_validator = EnumAttributeValidator.new('Integer', [1, -1])
+ return false unless enum_integer_validator.valid?(@enum_integer)
+ enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2])
+ return false unless enum_number_validator.valid?(@enum_number)
+ true
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] enum_string Object to be assigned
+ def enum_string=(enum_string)
+ validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""])
+ unless validator.valid?(enum_string)
+ fail ArgumentError, "invalid value for \"enum_string\", must be one of #{validator.allowable_values}."
+ end
+ @enum_string = enum_string
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] enum_string_required Object to be assigned
+ def enum_string_required=(enum_string_required)
+ validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""])
+ unless validator.valid?(enum_string_required)
+ fail ArgumentError, "invalid value for \"enum_string_required\", must be one of #{validator.allowable_values}."
+ end
+ @enum_string_required = enum_string_required
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] enum_integer Object to be assigned
+ def enum_integer=(enum_integer)
+ validator = EnumAttributeValidator.new('Integer', [1, -1])
+ unless validator.valid?(enum_integer)
+ fail ArgumentError, "invalid value for \"enum_integer\", must be one of #{validator.allowable_values}."
+ end
+ @enum_integer = enum_integer
+ end
+
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] enum_number Object to be assigned
+ def enum_number=(enum_number)
+ validator = EnumAttributeValidator.new('Float', [1.1, -1.2])
+ unless validator.valid?(enum_number)
+ fail ArgumentError, "invalid value for \"enum_number\", must be one of #{validator.allowable_values}."
+ end
+ @enum_number = enum_number
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ enum_string == o.enum_string &&
+ enum_string_required == o.enum_string_required &&
+ enum_integer == o.enum_integer &&
+ enum_number == o.enum_number &&
+ outer_enum == o.outer_enum &&
+ outer_enum_integer == o.outer_enum_integer &&
+ outer_enum_default_value == o.outer_enum_default_value &&
+ outer_enum_integer_default_value == o.outer_enum_integer_default_value
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/fake_big_decimal_map200_response.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/fake_big_decimal_map200_response.rb
new file mode 100644
index 00000000000..2e84764f47f
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/fake_big_decimal_map200_response.rb
@@ -0,0 +1,225 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class FakeBigDecimalMap200Response
+ attr_accessor :some_id
+
+ attr_accessor :some_map
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'some_id' => :'someId',
+ :'some_map' => :'someMap'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'some_id' => :'Float',
+ :'some_map' => :'Hash'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FakeBigDecimalMap200Response` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'some_id')
+ self.some_id = attributes[:'some_id']
+ end
+
+ if attributes.key?(:'some_map')
+ if (value = attributes[:'some_map']).is_a?(Hash)
+ self.some_map = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ some_id == o.some_id &&
+ some_map == o.some_map
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [some_id, some_map].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/file.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/file.rb
new file mode 100644
index 00000000000..af161d8f631
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/file.rb
@@ -0,0 +1,216 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Must be named `File` for test.
+ class File
+ # Test capitalization
+ attr_accessor :source_uri
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'source_uri' => :'sourceURI'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'source_uri' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::File` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'source_uri')
+ self.source_uri = attributes[:'source_uri']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ source_uri == o.source_uri
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [source_uri].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/file_schema_test_class.rb
new file mode 100644
index 00000000000..b4cc94be47b
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/file_schema_test_class.rb
@@ -0,0 +1,225 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class FileSchemaTestClass
+ attr_accessor :file
+
+ attr_accessor :files
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'file' => :'file',
+ :'files' => :'files'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'file' => :'File',
+ :'files' => :'Array'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FileSchemaTestClass` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'file')
+ self.file = attributes[:'file']
+ end
+
+ if attributes.key?(:'files')
+ if (value = attributes[:'files']).is_a?(Array)
+ self.files = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ file == o.file &&
+ files == o.files
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [file, files].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/foo.rb
new file mode 100644
index 00000000000..76988fd3cd5
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/foo.rb
@@ -0,0 +1,216 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class Foo
+ attr_accessor :bar
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'bar' => :'bar'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'bar' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Foo` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Foo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'bar')
+ self.bar = attributes[:'bar']
+ else
+ self.bar = 'bar'
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ bar == o.bar
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [bar].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/foo_get_default_response.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/foo_get_default_response.rb
new file mode 100644
index 00000000000..d50fec9cd9f
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/foo_get_default_response.rb
@@ -0,0 +1,214 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class FooGetDefaultResponse
+ attr_accessor :string
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'string' => :'string'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'string' => :'Foo'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FooGetDefaultResponse` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FooGetDefaultResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'string')
+ self.string = attributes[:'string']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ string == o.string
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [string].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/format_test.rb
new file mode 100644
index 00000000000..f6da236ae5b
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/format_test.rb
@@ -0,0 +1,610 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class FormatTest
+ attr_accessor :integer
+
+ attr_accessor :int32
+
+ attr_accessor :int64
+
+ attr_accessor :number
+
+ attr_accessor :float
+
+ attr_accessor :double
+
+ attr_accessor :decimal
+
+ attr_accessor :string
+
+ attr_accessor :byte
+
+ attr_accessor :binary
+
+ attr_accessor :date
+
+ attr_accessor :date_time
+
+ attr_accessor :uuid
+
+ attr_accessor :password
+
+ # A string that is a 10 digit number. Can have leading zeros.
+ attr_accessor :pattern_with_digits
+
+ # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
+ attr_accessor :pattern_with_digits_and_delimiter
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'integer' => :'integer',
+ :'int32' => :'int32',
+ :'int64' => :'int64',
+ :'number' => :'number',
+ :'float' => :'float',
+ :'double' => :'double',
+ :'decimal' => :'decimal',
+ :'string' => :'string',
+ :'byte' => :'byte',
+ :'binary' => :'binary',
+ :'date' => :'date',
+ :'date_time' => :'dateTime',
+ :'uuid' => :'uuid',
+ :'password' => :'password',
+ :'pattern_with_digits' => :'pattern_with_digits',
+ :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'integer' => :'Integer',
+ :'int32' => :'Integer',
+ :'int64' => :'Integer',
+ :'number' => :'Float',
+ :'float' => :'Float',
+ :'double' => :'Float',
+ :'decimal' => :'Float',
+ :'string' => :'String',
+ :'byte' => :'String',
+ :'binary' => :'File',
+ :'date' => :'Date',
+ :'date_time' => :'Time',
+ :'uuid' => :'String',
+ :'password' => :'String',
+ :'pattern_with_digits' => :'String',
+ :'pattern_with_digits_and_delimiter' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FormatTest` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'integer')
+ self.integer = attributes[:'integer']
+ end
+
+ if attributes.key?(:'int32')
+ self.int32 = attributes[:'int32']
+ end
+
+ if attributes.key?(:'int64')
+ self.int64 = attributes[:'int64']
+ end
+
+ if attributes.key?(:'number')
+ self.number = attributes[:'number']
+ else
+ self.number = nil
+ end
+
+ if attributes.key?(:'float')
+ self.float = attributes[:'float']
+ end
+
+ if attributes.key?(:'double')
+ self.double = attributes[:'double']
+ end
+
+ if attributes.key?(:'decimal')
+ self.decimal = attributes[:'decimal']
+ end
+
+ if attributes.key?(:'string')
+ self.string = attributes[:'string']
+ end
+
+ if attributes.key?(:'byte')
+ self.byte = attributes[:'byte']
+ else
+ self.byte = nil
+ end
+
+ if attributes.key?(:'binary')
+ self.binary = attributes[:'binary']
+ end
+
+ if attributes.key?(:'date')
+ self.date = attributes[:'date']
+ else
+ self.date = nil
+ end
+
+ if attributes.key?(:'date_time')
+ self.date_time = attributes[:'date_time']
+ end
+
+ if attributes.key?(:'uuid')
+ self.uuid = attributes[:'uuid']
+ end
+
+ if attributes.key?(:'password')
+ self.password = attributes[:'password']
+ else
+ self.password = nil
+ end
+
+ if attributes.key?(:'pattern_with_digits')
+ self.pattern_with_digits = attributes[:'pattern_with_digits']
+ end
+
+ if attributes.key?(:'pattern_with_digits_and_delimiter')
+ self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if !@integer.nil? && @integer > 100
+ invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.')
+ end
+
+ if !@integer.nil? && @integer < 10
+ invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.')
+ end
+
+ if !@int32.nil? && @int32 > 200
+ invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.')
+ end
+
+ if !@int32.nil? && @int32 < 20
+ invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.')
+ end
+
+ if @number.nil?
+ invalid_properties.push('invalid value for "number", number cannot be nil.')
+ end
+
+ if @number > 543.2
+ invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.')
+ end
+
+ if @number < 32.1
+ invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.')
+ end
+
+ if !@float.nil? && @float > 987.6
+ invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.')
+ end
+
+ if !@float.nil? && @float < 54.3
+ invalid_properties.push('invalid value for "float", must be greater than or equal to 54.3.')
+ end
+
+ if !@double.nil? && @double > 123.4
+ invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.')
+ end
+
+ if !@double.nil? && @double < 67.8
+ invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.')
+ end
+
+ pattern = Regexp.new(/[a-z]/i)
+ if !@string.nil? && @string !~ pattern
+ invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.")
+ end
+
+ if @byte.nil?
+ invalid_properties.push('invalid value for "byte", byte cannot be nil.')
+ end
+
+ if @date.nil?
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
+ end
+
+ if @password.nil?
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
+ end
+
+ if @password.to_s.length > 64
+ invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.')
+ end
+
+ if @password.to_s.length < 10
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.')
+ end
+
+ pattern = Regexp.new(/^\d{10}$/)
+ if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern
+ invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.")
+ end
+
+ pattern = Regexp.new(/^image_\d{1,3}$/i)
+ if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern
+ invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.")
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if !@integer.nil? && @integer > 100
+ return false if !@integer.nil? && @integer < 10
+ return false if !@int32.nil? && @int32 > 200
+ return false if !@int32.nil? && @int32 < 20
+ return false if @number.nil?
+ return false if @number > 543.2
+ return false if @number < 32.1
+ return false if !@float.nil? && @float > 987.6
+ return false if !@float.nil? && @float < 54.3
+ return false if !@double.nil? && @double > 123.4
+ return false if !@double.nil? && @double < 67.8
+ return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i)
+ return false if @byte.nil?
+ return false if @date.nil?
+ return false if @password.nil?
+ return false if @password.to_s.length > 64
+ return false if @password.to_s.length < 10
+ return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/)
+ return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i)
+ true
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] integer Value to be assigned
+ def integer=(integer)
+ if integer.nil?
+ fail ArgumentError, 'integer cannot be nil'
+ end
+
+ if integer > 100
+ fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.'
+ end
+
+ if integer < 10
+ fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.'
+ end
+
+ @integer = integer
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] int32 Value to be assigned
+ def int32=(int32)
+ if int32.nil?
+ fail ArgumentError, 'int32 cannot be nil'
+ end
+
+ if int32 > 200
+ fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.'
+ end
+
+ if int32 < 20
+ fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.'
+ end
+
+ @int32 = int32
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] number Value to be assigned
+ def number=(number)
+ if number.nil?
+ fail ArgumentError, 'number cannot be nil'
+ end
+
+ if number > 543.2
+ fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.'
+ end
+
+ if number < 32.1
+ fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.'
+ end
+
+ @number = number
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] float Value to be assigned
+ def float=(float)
+ if float.nil?
+ fail ArgumentError, 'float cannot be nil'
+ end
+
+ if float > 987.6
+ fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.'
+ end
+
+ if float < 54.3
+ fail ArgumentError, 'invalid value for "float", must be greater than or equal to 54.3.'
+ end
+
+ @float = float
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] double Value to be assigned
+ def double=(double)
+ if double.nil?
+ fail ArgumentError, 'double cannot be nil'
+ end
+
+ if double > 123.4
+ fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.'
+ end
+
+ if double < 67.8
+ fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.'
+ end
+
+ @double = double
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] string Value to be assigned
+ def string=(string)
+ if string.nil?
+ fail ArgumentError, 'string cannot be nil'
+ end
+
+ pattern = Regexp.new(/[a-z]/i)
+ if string !~ pattern
+ fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}."
+ end
+
+ @string = string
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] password Value to be assigned
+ def password=(password)
+ if password.nil?
+ fail ArgumentError, 'password cannot be nil'
+ end
+
+ if password.to_s.length > 64
+ fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.'
+ end
+
+ if password.to_s.length < 10
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.'
+ end
+
+ @password = password
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] pattern_with_digits Value to be assigned
+ def pattern_with_digits=(pattern_with_digits)
+ if pattern_with_digits.nil?
+ fail ArgumentError, 'pattern_with_digits cannot be nil'
+ end
+
+ pattern = Regexp.new(/^\d{10}$/)
+ if pattern_with_digits !~ pattern
+ fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}."
+ end
+
+ @pattern_with_digits = pattern_with_digits
+ end
+
+ # Custom attribute writer method with validation
+ # @param [Object] pattern_with_digits_and_delimiter Value to be assigned
+ def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter)
+ if pattern_with_digits_and_delimiter.nil?
+ fail ArgumentError, 'pattern_with_digits_and_delimiter cannot be nil'
+ end
+
+ pattern = Regexp.new(/^image_\d{1,3}$/i)
+ if pattern_with_digits_and_delimiter !~ pattern
+ fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}."
+ end
+
+ @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ integer == o.integer &&
+ int32 == o.int32 &&
+ int64 == o.int64 &&
+ number == o.number &&
+ float == o.float &&
+ double == o.double &&
+ decimal == o.decimal &&
+ string == o.string &&
+ byte == o.byte &&
+ binary == o.binary &&
+ date == o.date &&
+ date_time == o.date_time &&
+ uuid == o.uuid &&
+ password == o.password &&
+ pattern_with_digits == o.pattern_with_digits &&
+ pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [integer, int32, int64, number, float, double, decimal, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/has_only_read_only.rb
new file mode 100644
index 00000000000..9d82934d22e
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/has_only_read_only.rb
@@ -0,0 +1,223 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class HasOnlyReadOnly
+ attr_accessor :bar
+
+ attr_accessor :foo
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'bar' => :'bar',
+ :'foo' => :'foo'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'bar' => :'String',
+ :'foo' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HasOnlyReadOnly` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'bar')
+ self.bar = attributes[:'bar']
+ end
+
+ if attributes.key?(:'foo')
+ self.foo = attributes[:'foo']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ bar == o.bar &&
+ foo == o.foo
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [bar, foo].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/health_check_result.rb
new file mode 100644
index 00000000000..b850e8623c6
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/health_check_result.rb
@@ -0,0 +1,216 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+ class HealthCheckResult
+ attr_accessor :nullable_message
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'nullable_message' => :'NullableMessage'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'nullable_message' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'nullable_message'
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HealthCheckResult` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HealthCheckResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'nullable_message')
+ self.nullable_message = attributes[:'nullable_message']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ nullable_message == o.nullable_message
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [nullable_message].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/list.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/list.rb
new file mode 100644
index 00000000000..ef3adc399fe
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/list.rb
@@ -0,0 +1,214 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class List
+ attr_accessor :_123_list
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'_123_list' => :'123-list'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'_123_list' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::List` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'_123_list')
+ self._123_list = attributes[:'_123_list']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ _123_list == o._123_list
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [_123_list].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/map_test.rb
new file mode 100644
index 00000000000..0ced89f3c86
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/map_test.rb
@@ -0,0 +1,271 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class MapTest
+ attr_accessor :map_map_of_string
+
+ attr_accessor :map_of_enum_string
+
+ attr_accessor :direct_map
+
+ attr_accessor :indirect_map
+
+ class EnumAttributeValidator
+ attr_reader :datatype
+ attr_reader :allowable_values
+
+ def initialize(datatype, allowable_values)
+ @allowable_values = allowable_values.map do |value|
+ case datatype.to_s
+ when /Integer/i
+ value.to_i
+ when /Float/i
+ value.to_f
+ else
+ value
+ end
+ end
+ end
+
+ def valid?(value)
+ !value || allowable_values.include?(value)
+ end
+ end
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'map_map_of_string' => :'map_map_of_string',
+ :'map_of_enum_string' => :'map_of_enum_string',
+ :'direct_map' => :'direct_map',
+ :'indirect_map' => :'indirect_map'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'map_map_of_string' => :'Hash>',
+ :'map_of_enum_string' => :'Hash',
+ :'direct_map' => :'Hash',
+ :'indirect_map' => :'Hash'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MapTest` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'map_map_of_string')
+ if (value = attributes[:'map_map_of_string']).is_a?(Hash)
+ self.map_map_of_string = value
+ end
+ end
+
+ if attributes.key?(:'map_of_enum_string')
+ if (value = attributes[:'map_of_enum_string']).is_a?(Hash)
+ self.map_of_enum_string = value
+ end
+ end
+
+ if attributes.key?(:'direct_map')
+ if (value = attributes[:'direct_map']).is_a?(Hash)
+ self.direct_map = value
+ end
+ end
+
+ if attributes.key?(:'indirect_map')
+ if (value = attributes[:'indirect_map']).is_a?(Hash)
+ self.indirect_map = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ map_map_of_string == o.map_map_of_string &&
+ map_of_enum_string == o.map_of_enum_string &&
+ direct_map == o.direct_map &&
+ indirect_map == o.indirect_map
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/mixed_properties_and_additional_properties_class.rb
new file mode 100644
index 00000000000..ad1a5b47235
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/mixed_properties_and_additional_properties_class.rb
@@ -0,0 +1,234 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class MixedPropertiesAndAdditionalPropertiesClass
+ attr_accessor :uuid
+
+ attr_accessor :date_time
+
+ attr_accessor :map
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'uuid' => :'uuid',
+ :'date_time' => :'dateTime',
+ :'map' => :'map'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'uuid' => :'String',
+ :'date_time' => :'Time',
+ :'map' => :'Hash'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MixedPropertiesAndAdditionalPropertiesClass` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'uuid')
+ self.uuid = attributes[:'uuid']
+ end
+
+ if attributes.key?(:'date_time')
+ self.date_time = attributes[:'date_time']
+ end
+
+ if attributes.key?(:'map')
+ if (value = attributes[:'map']).is_a?(Hash)
+ self.map = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ uuid == o.uuid &&
+ date_time == o.date_time &&
+ map == o.map
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [uuid, date_time, map].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/model200_response.rb
new file mode 100644
index 00000000000..4d318df4c90
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/model200_response.rb
@@ -0,0 +1,224 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Model for testing model name starting with number
+ class Model200Response
+ attr_accessor :name
+
+ attr_accessor :_class
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'name' => :'name',
+ :'_class' => :'class'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'name' => :'Integer',
+ :'_class' => :'String'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Model200Response` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ end
+
+ if attributes.key?(:'_class')
+ self._class = attributes[:'_class']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ name == o.name &&
+ _class == o._class
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [name, _class].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/model_return.rb
new file mode 100644
index 00000000000..ef0c65b55d8
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/model_return.rb
@@ -0,0 +1,215 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Model for testing reserved words
+ class ModelReturn
+ attr_accessor :_return
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'_return' => :'return'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'_return' => :'Integer'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ModelReturn` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'_return')
+ self._return = attributes[:'_return']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ _return == o._return
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [_return].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/name.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/name.rb
new file mode 100644
index 00000000000..a189793a381
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/name.rb
@@ -0,0 +1,249 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ # Model for testing model name same as property name
+ class Name
+ attr_accessor :name
+
+ attr_accessor :snake_case
+
+ attr_accessor :property
+
+ attr_accessor :_123_number
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'name' => :'name',
+ :'snake_case' => :'snake_case',
+ :'property' => :'property',
+ :'_123_number' => :'123Number'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'name' => :'Integer',
+ :'snake_case' => :'Integer',
+ :'property' => :'String',
+ :'_123_number' => :'Integer'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Name` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'name')
+ self.name = attributes[:'name']
+ else
+ self.name = nil
+ end
+
+ if attributes.key?(:'snake_case')
+ self.snake_case = attributes[:'snake_case']
+ end
+
+ if attributes.key?(:'property')
+ self.property = attributes[:'property']
+ end
+
+ if attributes.key?(:'_123_number')
+ self._123_number = attributes[:'_123_number']
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ if @name.nil?
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
+ end
+
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ return false if @name.nil?
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ name == o.name &&
+ snake_case == o.snake_case &&
+ property == o.property &&
+ _123_number == o._123_number
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [name, snake_case, property, _123_number].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?.+?), (?.+)>\z/
+ k_type = Regexp.last_match[:k_type]
+ v_type = Regexp.last_match[:v_type]
+ {}.tap do |hash|
+ value.each do |k, v|
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
+ end
+ end
+ else # model
+ # models (e.g. Pet) or oneOf
+ klass = Petstore.const_get(type)
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
+ end
+ end
+
+ # Returns the string representation of the object
+ # @return [String] String presentation of the object
+ def to_s
+ to_hash.to_s
+ end
+
+ # to_body is an alias to to_hash (backward compatibility)
+ # @return [Hash] Returns the object in the form of hash
+ def to_body
+ to_hash
+ end
+
+ # Returns the object in the form of hash
+ # @return [Hash] Returns the object in the form of hash
+ def to_hash
+ hash = {}
+ self.class.attribute_map.each_pair do |attr, param|
+ value = self.send(attr)
+ if value.nil?
+ is_nullable = self.class.openapi_nullable.include?(attr)
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
+ end
+
+ hash[param] = _to_hash(value)
+ end
+ hash
+ end
+
+ # Outputs non-array value in the form of hash
+ # For object, use to_hash. Otherwise, just return the value
+ # @param [Object] value Any valid value
+ # @return [Hash] Returns the value in the form of hash
+ def _to_hash(value)
+ if value.is_a?(Array)
+ value.compact.map { |v| _to_hash(v) }
+ elsif value.is_a?(Hash)
+ {}.tap do |hash|
+ value.each { |k, v| hash[k] = _to_hash(v) }
+ end
+ elsif value.respond_to? :to_hash
+ value.to_hash
+ else
+ value
+ end
+ end
+
+ end
+
+end
diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-httpx/lib/petstore/models/nullable_class.rb
new file mode 100644
index 00000000000..5748150ee60
--- /dev/null
+++ b/samples/client/petstore/ruby-httpx/lib/petstore/models/nullable_class.rb
@@ -0,0 +1,335 @@
+=begin
+#OpenAPI Petstore
+
+#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+The version of the OpenAPI document: 1.0.0
+
+Generated by: https://openapi-generator.tech
+OpenAPI Generator version: 7.1.0-SNAPSHOT
+
+=end
+
+require 'date'
+require 'time'
+
+module Petstore
+ class NullableClass
+ attr_accessor :integer_prop
+
+ attr_accessor :number_prop
+
+ attr_accessor :boolean_prop
+
+ attr_accessor :string_prop
+
+ attr_accessor :date_prop
+
+ attr_accessor :datetime_prop
+
+ attr_accessor :array_nullable_prop
+
+ attr_accessor :array_and_items_nullable_prop
+
+ attr_accessor :array_items_nullable
+
+ attr_accessor :object_nullable_prop
+
+ attr_accessor :object_and_items_nullable_prop
+
+ attr_accessor :object_items_nullable
+
+ # Attribute mapping from ruby-style variable name to JSON key.
+ def self.attribute_map
+ {
+ :'integer_prop' => :'integer_prop',
+ :'number_prop' => :'number_prop',
+ :'boolean_prop' => :'boolean_prop',
+ :'string_prop' => :'string_prop',
+ :'date_prop' => :'date_prop',
+ :'datetime_prop' => :'datetime_prop',
+ :'array_nullable_prop' => :'array_nullable_prop',
+ :'array_and_items_nullable_prop' => :'array_and_items_nullable_prop',
+ :'array_items_nullable' => :'array_items_nullable',
+ :'object_nullable_prop' => :'object_nullable_prop',
+ :'object_and_items_nullable_prop' => :'object_and_items_nullable_prop',
+ :'object_items_nullable' => :'object_items_nullable'
+ }
+ end
+
+ # Returns all the JSON keys this model knows about
+ def self.acceptable_attributes
+ attribute_map.values
+ end
+
+ # Attribute type mapping.
+ def self.openapi_types
+ {
+ :'integer_prop' => :'Integer',
+ :'number_prop' => :'Float',
+ :'boolean_prop' => :'Boolean',
+ :'string_prop' => :'String',
+ :'date_prop' => :'Date',
+ :'datetime_prop' => :'Time',
+ :'array_nullable_prop' => :'Array',
+ :'array_and_items_nullable_prop' => :'Array',
+ :'array_items_nullable' => :'Array',
+ :'object_nullable_prop' => :'Hash',
+ :'object_and_items_nullable_prop' => :'Hash',
+ :'object_items_nullable' => :'Hash'
+ }
+ end
+
+ # List of attributes with nullable: true
+ def self.openapi_nullable
+ Set.new([
+ :'integer_prop',
+ :'number_prop',
+ :'boolean_prop',
+ :'string_prop',
+ :'date_prop',
+ :'datetime_prop',
+ :'array_nullable_prop',
+ :'array_and_items_nullable_prop',
+ :'object_nullable_prop',
+ :'object_and_items_nullable_prop',
+ ])
+ end
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(attributes = {})
+ if (!attributes.is_a?(Hash))
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::NullableClass` initialize method"
+ end
+
+ # check to see if the attribute exists and convert string to symbol for hash key
+ attributes = attributes.each_with_object({}) { |(k, v), h|
+ if (!self.class.attribute_map.key?(k.to_sym))
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NullableClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
+ end
+ h[k.to_sym] = v
+ }
+
+ if attributes.key?(:'integer_prop')
+ self.integer_prop = attributes[:'integer_prop']
+ end
+
+ if attributes.key?(:'number_prop')
+ self.number_prop = attributes[:'number_prop']
+ end
+
+ if attributes.key?(:'boolean_prop')
+ self.boolean_prop = attributes[:'boolean_prop']
+ end
+
+ if attributes.key?(:'string_prop')
+ self.string_prop = attributes[:'string_prop']
+ end
+
+ if attributes.key?(:'date_prop')
+ self.date_prop = attributes[:'date_prop']
+ end
+
+ if attributes.key?(:'datetime_prop')
+ self.datetime_prop = attributes[:'datetime_prop']
+ end
+
+ if attributes.key?(:'array_nullable_prop')
+ if (value = attributes[:'array_nullable_prop']).is_a?(Array)
+ self.array_nullable_prop = value
+ end
+ end
+
+ if attributes.key?(:'array_and_items_nullable_prop')
+ if (value = attributes[:'array_and_items_nullable_prop']).is_a?(Array)
+ self.array_and_items_nullable_prop = value
+ end
+ end
+
+ if attributes.key?(:'array_items_nullable')
+ if (value = attributes[:'array_items_nullable']).is_a?(Array)
+ self.array_items_nullable = value
+ end
+ end
+
+ if attributes.key?(:'object_nullable_prop')
+ if (value = attributes[:'object_nullable_prop']).is_a?(Hash)
+ self.object_nullable_prop = value
+ end
+ end
+
+ if attributes.key?(:'object_and_items_nullable_prop')
+ if (value = attributes[:'object_and_items_nullable_prop']).is_a?(Hash)
+ self.object_and_items_nullable_prop = value
+ end
+ end
+
+ if attributes.key?(:'object_items_nullable')
+ if (value = attributes[:'object_items_nullable']).is_a?(Hash)
+ self.object_items_nullable = value
+ end
+ end
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
+ invalid_properties = Array.new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ warn '[DEPRECATED] the `valid?` method is obsolete'
+ true
+ end
+
+ # Checks equality by comparing each attribute.
+ # @param [Object] Object to be compared
+ def ==(o)
+ return true if self.equal?(o)
+ self.class == o.class &&
+ integer_prop == o.integer_prop &&
+ number_prop == o.number_prop &&
+ boolean_prop == o.boolean_prop &&
+ string_prop == o.string_prop &&
+ date_prop == o.date_prop &&
+ datetime_prop == o.datetime_prop &&
+ array_nullable_prop == o.array_nullable_prop &&
+ array_and_items_nullable_prop == o.array_and_items_nullable_prop &&
+ array_items_nullable == o.array_items_nullable &&
+ object_nullable_prop == o.object_nullable_prop &&
+ object_and_items_nullable_prop == o.object_and_items_nullable_prop &&
+ object_items_nullable == o.object_items_nullable
+ end
+
+ # @see the `==` method
+ # @param [Object] Object to be compared
+ def eql?(o)
+ self == o
+ end
+
+ # Calculates hash code according to all attributes.
+ # @return [Integer] Hash code
+ def hash
+ [integer_prop, number_prop, boolean_prop, string_prop, date_prop, datetime_prop, array_nullable_prop, array_and_items_nullable_prop, array_items_nullable, object_nullable_prop, object_and_items_nullable_prop, object_items_nullable].hash
+ end
+
+ # Builds the object from hash
+ # @param [Hash] attributes Model attributes in the form of hash
+ # @return [Object] Returns the model itself
+ def self.build_from_hash(attributes)
+ return nil unless attributes.is_a?(Hash)
+ attributes = attributes.transform_keys(&:to_sym)
+ transformed_hash = {}
+ openapi_types.each_pair do |key, type|
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = nil
+ elsif type =~ /\AArray<(.*)>/i
+ # check to ensure the input is an array given that the attribute
+ # is documented as an array but the input is not
+ if attributes[attribute_map[key]].is_a?(Array)
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
+ end
+ elsif !attributes[attribute_map[key]].nil?
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
+ end
+ end
+ new(transformed_hash)
+ end
+
+ # Deserializes the data based on type
+ # @param string type Data type
+ # @param string value Value to be deserialized
+ # @return [Object] Deserialized data
+ def self._deserialize(type, value)
+ case type.to_sym
+ when :Time
+ Time.parse(value)
+ when :Date
+ Date.parse(value)
+ when :String
+ value.to_s
+ when :Integer
+ value.to_i
+ when :Float
+ value.to_f
+ when :Boolean
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
+ true
+ else
+ false
+ end
+ when :Object
+ # generic object (usually a Hash), return directly
+ value
+ when /\AArray<(?.+)>\z/
+ inner_type = Regexp.last_match[:inner_type]
+ value.map { |v| _deserialize(inner_type, v) }
+ when /\AHash<(?