Skip to content

Commit c4e96fa

Browse files
committed
Merge branch 'master' of https://github.com/Semprini/pyMDG
2 parents a9720f3 + 114713b commit c4e96fa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mdg/parse/drawio_xml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ def enumeration_parse(package: UMLPackage, element, root) -> Optional[UMLEnumera
282282
def attr_parse(parent: UMLClass, element, root, stereotypes) -> UMLAttribute:
283283
a = element.get("value")
284284
tree = html.fromstring(a)
285-
node = tree.xpath("//div")
286-
value = ''.join(node[0].itertext()).replace(" ", " ")
285+
value = tree.text_content().replace(" ", " ")
287286

288287
dq = []
289288
if "{dq_even}" in value:

mdg/uml/validate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def validate_package(package):
3636
for attr in cls.attributes:
3737
if "auto" in attr.stereotypes and attr.type not in ("int", "bigint"):
3838
errors.append(AttributeValidationError(package, cls, attr, "auto increment field must be int or bigint"))
39+
if attr.type.lower() == "decimal" and ( attr.scale == None or attr.precision == None ):
40+
errors.append(AttributeValidationError(package, cls, attr, "decimal field must have scale and precision"))
3941

4042
for child in package.children:
4143
errors += validate_package(child)

0 commit comments

Comments
 (0)