diff --git a/dev_requirements/requirements-test.txt b/dev_requirements/requirements-test.txt index cba85110..2a12e46c 100644 --- a/dev_requirements/requirements-test.txt +++ b/dev_requirements/requirements-test.txt @@ -41,9 +41,9 @@ pandas==2.2.2 # via kohlrahbi (pyproject.toml) pluggy==1.5.0 # via pytest -pydantic==2.8.1 +pydantic==2.9.1 # via kohlrahbi (pyproject.toml) -pydantic-core==2.20.1 +pydantic-core==2.23.3 # via pydantic pytest==8.3.2 # via diff --git a/src/kohlrahbi/models/edifact_components.py b/src/kohlrahbi/models/edifact_components.py index de4d699a..0e3b27bc 100644 --- a/src/kohlrahbi/models/edifact_components.py +++ b/src/kohlrahbi/models/edifact_components.py @@ -6,7 +6,7 @@ import re from abc import ABC from enum import Enum -from typing import Callable, Iterable, Literal, Mapping, Optional +from typing import Callable, Iterable, Literal, Mapping, Optional, Union from pydantic import BaseModel, Field, StringConstraints, field_validator from typing_extensions import Annotated @@ -238,7 +238,7 @@ class Segment(SegmentLevel): A Segment contains multiple data elements. """ - data_elements: list[DataElementValuePool | DataElementFreeText] = Field(discriminator="value_type") + data_elements: list[Annotated[Union[DataElementValuePool, DataElementFreeText], Field(discriminator="value_type")]] section_name: Optional[str] = Field( default=None, description=(