Skip to content

Commit

Permalink
V2.0.1 - don't raise error when trying to re-use same complex type wi…
Browse files Browse the repository at this point in the history
…th same structure
  • Loading branch information
bogdanRada committed Feb 29, 2020
1 parent 1968687 commit 3026c44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/washout_builder/document/complex_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/washout_builder/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3026c44

Please sign in to comment.