From adf96aff2ea0da52c462ea4bdb071f00661c6766 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 22 Jun 2021 00:28:52 +0300 Subject: [PATCH] Update restrictions --- xsdata/codegen/handlers/attribute_restrictions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xsdata/codegen/handlers/attribute_restrictions.py b/xsdata/codegen/handlers/attribute_restrictions.py index f4dfe125a..fdfd205de 100644 --- a/xsdata/codegen/handlers/attribute_restrictions.py +++ b/xsdata/codegen/handlers/attribute_restrictions.py @@ -28,6 +28,10 @@ def reset_occurrences(cls, attr: Attr): if max_occurs <= 1: restrictions.min_occurs = None restrictions.max_occurs = None + + if not attr.fixed: + attr.default = None + elif attr.xml_type is None or min_occurs == max_occurs == 1: restrictions.required = True restrictions.min_occurs = None