From 3026c443e337e19ea21ea20d13214c293de665b4 Mon Sep 17 00:00:00 2001 From: Rada Bogdan Date: Sun, 1 Mar 2020 01:38:46 +0200 Subject: [PATCH] V2.0.1 - don't raise error when trying to re-use same complex type with same structure --- lib/washout_builder/document/complex_type.rb | 4 ++-- lib/washout_builder/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/washout_builder/document/complex_type.rb b/lib/washout_builder/document/complex_type.rb index cc3ea58..2233a00 100644 --- a/lib/washout_builder/document/complex_type.rb +++ b/lib/washout_builder/document/complex_type.rb @@ -30,8 +30,8 @@ def find_complex_class_name(classes_defined = []) # @raise [RuntimeError] Raises a runtime error if is detected a duplicate use of the complex type # @api public def check_duplicate_complex_class(classes_defined, complex_class) - complex_obj_found = classes_defined.find { |hash| hash[:class] == complex_class } - raise "Duplicate use of `#{basic_type}` type name. Consider using classified types." if !complex_obj_found.nil? && struct? && !classified? + complex_obj_found = classes_defined.find { |hash| hash if hash[:class] == complex_class && hash[:obj].find_param_structure.keys != self.find_param_structure.keys } + raise "Duplicate use of `#{basic_type}` type name. Consider using classified types" if !complex_obj_found.nil? && struct? && !classified? end # finds the complex class ancestors if the current object is classified, otherwise returns nil diff --git a/lib/washout_builder/version.rb b/lib/washout_builder/version.rb index 182bdc2..79a13b4 100644 --- a/lib/washout_builder/version.rb +++ b/lib/washout_builder/version.rb @@ -12,7 +12,7 @@ module VERSION # the minor version of the gem MINOR = 0 # the tiny version of the gem - TINY = 0 + TINY = 1 # if the version should be a prerelease PRE = nil