Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.1: Make first and second of RelationshipElement optional #347

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions aas_core_meta/v3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2586,20 +2586,18 @@ class Relationship_element(Submodel_element):
being either referable (model reference) or external (global reference).
"""

first: "Reference"
first: Optional["Reference"]
"""
Reference to the first element in the relationship taking the role of the subject.
"""

second: "Reference"
second: Optional["Reference"]
"""
Reference to the second element in the relationship taking the role of the object.
"""

def __init__(
self,
first: "Reference",
second: "Reference",
extensions: Optional[List["Extension"]] = None,
category: Optional[Name_type] = None,
ID_short: Optional[ID_short_type] = None,
Expand All @@ -2611,6 +2609,8 @@ def __init__(
embedded_data_specifications: Optional[
List["Embedded_data_specification"]
] = None,
first: Optional["Reference"] = None,
second: Optional["Reference"] = None,
) -> None:
Submodel_element.__init__(
self,
Expand Down Expand Up @@ -3396,8 +3396,6 @@ class Annotated_relationship_element(Relationship_element):

def __init__(
self,
first: "Reference",
second: "Reference",
extensions: Optional[List["Extension"]] = None,
category: Optional[Name_type] = None,
ID_short: Optional[ID_short_type] = None,
Expand All @@ -3409,6 +3407,8 @@ def __init__(
embedded_data_specifications: Optional[
List["Embedded_data_specification"]
] = None,
first: Optional["Reference"] = None,
second: Optional["Reference"] = None,
annotations: Optional[List[Data_element]] = None,
) -> None:
Relationship_element.__init__(
Expand Down
Loading