Skip to content

Allow optional first/second in relationship elements#587

Open
JAB1305 wants to merge 2 commits into
eclipse-basyx:developfrom
rwth-iat:fix/optional-rel-element-first-second-refs
Open

Allow optional first/second in relationship elements#587
JAB1305 wants to merge 2 commits into
eclipse-basyx:developfrom
rwth-iat:fix/optional-rel-element-first-second-refs

Conversation

@JAB1305

@JAB1305 JAB1305 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Metamodel v3.1.2 changed RelationshipElement.first and second to be optional. This was missed earlier and required by JSON and XML adapters.

  • AnnotatedRelationshipElement.__init__ now accepts first and second as Optional[Reference], matching the parent class.
  • The JSON and XML deserializers treat both fields as optional default to None when absent.
  • The JSON serializer omits the fields when None (XML serializer already handled this).
  • Added tests for this behaviour.

Fixes #525

JAB1305 added 2 commits July 10, 2026 14:03
Metamodel v3.1.2 changed `RelationshipElement.first` and `second` to be optional. This was missed earlier and required by JSON and XML adapters.

- `AnnotatedRelationshipElement.__init__` now accepts `first` and `second` as `Optional[Reference]`, matching the parent class.
- The JSON and XML deserializers treat both fields as optional default to `None` when absent.
- The JSON serializer omits the fields when `None` (XML serializer already handled this).
- Added tests for this behaviour.

Fixes eclipse-basyx#525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant