lib/lutaml/xmi/parsers/xml.rb in lutaml-xmi-0.1.3 vs lib/lutaml/xmi/parsers/xml.rb in lutaml-xmi-0.1.4
- old
+ new
@@ -89,10 +89,10 @@
def serialize_model_associations(klass)
xmi_id = klass["xmi:id"]
main_model.xpath(%(//element[@xmi:idref="#{xmi_id}"]/links/*)).map do |link|
member_end, member_end_type, member_end_cardinality, member_end_attribute_name = serialize_member_type(xmi_id, link)
- if member_end && member_end != klass["name"]
+ if member_end && ((member_end_type != 'aggregation') || (member_end_type == 'aggregation' && member_end_attribute_name))
{
xmi_id: link["xmi:id"],
member_end: member_end,
member_end_type: member_end_type,
member_end_cardinality: member_end_cardinality,