CD parser: only add ModelRefs for types that don't exist yet
This commit is contained in:
parent
d30844dddd
commit
4c4edf1963
1 changed files with 2 additions and 2 deletions
|
|
@ -122,8 +122,8 @@ def parse_cd(state, m_text):
|
||||||
if attrs != None:
|
if attrs != None:
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
(optional, attr_type, attr_name, constraint) = attr
|
(optional, attr_type, attr_name, constraint) = attr
|
||||||
# TODO: only create type ref if it doesn't exist yet
|
if state.read_dict(m, attr_type) == None:
|
||||||
cd.create_model_ref(attr_type, primitive_types[attr_type])
|
cd.create_model_ref(attr_type, primitive_types[attr_type])
|
||||||
cd.create_attribute_link(class_name, attr_type, attr_name, optional)
|
cd.create_attribute_link(class_name, attr_type, attr_name, optional)
|
||||||
if constraint != None:
|
if constraint != None:
|
||||||
_add_constraint_to_obj(f"{class_name}_{attr_name}", constraint)
|
_add_constraint_to_obj(f"{class_name}_{attr_name}", constraint)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue