From ccc0f79c7f23159047bc2e50da9c21a41a85af4a Mon Sep 17 00:00:00 2001 From: Martin Slemr Date: Wed, 6 Nov 2019 17:32:55 +0100 Subject: [PATCH] [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