-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-introduce merging enumeration unions
This was supposed to be fixed
- Loading branch information
Showing
7 changed files
with
127 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
from enum import Enum | ||
from dataclasses import dataclass, field | ||
from typing import Optional, Union | ||
from tests.fixtures.defxmlschema.chapter08.example0809 import ( | ||
SmlxsizeType, | ||
) | ||
|
||
|
||
@dataclass | ||
class XsmlxsizeType: | ||
class XsmlxsizeType(Enum): | ||
""" | ||
:ivar value: | ||
:cvar SMALL: | ||
:cvar MEDIUM: | ||
:cvar LARGE: | ||
:cvar EXTRA_LARGE: | ||
:cvar EXTRA_SMALL: | ||
""" | ||
class Meta: | ||
name = "XSMLXSizeType" | ||
|
||
value: Optional[Union[SmlxsizeType, "XsmlxsizeType.Value"]] = field( | ||
default=None, | ||
) | ||
|
||
class Value(Enum): | ||
""" | ||
:cvar EXTRA_SMALL: | ||
""" | ||
EXTRA_SMALL = "extra small" | ||
SMALL = "small" | ||
MEDIUM = "medium" | ||
LARGE = "large" | ||
EXTRA_LARGE = "extra large" | ||
EXTRA_SMALL = "extra small" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
from dataclasses import dataclass, field | ||
from typing import List | ||
from tests.fixtures.defxmlschema.chapter08.example0810 import ( | ||
SmlsizeType, | ||
) | ||
from enum import Enum | ||
|
||
|
||
@dataclass | ||
class AvailableSizesType: | ||
class AvailableSizesType(Enum): | ||
""" | ||
:ivar value: | ||
:cvar SMALL: | ||
:cvar MEDIUM: | ||
:cvar LARGE: | ||
:cvar EXTRA_LARGE: | ||
""" | ||
value: List[SmlsizeType] = field( | ||
default_factory=list, | ||
metadata=dict( | ||
min_occurs=0, | ||
max_occurs=9223372036854775807 | ||
) | ||
) | ||
SMALL = "small" | ||
MEDIUM = "medium" | ||
LARGE = "large" | ||
EXTRA_LARGE = "extra large" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
from enum import Enum | ||
from dataclasses import dataclass, field | ||
from typing import List | ||
|
||
|
||
@dataclass | ||
class AvailableSizesType: | ||
class AvailableSizesType(Enum): | ||
""" | ||
:ivar value: | ||
:cvar SMALL: | ||
:cvar MEDIUM: | ||
:cvar LARGE: | ||
""" | ||
value: List["AvailableSizesType.Value"] = field( | ||
default_factory=list, | ||
metadata=dict( | ||
min_occurs=0, | ||
max_occurs=9223372036854775807 | ||
) | ||
) | ||
|
||
class Value(Enum): | ||
""" | ||
:cvar SMALL: | ||
:cvar MEDIUM: | ||
:cvar LARGE: | ||
""" | ||
SMALL = "small" | ||
MEDIUM = "medium" | ||
LARGE = "large" | ||
SMALL = "small" | ||
MEDIUM = "medium" | ||
LARGE = "large" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters