Skip to content

Commit

Permalink
Update restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Jun 21, 2021
1 parent 09ff172 commit adf96af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xsdata/codegen/handlers/attribute_restrictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit adf96af

Please sign in to comment.