Skip to content

Commit a8eed9c

Browse files
committed
Ruby Client: nullable for build_from_hash
1 parent cef1bec commit a8eed9c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
end
2323
elsif !attributes[self.class.attribute_map[key]].nil?
2424
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
25-
end # or else data not found in attributes(hash), not an issue as the data can be optional
25+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
26+
self.send("#{key}=", nil)
27+
end
2628
end
2729

2830
self

0 commit comments

Comments
 (0)