From 29d08c42b6ee65c536898dcdc1f05c93fddcffd8 Mon Sep 17 00:00:00 2001 From: Martin Slemr Date: Wed, 6 Nov 2019 13:20:09 +0100 Subject: [PATCH 1/3] Ruby Client: implementation of nullable --- .../main/resources/ruby-client/base_object.mustache | 2 +- .../ruby-client/partial_model_generic.mustache | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache index 0a663ef944aa..0467bd183fed 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache @@ -87,7 +87,7 @@ hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache index f0d7c40a5bce..b5c360e902b4 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache @@ -51,6 +51,17 @@ } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + {{#vars}} + {{#isNullable}} + :'{{{name}}}'{{#hasMore}},{{/hasMore}} + {{/isNullable}} + {{/vars}} + ] + end + {{#anyOf}} {{#-first}} # List of class defined in anyOf (OpenAPI v3) From a2cfa44ff94c9fa0fab9e4a55e3a9b039f0ca241 Mon Sep 17 00:00:00 2001 From: Martin Slemr Date: Wed, 6 Nov 2019 13:27:46 +0100 Subject: [PATCH 2/3] Ruby samples with nullable implementation --- .../models/additional_properties_any_type.rb | 8 +- .../models/additional_properties_array.rb | 8 +- .../models/additional_properties_boolean.rb | 8 +- .../models/additional_properties_class.rb | 8 +- .../models/additional_properties_integer.rb | 8 +- .../models/additional_properties_number.rb | 8 +- .../models/additional_properties_object.rb | 8 +- .../models/additional_properties_string.rb | 8 +- .../lib/petstore/models/animal.rb | 8 +- .../lib/petstore/models/api_response.rb | 8 +- .../models/array_of_array_of_number_only.rb | 8 +- .../petstore/models/array_of_number_only.rb | 8 +- .../lib/petstore/models/array_test.rb | 8 +- .../lib/petstore/models/capitalization.rb | 8 +- .../ruby-faraday/lib/petstore/models/cat.rb | 8 +- .../lib/petstore/models/cat_all_of.rb | 8 +- .../lib/petstore/models/category.rb | 8 +- .../lib/petstore/models/class_model.rb | 8 +- .../lib/petstore/models/client.rb | 8 +- .../ruby-faraday/lib/petstore/models/dog.rb | 8 +- .../lib/petstore/models/dog_all_of.rb | 8 +- .../lib/petstore/models/enum_arrays.rb | 8 +- .../lib/petstore/models/enum_test.rb | 8 +- .../ruby-faraday/lib/petstore/models/file.rb | 8 +- .../petstore/models/file_schema_test_class.rb | 8 +- .../lib/petstore/models/format_test.rb | 8 +- .../lib/petstore/models/has_only_read_only.rb | 8 +- .../ruby-faraday/lib/petstore/models/list.rb | 8 +- .../lib/petstore/models/map_test.rb | 8 +- ...perties_and_additional_properties_class.rb | 8 +- .../lib/petstore/models/model200_response.rb | 8 +- .../lib/petstore/models/model_return.rb | 8 +- .../ruby-faraday/lib/petstore/models/name.rb | 8 +- .../lib/petstore/models/number_only.rb | 8 +- .../ruby-faraday/lib/petstore/models/order.rb | 8 +- .../lib/petstore/models/outer_composite.rb | 8 +- .../ruby-faraday/lib/petstore/models/pet.rb | 8 +- .../lib/petstore/models/read_only_first.rb | 8 +- .../lib/petstore/models/special_model_name.rb | 8 +- .../ruby-faraday/lib/petstore/models/tag.rb | 8 +- .../petstore/models/type_holder_default.rb | 8 +- .../petstore/models/type_holder_example.rb | 8 +- .../ruby-faraday/lib/petstore/models/user.rb | 8 +- .../lib/petstore/models/xml_item.rb | 8 +- .../models/additional_properties_any_type.rb | 8 +- .../models/additional_properties_array.rb | 8 +- .../models/additional_properties_boolean.rb | 8 +- .../models/additional_properties_class.rb | 8 +- .../models/additional_properties_integer.rb | 8 +- .../models/additional_properties_number.rb | 8 +- .../models/additional_properties_object.rb | 8 +- .../models/additional_properties_string.rb | 8 +- .../ruby/lib/petstore/models/animal.rb | 8 +- .../ruby/lib/petstore/models/api_response.rb | 8 +- .../models/array_of_array_of_number_only.rb | 8 +- .../petstore/models/array_of_number_only.rb | 8 +- .../ruby/lib/petstore/models/array_test.rb | 8 +- .../lib/petstore/models/capitalization.rb | 8 +- .../petstore/ruby/lib/petstore/models/cat.rb | 8 +- .../ruby/lib/petstore/models/cat_all_of.rb | 8 +- .../ruby/lib/petstore/models/category.rb | 8 +- .../ruby/lib/petstore/models/class_model.rb | 8 +- .../ruby/lib/petstore/models/client.rb | 8 +- .../petstore/ruby/lib/petstore/models/dog.rb | 8 +- .../ruby/lib/petstore/models/dog_all_of.rb | 8 +- .../ruby/lib/petstore/models/enum_arrays.rb | 8 +- .../ruby/lib/petstore/models/enum_test.rb | 8 +- .../petstore/ruby/lib/petstore/models/file.rb | 8 +- .../petstore/models/file_schema_test_class.rb | 8 +- .../ruby/lib/petstore/models/format_test.rb | 8 +- .../lib/petstore/models/has_only_read_only.rb | 8 +- .../petstore/ruby/lib/petstore/models/list.rb | 8 +- .../ruby/lib/petstore/models/map_test.rb | 8 +- ...perties_and_additional_properties_class.rb | 8 +- .../lib/petstore/models/model200_response.rb | 8 +- .../ruby/lib/petstore/models/model_return.rb | 8 +- .../petstore/ruby/lib/petstore/models/name.rb | 8 +- .../ruby/lib/petstore/models/number_only.rb | 8 +- .../ruby/lib/petstore/models/order.rb | 8 +- .../lib/petstore/models/outer_composite.rb | 8 +- .../petstore/ruby/lib/petstore/models/pet.rb | 8 +- .../lib/petstore/models/read_only_first.rb | 8 +- .../lib/petstore/models/special_model_name.rb | 8 +- .../petstore/ruby/lib/petstore/models/tag.rb | 8 +- .../petstore/models/type_holder_default.rb | 8 +- .../petstore/models/type_holder_example.rb | 8 +- .../petstore/ruby/lib/petstore/models/user.rb | 8 +- .../ruby/lib/petstore/models/xml_item.rb | 8 +- .../models/additional_properties_class.rb | 8 +- .../lib/petstore/models/animal.rb | 8 +- .../lib/petstore/models/api_response.rb | 8 +- .../models/array_of_array_of_number_only.rb | 8 +- .../petstore/models/array_of_number_only.rb | 8 +- .../lib/petstore/models/array_test.rb | 8 +- .../lib/petstore/models/capitalization.rb | 8 +- .../ruby-faraday/lib/petstore/models/cat.rb | 8 +- .../lib/petstore/models/cat_all_of.rb | 8 +- .../lib/petstore/models/category.rb | 8 +- .../lib/petstore/models/class_model.rb | 8 +- .../lib/petstore/models/client.rb | 8 +- .../ruby-faraday/lib/petstore/models/dog.rb | 8 +- .../lib/petstore/models/dog_all_of.rb | 8 +- .../lib/petstore/models/enum_arrays.rb | 8 +- .../lib/petstore/models/enum_test.rb | 9 +- .../ruby-faraday/lib/petstore/models/file.rb | 8 +- .../petstore/models/file_schema_test_class.rb | 8 +- .../ruby-faraday/lib/petstore/models/foo.rb | 8 +- .../lib/petstore/models/format_test.rb | 8 +- .../lib/petstore/models/has_only_read_only.rb | 8 +- .../petstore/models/health_check_result.rb | 9 +- .../lib/petstore/models/inline_object.rb | 8 +- .../lib/petstore/models/inline_object1.rb | 8 +- .../lib/petstore/models/inline_object2.rb | 8 +- .../lib/petstore/models/inline_object3.rb | 8 +- .../lib/petstore/models/inline_object4.rb | 8 +- .../lib/petstore/models/inline_object5.rb | 8 +- .../models/inline_response_default.rb | 8 +- .../ruby-faraday/lib/petstore/models/list.rb | 8 +- .../lib/petstore/models/map_test.rb | 8 +- ...perties_and_additional_properties_class.rb | 8 +- .../lib/petstore/models/model200_response.rb | 8 +- .../lib/petstore/models/model_return.rb | 8 +- .../ruby-faraday/lib/petstore/models/name.rb | 8 +- .../lib/petstore/models/nullable_class.rb | 18 +- .../lib/petstore/models/number_only.rb | 8 +- .../ruby-faraday/lib/petstore/models/order.rb | 8 +- .../lib/petstore/models/outer_composite.rb | 8 +- .../ruby-faraday/lib/petstore/models/pet.rb | 8 +- .../lib/petstore/models/read_only_first.rb | 8 +- .../lib/petstore/models/special_model_name.rb | 8 +- .../ruby-faraday/lib/petstore/models/tag.rb | 8 +- .../ruby-faraday/lib/petstore/models/user.rb | 8 +- .../models/additional_properties_class.rb | 8 +- .../ruby/lib/petstore/models/animal.rb | 8 +- .../ruby/lib/petstore/models/api_response.rb | 8 +- .../models/array_of_array_of_number_only.rb | 8 +- .../petstore/models/array_of_number_only.rb | 8 +- .../ruby/lib/petstore/models/array_test.rb | 8 +- .../lib/petstore/models/capitalization.rb | 8 +- .../petstore/ruby/lib/petstore/models/cat.rb | 8 +- .../ruby/lib/petstore/models/cat_all_of.rb | 8 +- .../ruby/lib/petstore/models/category.rb | 8 +- .../ruby/lib/petstore/models/class_model.rb | 8 +- .../ruby/lib/petstore/models/client.rb | 8 +- .../petstore/ruby/lib/petstore/models/dog.rb | 8 +- .../ruby/lib/petstore/models/dog_all_of.rb | 8 +- .../ruby/lib/petstore/models/enum_arrays.rb | 8 +- .../ruby/lib/petstore/models/enum_test.rb | 9 +- .../petstore/ruby/lib/petstore/models/file.rb | 8 +- .../petstore/models/file_schema_test_class.rb | 8 +- .../petstore/ruby/lib/petstore/models/foo.rb | 8 +- .../ruby/lib/petstore/models/format_test.rb | 8 +- .../lib/petstore/models/has_only_read_only.rb | 8 +- .../petstore/models/health_check_result.rb | 9 +- .../ruby/lib/petstore/models/inline_object.rb | 8 +- .../lib/petstore/models/inline_object1.rb | 8 +- .../lib/petstore/models/inline_object2.rb | 8 +- .../lib/petstore/models/inline_object3.rb | 8 +- .../lib/petstore/models/inline_object4.rb | 8 +- .../lib/petstore/models/inline_object5.rb | 8 +- .../models/inline_response_default.rb | 8 +- .../petstore/ruby/lib/petstore/models/list.rb | 8 +- .../ruby/lib/petstore/models/map_test.rb | 8 +- ...perties_and_additional_properties_class.rb | 8 +- .../lib/petstore/models/model200_response.rb | 8 +- .../ruby/lib/petstore/models/model_return.rb | 8 +- .../petstore/ruby/lib/petstore/models/name.rb | 8 +- .../lib/petstore/models/nullable_class.rb | 18 +- .../ruby/lib/petstore/models/number_only.rb | 8 +- .../ruby/lib/petstore/models/order.rb | 8 +- .../lib/petstore/models/outer_composite.rb | 8 +- .../petstore/ruby/lib/petstore/models/pet.rb | 8 +- .../lib/petstore/models/read_only_first.rb | 8 +- .../lib/petstore/models/special_model_name.rb | 8 +- .../petstore/ruby/lib/petstore/models/tag.rb | 8 +- .../petstore/ruby/lib/petstore/models/user.rb | 8 +- .../ruby-on-rails/.openapi-generator/VERSION | 2 +- .../app/controllers/pet_controller.rb | 2 +- .../app/controllers/store_controller.rb | 2 +- .../app/controllers/user_controller.rb | 2 +- .../ruby-on-rails/app/models/api_response.rb | 2 +- .../ruby-on-rails/app/models/category.rb | 2 +- .../ruby-on-rails/app/models/inline_object.rb | 14 ++ .../app/models/inline_object_1.rb | 14 ++ .../ruby-on-rails/app/models/order.rb | 2 +- .../petstore/ruby-on-rails/app/models/pet.rb | 2 +- .../petstore/ruby-on-rails/app/models/tag.rb | 2 +- .../petstore/ruby-on-rails/app/models/user.rb | 2 +- .../petstore/ruby-on-rails/config/routes.rb | 2 +- .../ruby-on-rails/db/migrate/0_init_tables.rb | 16 +- .../ruby-sinatra/.openapi-generator/VERSION | 2 +- .../server/petstore/ruby-sinatra/openapi.yaml | 199 +++++++++++------- 192 files changed, 1439 insertions(+), 260 deletions(-) create mode 100644 samples/server/petstore/ruby-on-rails/app/models/inline_object.rb create mode 100644 samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb index b7b7b216a532..697dd5add951 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb index 302f3a0435b0..ffbee8ea6cda 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb index 4de535b4d10b..636f36334a28 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index d01c83cc62b2..50e91cbf3b3d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -70,6 +70,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -275,7 +281,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb index ac1a28bcc8e6..21c5c4af331a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb index 02f2e756bd89..f0c0a6d11421 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb index 6f87bf291355..915b2831ef04 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb index f3be808fa27a..3590c080637e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index fb2487e99aa1..05af8df3eda9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 1ec744fd6fc4..a2247370d44a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 3d7b6966c5ab..7b87dd1fbf15 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 1717f521e714..ba3195a2556a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 893302c2ef8f..512a6695e973 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +199,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 94bfa2273add..1716a675f205 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -51,6 +51,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +221,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 637b67a38b66..1cb300daaa4f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 6dc13cbd2b85..16ee68dc3dea 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index d7e6a1fd9eb9..5e8e9804df0a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index d24a651b6dfa..2b06d5a86f88 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 9457f2591e82..eb38f46960a8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 3d6bfce3f827..1f59d36aa436 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 61a55de7ffaa..5055e70fc8a2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index b3b26138785e..898bb5514458 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -56,6 +56,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +220,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index bdd0b1008198..9ab7d4cee183 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -68,6 +68,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +286,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index b71a8676b76e..802dee7e38bb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -32,6 +32,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index dab73dc4bcbb..b82c902dc12b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 3de19f7800b1..4b0302e8c9be 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -82,6 +82,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -496,7 +502,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 2c22b38453f3..785a9a1c3f22 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index a6770da4d348..2039613bdc83 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 3974d29af515..315df586ad82 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -64,6 +64,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +232,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 991773081e33..d9f5099e0286 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +195,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 6858f297eaef..cda74edf1124 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -35,6 +35,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +185,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 8f5040f9f376..1bde0d1342f0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index d3c3fe021c35..475162373ff2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -43,6 +43,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +208,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index b7490b8a77f1..6ce80a711222 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index e7280550f551..b8f02b525fe8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +257,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index a7155714e13c..19643e0bc4a1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 6aebd504d0a7..25a85eab7aa2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +269,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 36c5476c27c1..0f15b6bddba4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 38a7ad79b181..5a3b3f45d186 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index fe7741c5dae3..2232ebd6a318 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb index a2bb34e8710b..699c226e6040 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -46,6 +46,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -236,7 +242,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb index cb0111bcd88b..a5d1a17aaa9c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -50,6 +50,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -246,7 +252,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 34c305b5500b..94717923823e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -59,6 +59,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +239,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb index eb268f50cf5a..c938b1ec89c5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -142,6 +142,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -439,7 +445,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb index b7b7b216a532..697dd5add951 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb index 302f3a0435b0..ffbee8ea6cda 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb index 4de535b4d10b..636f36334a28 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index d01c83cc62b2..50e91cbf3b3d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -70,6 +70,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -275,7 +281,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb index ac1a28bcc8e6..21c5c4af331a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb index 02f2e756bd89..f0c0a6d11421 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb index 6f87bf291355..915b2831ef04 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb index f3be808fa27a..3590c080637e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index fb2487e99aa1..05af8df3eda9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 1ec744fd6fc4..a2247370d44a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 3d7b6966c5ab..7b87dd1fbf15 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 1717f521e714..ba3195a2556a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 893302c2ef8f..512a6695e973 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +199,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 94bfa2273add..1716a675f205 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -51,6 +51,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +221,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 637b67a38b66..1cb300daaa4f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 6dc13cbd2b85..16ee68dc3dea 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index d7e6a1fd9eb9..5e8e9804df0a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index d24a651b6dfa..2b06d5a86f88 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 9457f2591e82..eb38f46960a8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 3d6bfce3f827..1f59d36aa436 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 61a55de7ffaa..5055e70fc8a2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index b3b26138785e..898bb5514458 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -56,6 +56,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +220,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index bdd0b1008198..9ab7d4cee183 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -68,6 +68,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -280,7 +286,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index b71a8676b76e..802dee7e38bb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -32,6 +32,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index dab73dc4bcbb..b82c902dc12b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 3de19f7800b1..4b0302e8c9be 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -82,6 +82,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -496,7 +502,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 2c22b38453f3..785a9a1c3f22 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index a6770da4d348..2039613bdc83 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 3974d29af515..315df586ad82 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -64,6 +64,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +232,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 991773081e33..d9f5099e0286 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +195,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 6858f297eaef..cda74edf1124 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -35,6 +35,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +185,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 8f5040f9f376..1bde0d1342f0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index d3c3fe021c35..475162373ff2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -43,6 +43,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +208,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index b7490b8a77f1..6ce80a711222 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index e7280550f551..b8f02b525fe8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +257,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index a7155714e13c..19643e0bc4a1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 6aebd504d0a7..25a85eab7aa2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +269,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 36c5476c27c1..0f15b6bddba4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 38a7ad79b181..5a3b3f45d186 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index fe7741c5dae3..2232ebd6a318 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb index a2bb34e8710b..699c226e6040 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb @@ -46,6 +46,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -236,7 +242,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb index cb0111bcd88b..a5d1a17aaa9c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb @@ -50,6 +50,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -246,7 +252,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 34c305b5500b..94717923823e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -59,6 +59,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +239,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb index eb268f50cf5a..c938b1ec89c5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb @@ -142,6 +142,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -439,7 +445,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index db0a19529b9d..279c859efd5f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -182,7 +188,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index fb2487e99aa1..05af8df3eda9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 1ec744fd6fc4..a2247370d44a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 3d7b6966c5ab..7b87dd1fbf15 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 1717f521e714..ba3195a2556a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 893302c2ef8f..512a6695e973 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +199,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 94bfa2273add..1716a675f205 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -51,6 +51,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +221,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 637b67a38b66..1cb300daaa4f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 6dc13cbd2b85..16ee68dc3dea 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb index d7e6a1fd9eb9..5e8e9804df0a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index d24a651b6dfa..2b06d5a86f88 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 9457f2591e82..eb38f46960a8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 3d6bfce3f827..1f59d36aa436 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 61a55de7ffaa..5055e70fc8a2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index b3b26138785e..898bb5514458 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -56,6 +56,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +220,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 28adcff9fb6a..789143fa5fd8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -80,6 +80,13 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'outer_enum', + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -307,7 +314,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb index b71a8676b76e..802dee7e38bb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -32,6 +32,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index dab73dc4bcbb..b82c902dc12b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 32b1a33570ef..9fd06f3055bb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 9dc3296dfb52..5ac96e8e6c15 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -88,6 +88,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -520,7 +526,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 2c22b38453f3..785a9a1c3f22 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index ea946134b5d5..65a6ad4ca9f0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -31,6 +31,13 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'nullable_message' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index 3140ed41a420..f2941a7d6537 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index 27557505ca70..f68f25fbc83c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 73e500af56eb..2f59e5962b2f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -58,6 +58,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -218,7 +224,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 6ab144d8fd09..0c655fe711a8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -96,6 +96,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -501,7 +507,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index 255475c06f7e..d9f1cfcf09d8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index 2a213bb0c0cf..67f46f388276 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 8b5c138c1595..f3672af859fc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb index a6770da4d348..2039613bdc83 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 3974d29af515..315df586ad82 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -64,6 +64,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +232,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 991773081e33..d9f5099e0286 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +195,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 6858f297eaef..cda74edf1124 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -35,6 +35,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +185,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 8f5040f9f376..1bde0d1342f0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb index d3c3fe021c35..475162373ff2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -43,6 +43,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +208,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index 959f610a9590..bc15acb7e0b8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -74,6 +74,22 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'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 = {}) @@ -280,7 +296,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index b7490b8a77f1..6ce80a711222 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb index e7280550f551..b8f02b525fe8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +257,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index a7155714e13c..19643e0bc4a1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 6aebd504d0a7..25a85eab7aa2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +269,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 36c5476c27c1..0f15b6bddba4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 38a7ad79b181..5a3b3f45d186 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index fe7741c5dae3..2232ebd6a318 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 34c305b5500b..94717923823e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -59,6 +59,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +239,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index db0a19529b9d..279c859efd5f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -182,7 +188,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb index fb2487e99aa1..05af8df3eda9 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # discriminator's property name in OpenAPI v3 def self.openapi_discriminator_name :'class_name' @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb index 1ec744fd6fc4..a2247370d44a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 3d7b6966c5ab..7b87dd1fbf15 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 1717f521e714..ba3195a2556a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb index 893302c2ef8f..512a6695e973 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -193,7 +199,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb index 94bfa2273add..1716a675f205 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -51,6 +51,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -215,7 +221,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb index 637b67a38b66..1cb300daaa4f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 6dc13cbd2b85..16ee68dc3dea 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb index d7e6a1fd9eb9..5e8e9804df0a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb index d24a651b6dfa..2b06d5a86f88 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb index 9457f2591e82..eb38f46960a8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb index 3d6bfce3f827..1f59d36aa436 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ @@ -181,7 +187,7 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 61a55de7ffaa..5055e70fc8a2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index b3b26138785e..898bb5514458 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -56,6 +56,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -214,7 +220,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb index 28adcff9fb6a..789143fa5fd8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -80,6 +80,13 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'outer_enum', + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -307,7 +314,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb index b71a8676b76e..802dee7e38bb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb @@ -32,6 +32,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index dab73dc4bcbb..b82c902dc12b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb index 32b1a33570ef..9fd06f3055bb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -171,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb index 9dc3296dfb52..5ac96e8e6c15 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -88,6 +88,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -520,7 +526,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 2c22b38453f3..785a9a1c3f22 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb index ea946134b5d5..65a6ad4ca9f0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -31,6 +31,13 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'nullable_message' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +177,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb index 3140ed41a420..f2941a7d6537 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb index 27557505ca70..f68f25fbc83c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -180,7 +186,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 73e500af56eb..2f59e5962b2f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -58,6 +58,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -218,7 +224,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 6ab144d8fd09..0c655fe711a8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -96,6 +96,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -501,7 +507,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb index 255475c06f7e..d9f1cfcf09d8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -190,7 +196,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb index 2a213bb0c0cf..67f46f388276 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -36,6 +36,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -185,7 +191,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 8b5c138c1595..f3672af859fc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb index a6770da4d348..2039613bdc83 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb index 3974d29af515..315df586ad82 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -64,6 +64,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -226,7 +232,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 991773081e33..d9f5099e0286 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -189,7 +195,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb index 6858f297eaef..cda74edf1124 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -35,6 +35,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -179,7 +185,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb index 8f5040f9f376..1bde0d1342f0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -31,6 +31,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -170,7 +176,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb index d3c3fe021c35..475162373ff2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb @@ -43,6 +43,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -202,7 +208,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb index 959f610a9590..bc15acb7e0b8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -74,6 +74,22 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + :'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 = {}) @@ -280,7 +296,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb index b7490b8a77f1..6ce80a711222 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb index e7280550f551..b8f02b525fe8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -251,7 +257,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb index a7155714e13c..19643e0bc4a1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -38,6 +38,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -187,7 +193,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb index 6aebd504d0a7..25a85eab7aa2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb @@ -73,6 +73,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -263,7 +269,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 36c5476c27c1..0f15b6bddba4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 38a7ad79b181..5a3b3f45d186 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -30,6 +30,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -169,7 +175,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb index fe7741c5dae3..2232ebd6a318 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb @@ -34,6 +34,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -178,7 +184,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb index 34c305b5500b..94717923823e 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb @@ -59,6 +59,12 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + [ + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -233,7 +239,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + next if value.nil? && !self.class.openapi_nullable.include?(attr) hash[param] = _to_hash(value) end hash diff --git a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION index 4395ff592326..d168f1d8bdaa 100644 --- a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb index 8b0bdc79ca8f..dfff064d1451 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/pet_controller.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb index 2f9652e99def..ba2a41feeaa9 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/store_controller.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb b/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb index 33e22a3b8da4..2fe71c35b172 100644 --- a/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb +++ b/samples/server/petstore/ruby-on-rails/app/controllers/user_controller.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/api_response.rb b/samples/server/petstore/ruby-on-rails/app/models/api_response.rb index 310396b1d774..0c1e6d50b9a4 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/api_response.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/api_response.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/category.rb b/samples/server/petstore/ruby-on-rails/app/models/category.rb index 2063e8d9b43a..49063118caec 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/category.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/category.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb b/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb new file mode 100644 index 000000000000..0295f078e06b --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/app/models/inline_object.rb @@ -0,0 +1,14 @@ +=begin +OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 +Generated by: https://github.com/openapitools/openapi-generator.git + +=end + + +class InlineObject < ApplicationRecord + +end diff --git a/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb b/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb new file mode 100644 index 000000000000..b8a3bcb66cd0 --- /dev/null +++ b/samples/server/petstore/ruby-on-rails/app/models/inline_object_1.rb @@ -0,0 +1,14 @@ +=begin +OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +The version of the OpenAPI document: 1.0.0 +Generated by: https://github.com/openapitools/openapi-generator.git + +=end + + +class InlineObject1 < ApplicationRecord + +end diff --git a/samples/server/petstore/ruby-on-rails/app/models/order.rb b/samples/server/petstore/ruby-on-rails/app/models/order.rb index 8c08266bb8ba..5bf6bc33f560 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/order.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/order.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/pet.rb b/samples/server/petstore/ruby-on-rails/app/models/pet.rb index b749610040a8..be067cf6eca8 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/pet.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/pet.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/tag.rb b/samples/server/petstore/ruby-on-rails/app/models/tag.rb index 302ed77e3346..b949dfb574ba 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/tag.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/tag.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/app/models/user.rb b/samples/server/petstore/ruby-on-rails/app/models/user.rb index 8df3aa77ef36..53263747e9b4 100644 --- a/samples/server/petstore/ruby-on-rails/app/models/user.rb +++ b/samples/server/petstore/ruby-on-rails/app/models/user.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/config/routes.rb b/samples/server/petstore/ruby-on-rails/config/routes.rb index 98a423786e5c..6b591017a9eb 100644 --- a/samples/server/petstore/ruby-on-rails/config/routes.rb +++ b/samples/server/petstore/ruby-on-rails/config/routes.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end diff --git a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb index ba2dfae7f042..fbf324f2d198 100644 --- a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb +++ b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapitools/openapi-generator.git =end @@ -25,6 +25,20 @@ def change t.timestamps end + create_table "inline_object".pluralize.to_sym, id: false do |t| + t.string :name + t.string :status + + t.timestamps + end + + create_table "inline_object_1".pluralize.to_sym, id: false do |t| + t.string :additional_metadata + t.File :file + + t.timestamps + end + create_table "order".pluralize.to_sym, id: false do |t| t.integer :id t.integer :pet_id diff --git a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION index dde25ef08e8c..d168f1d8bdaa 100644 --- a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-sinatra/openapi.yaml b/samples/server/petstore/ruby-sinatra/openapi.yaml index c0b60f85ddeb..b8e8bf1ec35b 100644 --- a/samples/server/petstore/ruby-sinatra/openapi.yaml +++ b/samples/server/petstore/ruby-sinatra/openapi.yaml @@ -1,11 +1,15 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: - description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -20,18 +24,9 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -43,24 +38,13 @@ paths: put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found 405: - content: {} description: Validation exception security: - petstore_auth: @@ -104,11 +88,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -116,7 +98,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -144,11 +127,9 @@ paths: type: array description: successful operation 400: - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -157,20 +138,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 400: - content: {} description: Invalid pet value security: - petstore_auth: @@ -184,12 +169,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: 200: content: @@ -201,10 +188,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Pet not found security: - api_key: [] @@ -215,13 +200,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -232,9 +220,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: 405: - content: {} description: Invalid input security: - petstore_auth: @@ -248,13 +236,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -266,6 +257,7 @@ paths: description: file to upload format: binary type: string + type: object responses: 200: content: @@ -304,7 +296,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -320,37 +312,39 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid Order summary: Place an order for a pet tags: - store /store/order/{orderId}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Delete purchase order by ID tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -359,6 +353,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: 200: content: @@ -370,10 +365,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation 400: - content: {} description: Invalid ID supplied 404: - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -384,15 +377,16 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Create user tags: - user @@ -400,18 +394,12 @@ paths: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -419,18 +407,12 @@ paths: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user @@ -439,17 +421,22 @@ paths: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: 200: content: @@ -461,18 +448,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `auth_cookie` + apiKey authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string + style: simple 400: - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -482,8 +480,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Logs out current logged in user session tags: - user @@ -493,18 +492,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Delete user tags: - user @@ -512,11 +513,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: 200: content: @@ -528,10 +531,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation 400: - content: {} description: Invalid username supplied 404: - content: {} description: User not found summary: Get user by user name tags: @@ -541,29 +542,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: 400: - content: {} description: Invalid user supplied 404: - content: {} description: User not found + security: + - auth_cookie: [] summary: Updated user tags: - user components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -611,6 +644,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -736,6 +770,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: @@ -749,3 +802,7 @@ components: in: header name: api_key type: apiKey + auth_cookie: + in: cookie + name: AUTH_KEY + type: apiKey From ccc0f79c7f23159047bc2e50da9c21a41a85af4a Mon Sep 17 00:00:00 2001 From: Martin Slemr Date: Wed, 6 Nov 2019 17:32:55 +0100 Subject: [PATCH 3/3] [Ruby] openapi_nullable as a Set and skipping attrs fix --- .../ruby-client/base_object.mustache | 6 +++- .../partial_model_generic.mustache | 6 ++-- .../models/additional_properties_any_type.rb | 10 +++++-- .../models/additional_properties_array.rb | 10 +++++-- .../models/additional_properties_boolean.rb | 10 +++++-- .../models/additional_properties_class.rb | 10 +++++-- .../models/additional_properties_integer.rb | 10 +++++-- .../models/additional_properties_number.rb | 10 +++++-- .../models/additional_properties_object.rb | 10 +++++-- .../models/additional_properties_string.rb | 10 +++++-- .../lib/petstore/models/animal.rb | 10 +++++-- .../lib/petstore/models/api_response.rb | 10 +++++-- .../models/array_of_array_of_number_only.rb | 10 +++++-- .../petstore/models/array_of_number_only.rb | 10 +++++-- .../lib/petstore/models/array_test.rb | 10 +++++-- .../lib/petstore/models/capitalization.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/cat.rb | 10 +++++-- .../lib/petstore/models/cat_all_of.rb | 10 +++++-- .../lib/petstore/models/category.rb | 10 +++++-- .../lib/petstore/models/class_model.rb | 10 +++++-- .../lib/petstore/models/client.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/dog.rb | 10 +++++-- .../lib/petstore/models/dog_all_of.rb | 10 +++++-- .../lib/petstore/models/enum_arrays.rb | 10 +++++-- .../lib/petstore/models/enum_test.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/file.rb | 10 +++++-- .../petstore/models/file_schema_test_class.rb | 10 +++++-- .../lib/petstore/models/format_test.rb | 10 +++++-- .../lib/petstore/models/has_only_read_only.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/list.rb | 10 +++++-- .../lib/petstore/models/map_test.rb | 10 +++++-- ...perties_and_additional_properties_class.rb | 10 +++++-- .../lib/petstore/models/model200_response.rb | 10 +++++-- .../lib/petstore/models/model_return.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/name.rb | 10 +++++-- .../lib/petstore/models/number_only.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/order.rb | 10 +++++-- .../lib/petstore/models/outer_composite.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/pet.rb | 10 +++++-- .../lib/petstore/models/read_only_first.rb | 10 +++++-- .../lib/petstore/models/special_model_name.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/tag.rb | 10 +++++-- .../petstore/models/type_holder_default.rb | 10 +++++-- .../petstore/models/type_holder_example.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/user.rb | 10 +++++-- .../lib/petstore/models/xml_item.rb | 10 +++++-- .../models/additional_properties_any_type.rb | 10 +++++-- .../models/additional_properties_array.rb | 10 +++++-- .../models/additional_properties_boolean.rb | 10 +++++-- .../models/additional_properties_class.rb | 10 +++++-- .../models/additional_properties_integer.rb | 10 +++++-- .../models/additional_properties_number.rb | 10 +++++-- .../models/additional_properties_object.rb | 10 +++++-- .../models/additional_properties_string.rb | 10 +++++-- .../ruby/lib/petstore/models/animal.rb | 10 +++++-- .../ruby/lib/petstore/models/api_response.rb | 10 +++++-- .../models/array_of_array_of_number_only.rb | 10 +++++-- .../petstore/models/array_of_number_only.rb | 10 +++++-- .../ruby/lib/petstore/models/array_test.rb | 10 +++++-- .../lib/petstore/models/capitalization.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/cat.rb | 10 +++++-- .../ruby/lib/petstore/models/cat_all_of.rb | 10 +++++-- .../ruby/lib/petstore/models/category.rb | 10 +++++-- .../ruby/lib/petstore/models/class_model.rb | 10 +++++-- .../ruby/lib/petstore/models/client.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/dog.rb | 10 +++++-- .../ruby/lib/petstore/models/dog_all_of.rb | 10 +++++-- .../ruby/lib/petstore/models/enum_arrays.rb | 10 +++++-- .../ruby/lib/petstore/models/enum_test.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/file.rb | 10 +++++-- .../petstore/models/file_schema_test_class.rb | 10 +++++-- .../ruby/lib/petstore/models/format_test.rb | 10 +++++-- .../lib/petstore/models/has_only_read_only.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/list.rb | 10 +++++-- .../ruby/lib/petstore/models/map_test.rb | 10 +++++-- ...perties_and_additional_properties_class.rb | 10 +++++-- .../lib/petstore/models/model200_response.rb | 10 +++++-- .../ruby/lib/petstore/models/model_return.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/name.rb | 10 +++++-- .../ruby/lib/petstore/models/number_only.rb | 10 +++++-- .../ruby/lib/petstore/models/order.rb | 10 +++++-- .../lib/petstore/models/outer_composite.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/pet.rb | 10 +++++-- .../lib/petstore/models/read_only_first.rb | 10 +++++-- .../lib/petstore/models/special_model_name.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/tag.rb | 10 +++++-- .../petstore/models/type_holder_default.rb | 10 +++++-- .../petstore/models/type_holder_example.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/user.rb | 10 +++++-- .../ruby/lib/petstore/models/xml_item.rb | 10 +++++-- .../models/additional_properties_class.rb | 10 +++++-- .../lib/petstore/models/animal.rb | 10 +++++-- .../lib/petstore/models/api_response.rb | 10 +++++-- .../models/array_of_array_of_number_only.rb | 10 +++++-- .../petstore/models/array_of_number_only.rb | 10 +++++-- .../lib/petstore/models/array_test.rb | 10 +++++-- .../lib/petstore/models/capitalization.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/cat.rb | 10 +++++-- .../lib/petstore/models/cat_all_of.rb | 10 +++++-- .../lib/petstore/models/category.rb | 10 +++++-- .../lib/petstore/models/class_model.rb | 10 +++++-- .../lib/petstore/models/client.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/dog.rb | 10 +++++-- .../lib/petstore/models/dog_all_of.rb | 10 +++++-- .../lib/petstore/models/enum_arrays.rb | 10 +++++-- .../lib/petstore/models/enum_test.rb | 12 +++++--- .../ruby-faraday/lib/petstore/models/file.rb | 10 +++++-- .../petstore/models/file_schema_test_class.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/foo.rb | 10 +++++-- .../lib/petstore/models/format_test.rb | 10 +++++-- .../lib/petstore/models/has_only_read_only.rb | 10 +++++-- .../petstore/models/health_check_result.rb | 12 +++++--- .../lib/petstore/models/inline_object.rb | 10 +++++-- .../lib/petstore/models/inline_object1.rb | 10 +++++-- .../lib/petstore/models/inline_object2.rb | 10 +++++-- .../lib/petstore/models/inline_object3.rb | 10 +++++-- .../lib/petstore/models/inline_object4.rb | 10 +++++-- .../lib/petstore/models/inline_object5.rb | 10 +++++-- .../models/inline_response_default.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/list.rb | 10 +++++-- .../lib/petstore/models/map_test.rb | 10 +++++-- ...perties_and_additional_properties_class.rb | 10 +++++-- .../lib/petstore/models/model200_response.rb | 10 +++++-- .../lib/petstore/models/model_return.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/name.rb | 10 +++++-- .../lib/petstore/models/nullable_class.rb | 30 +++++++++++-------- .../lib/petstore/models/number_only.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/order.rb | 10 +++++-- .../lib/petstore/models/outer_composite.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/pet.rb | 10 +++++-- .../lib/petstore/models/read_only_first.rb | 10 +++++-- .../lib/petstore/models/special_model_name.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/tag.rb | 10 +++++-- .../ruby-faraday/lib/petstore/models/user.rb | 10 +++++-- .../models/additional_properties_class.rb | 10 +++++-- .../ruby/lib/petstore/models/animal.rb | 10 +++++-- .../ruby/lib/petstore/models/api_response.rb | 10 +++++-- .../models/array_of_array_of_number_only.rb | 10 +++++-- .../petstore/models/array_of_number_only.rb | 10 +++++-- .../ruby/lib/petstore/models/array_test.rb | 10 +++++-- .../lib/petstore/models/capitalization.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/cat.rb | 10 +++++-- .../ruby/lib/petstore/models/cat_all_of.rb | 10 +++++-- .../ruby/lib/petstore/models/category.rb | 10 +++++-- .../ruby/lib/petstore/models/class_model.rb | 10 +++++-- .../ruby/lib/petstore/models/client.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/dog.rb | 10 +++++-- .../ruby/lib/petstore/models/dog_all_of.rb | 10 +++++-- .../ruby/lib/petstore/models/enum_arrays.rb | 10 +++++-- .../ruby/lib/petstore/models/enum_test.rb | 12 +++++--- .../petstore/ruby/lib/petstore/models/file.rb | 10 +++++-- .../petstore/models/file_schema_test_class.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/foo.rb | 10 +++++-- .../ruby/lib/petstore/models/format_test.rb | 10 +++++-- .../lib/petstore/models/has_only_read_only.rb | 10 +++++-- .../petstore/models/health_check_result.rb | 12 +++++--- .../ruby/lib/petstore/models/inline_object.rb | 10 +++++-- .../lib/petstore/models/inline_object1.rb | 10 +++++-- .../lib/petstore/models/inline_object2.rb | 10 +++++-- .../lib/petstore/models/inline_object3.rb | 10 +++++-- .../lib/petstore/models/inline_object4.rb | 10 +++++-- .../lib/petstore/models/inline_object5.rb | 10 +++++-- .../models/inline_response_default.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/list.rb | 10 +++++-- .../ruby/lib/petstore/models/map_test.rb | 10 +++++-- ...perties_and_additional_properties_class.rb | 10 +++++-- .../lib/petstore/models/model200_response.rb | 10 +++++-- .../ruby/lib/petstore/models/model_return.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/name.rb | 10 +++++-- .../lib/petstore/models/nullable_class.rb | 30 +++++++++++-------- .../ruby/lib/petstore/models/number_only.rb | 10 +++++-- .../ruby/lib/petstore/models/order.rb | 10 +++++-- .../lib/petstore/models/outer_composite.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/pet.rb | 10 +++++-- .../lib/petstore/models/read_only_first.rb | 10 +++++-- .../lib/petstore/models/special_model_name.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/tag.rb | 10 +++++-- .../petstore/ruby/lib/petstore/models/user.rb | 10 +++++-- 178 files changed, 1264 insertions(+), 556 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache index 0467bd183fed..cf4a62a99eb2 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache @@ -87,7 +87,11 @@ hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache index b5c360e902b4..536d8f2926be 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/partial_model_generic.mustache @@ -53,13 +53,13 @@ # List of attributes with nullable: true def self.openapi_nullable - [ + Set.new([ {{#vars}} {{#isNullable}} - :'{{{name}}}'{{#hasMore}},{{/hasMore}} + :'{{{name}}}'{{#hasMore}},{{/hasMore}} {{/isNullable}} {{/vars}} - ] + ]) end {{#anyOf}} diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb index 697dd5add951..dc63ea992146 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb index ffbee8ea6cda..11fc4b70ec12 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb index 636f36334a28..a9f2ee1eb28d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 50e91cbf3b3d..bdf557c94a9c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -72,8 +72,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -281,7 +281,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb index 21c5c4af331a..2dc0bfc3136d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb index f0c0a6d11421..9736beb023e6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb index 915b2831ef04..cc08e89a1cd9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb index 3590c080637e..d85c3e4b0237 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 05af8df3eda9..abc65e4d227c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # discriminator's property name in OpenAPI v3 @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index a2247370d44a..17835d6215bc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 7b87dd1fbf15..5abad943b7ba 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index ba3195a2556a..16e11fbcd7a5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 512a6695e973..3f2b0883805f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -199,7 +199,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 1716a675f205..2fa82ea749e3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -53,8 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -221,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 1cb300daaa4f..66983cbfd5e1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 16ee68dc3dea..29514833eba1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 5e8e9804df0a..4e535ea49788 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 2b06d5a86f88..fd1c582de00f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index eb38f46960a8..59cbd23b927d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 1f59d36aa436..4b06d9e93e9d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 5055e70fc8a2..edbc2d01be84 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 898bb5514458..7bcce6fcbdb2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -58,8 +58,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -220,7 +220,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 9ab7d4cee183..f9d30fffc798 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -70,8 +70,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -286,7 +286,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 802dee7e38bb..76a98abaa7bf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -34,8 +34,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index b82c902dc12b..55ae9ed867b6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 4b0302e8c9be..409ed2ea0f53 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -84,8 +84,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -502,7 +502,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 785a9a1c3f22..56cf4f959626 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 2039613bdc83..24d06293854f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 315df586ad82..2445ce5a3616 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -66,8 +66,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -232,7 +232,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index d9f5099e0286..829b4c83c493 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -195,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index cda74edf1124..2cc48793f574 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -37,8 +37,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -185,7 +185,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 1bde0d1342f0..b2b054e82c98 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 475162373ff2..c2c0f728c680 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -45,8 +45,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -208,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 6ce80a711222..cb8739074c0a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index b8f02b525fe8..9d025ec60aa4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -257,7 +257,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 19643e0bc4a1..f17fd5ed9902 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 25a85eab7aa2..d2e84bb116c6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -269,7 +269,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 0f15b6bddba4..a0c6236adf6a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 5a3b3f45d186..d31b38e75709 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 2232ebd6a318..548cf6e660bb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb index 699c226e6040..8588a5679afe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -48,8 +48,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -242,7 +242,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb index a5d1a17aaa9c..9669dd9ee4b7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -52,8 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -252,7 +252,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 94717923823e..cc5b83b62b05 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -61,8 +61,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -239,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb index c938b1ec89c5..3a5771b4bcaf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -144,8 +144,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -445,7 +445,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb index 697dd5add951..dc63ea992146 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_any_type.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb index ffbee8ea6cda..11fc4b70ec12 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_array.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb index 636f36334a28..a9f2ee1eb28d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_boolean.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 50e91cbf3b3d..bdf557c94a9c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -72,8 +72,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -281,7 +281,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb index 21c5c4af331a..2dc0bfc3136d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_integer.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb index f0c0a6d11421..9736beb023e6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_number.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb index 915b2831ef04..cc08e89a1cd9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_object.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb index 3590c080637e..d85c3e4b0237 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_string.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 05af8df3eda9..abc65e4d227c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # discriminator's property name in OpenAPI v3 @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index a2247370d44a..17835d6215bc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 7b87dd1fbf15..5abad943b7ba 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index ba3195a2556a..16e11fbcd7a5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 512a6695e973..3f2b0883805f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -199,7 +199,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 1716a675f205..2fa82ea749e3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -53,8 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -221,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 1cb300daaa4f..66983cbfd5e1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 16ee68dc3dea..29514833eba1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 5e8e9804df0a..4e535ea49788 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index 2b06d5a86f88..fd1c582de00f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index eb38f46960a8..59cbd23b927d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 1f59d36aa436..4b06d9e93e9d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 5055e70fc8a2..edbc2d01be84 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 898bb5514458..7bcce6fcbdb2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -58,8 +58,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -220,7 +220,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 9ab7d4cee183..f9d30fffc798 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -70,8 +70,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -286,7 +286,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 802dee7e38bb..76a98abaa7bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -34,8 +34,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index b82c902dc12b..55ae9ed867b6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 4b0302e8c9be..409ed2ea0f53 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -84,8 +84,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -502,7 +502,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 785a9a1c3f22..56cf4f959626 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 2039613bdc83..24d06293854f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 315df586ad82..2445ce5a3616 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -66,8 +66,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -232,7 +232,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index d9f5099e0286..829b4c83c493 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -195,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index cda74edf1124..2cc48793f574 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -37,8 +37,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -185,7 +185,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 1bde0d1342f0..b2b054e82c98 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 475162373ff2..c2c0f728c680 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -45,8 +45,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -208,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 6ce80a711222..cb8739074c0a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index b8f02b525fe8..9d025ec60aa4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -257,7 +257,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 19643e0bc4a1..f17fd5ed9902 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 25a85eab7aa2..d2e84bb116c6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -269,7 +269,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 0f15b6bddba4..a0c6236adf6a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 5a3b3f45d186..d31b38e75709 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 2232ebd6a318..548cf6e660bb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb index 699c226e6040..8588a5679afe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_default.rb @@ -48,8 +48,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -242,7 +242,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb index a5d1a17aaa9c..9669dd9ee4b7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/type_holder_example.rb @@ -52,8 +52,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -252,7 +252,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 94717923823e..cc5b83b62b05 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -61,8 +61,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -239,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb index c938b1ec89c5..3a5771b4bcaf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/xml_item.rb @@ -144,8 +144,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -445,7 +445,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 279c859efd5f..bda9712d12af 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -188,7 +188,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 05af8df3eda9..abc65e4d227c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # discriminator's property name in OpenAPI v3 @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index a2247370d44a..17835d6215bc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 7b87dd1fbf15..5abad943b7ba 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index ba3195a2556a..16e11fbcd7a5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 512a6695e973..3f2b0883805f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -199,7 +199,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 1716a675f205..2fa82ea749e3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -53,8 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -221,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 1cb300daaa4f..66983cbfd5e1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 16ee68dc3dea..29514833eba1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 5e8e9804df0a..4e535ea49788 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 2b06d5a86f88..fd1c582de00f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb index eb38f46960a8..59cbd23b927d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 1f59d36aa436..4b06d9e93e9d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 5055e70fc8a2..edbc2d01be84 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 898bb5514458..7bcce6fcbdb2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -58,8 +58,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -220,7 +220,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 789143fa5fd8..ec4d96613617 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -82,9 +82,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'outer_enum', - ] + Set.new([ + :'outer_enum', + ]) end # Initializes the object @@ -314,7 +314,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 802dee7e38bb..76a98abaa7bf 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -34,8 +34,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index b82c902dc12b..55ae9ed867b6 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 9fd06f3055bb..6742735e38a5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 5ac96e8e6c15..b70408419487 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -90,8 +90,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -526,7 +526,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 785a9a1c3f22..56cf4f959626 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 65a6ad4ca9f0..9366423e0b7c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -33,9 +33,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'nullable_message' - ] + Set.new([ + :'nullable_message' + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index f2941a7d6537..a43f8f5664ab 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index f68f25fbc83c..932e507dc15c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 2f59e5962b2f..1f8d88c018dc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -60,8 +60,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -224,7 +224,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 0c655fe711a8..ae4cf54c66a4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -98,8 +98,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -507,7 +507,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index d9f1cfcf09d8..32034cbef4fc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index 67f46f388276..245c45e58d5d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index f3672af859fc..81e29fe689f0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 2039613bdc83..24d06293854f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 315df586ad82..2445ce5a3616 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -66,8 +66,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -232,7 +232,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index d9f5099e0286..829b4c83c493 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -195,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index cda74edf1124..2cc48793f574 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -37,8 +37,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -185,7 +185,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 1bde0d1342f0..b2b054e82c98 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 475162373ff2..c2c0f728c680 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -45,8 +45,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -208,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index bc15acb7e0b8..fb7ad5cf332b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -76,18 +76,18 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'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', - ] + 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 @@ -296,7 +296,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 6ce80a711222..cb8739074c0a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb index b8f02b525fe8..9d025ec60aa4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -257,7 +257,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 19643e0bc4a1..f17fd5ed9902 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 25a85eab7aa2..d2e84bb116c6 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -269,7 +269,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 0f15b6bddba4..a0c6236adf6a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 5a3b3f45d186..d31b38e75709 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 2232ebd6a318..548cf6e660bb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 94717923823e..cc5b83b62b05 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -61,8 +61,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -239,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 279c859efd5f..bda9712d12af 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -188,7 +188,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb index 05af8df3eda9..abc65e4d227c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # discriminator's property name in OpenAPI v3 @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb index a2247370d44a..17835d6215bc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 7b87dd1fbf15..5abad943b7ba 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index ba3195a2556a..16e11fbcd7a5 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb index 512a6695e973..3f2b0883805f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -199,7 +199,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb index 1716a675f205..2fa82ea749e3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -53,8 +53,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -221,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb index 1cb300daaa4f..66983cbfd5e1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 16ee68dc3dea..29514833eba1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb index 5e8e9804df0a..4e535ea49788 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb index 2b06d5a86f88..fd1c582de00f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb index eb38f46960a8..59cbd23b927d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb index 1f59d36aa436..4b06d9e93e9d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # List of class defined in allOf (OpenAPI v3) @@ -187,7 +187,11 @@ def to_hash hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 5055e70fc8a2..edbc2d01be84 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 898bb5514458..7bcce6fcbdb2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -58,8 +58,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -220,7 +220,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb index 789143fa5fd8..ec4d96613617 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -82,9 +82,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'outer_enum', - ] + Set.new([ + :'outer_enum', + ]) end # Initializes the object @@ -314,7 +314,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb index 802dee7e38bb..76a98abaa7bf 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb @@ -34,8 +34,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index b82c902dc12b..55ae9ed867b6 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb index 9fd06f3055bb..6742735e38a5 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb index 5ac96e8e6c15..b70408419487 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -90,8 +90,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -526,7 +526,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 785a9a1c3f22..56cf4f959626 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 65a6ad4ca9f0..9366423e0b7c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -33,9 +33,9 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'nullable_message' - ] + Set.new([ + :'nullable_message' + ]) end # Initializes the object @@ -177,7 +177,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb index f2941a7d6537..a43f8f5664ab 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb index f68f25fbc83c..932e507dc15c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -186,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 2f59e5962b2f..1f8d88c018dc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -60,8 +60,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -224,7 +224,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 0c655fe711a8..ae4cf54c66a4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -98,8 +98,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -507,7 +507,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb index d9f1cfcf09d8..32034cbef4fc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -196,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb index 67f46f388276..245c45e58d5d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -38,8 +38,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -191,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index f3672af859fc..81e29fe689f0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb index 2039613bdc83..24d06293854f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb index 315df586ad82..2445ce5a3616 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -66,8 +66,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -232,7 +232,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index d9f5099e0286..829b4c83c493 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -195,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb index cda74edf1124..2cc48793f574 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -37,8 +37,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -185,7 +185,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb index 1bde0d1342f0..b2b054e82c98 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -33,8 +33,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -176,7 +176,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb index 475162373ff2..c2c0f728c680 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb @@ -45,8 +45,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -208,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb index bc15acb7e0b8..fb7ad5cf332b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -76,18 +76,18 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - :'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', - ] + 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 @@ -296,7 +296,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb index 6ce80a711222..cb8739074c0a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb index b8f02b525fe8..9d025ec60aa4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -257,7 +257,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 19643e0bc4a1..f17fd5ed9902 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -40,8 +40,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -193,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb index 25a85eab7aa2..d2e84bb116c6 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb @@ -75,8 +75,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -269,7 +269,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 0f15b6bddba4..a0c6236adf6a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 5a3b3f45d186..d31b38e75709 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -32,8 +32,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -175,7 +175,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb index 2232ebd6a318..548cf6e660bb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb @@ -36,8 +36,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -184,7 +184,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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 diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb index 94717923823e..cc5b83b62b05 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb @@ -61,8 +61,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable - [ - ] + Set.new([ + ]) end # Initializes the object @@ -239,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? && !self.class.openapi_nullable.include?(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