Skip to content

Commit

Permalink
Make COM id annotated
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-haffi committed Oct 6, 2023
1 parent 5fff1b4 commit b899d5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bo4e/com/com.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from decimal import Decimal
from typing import Optional, Type, TypeVar
from typing import Annotated, Optional, Type, TypeVar

from humps.main import camelize

Expand All @@ -28,7 +28,7 @@ class COM(BaseModel):

# Python internal: The field is not named '_id' because leading underscores are not allowed in pydantic field names.
# NameError: Fields must not use names with leading underscores; e.g., use 'id' instead of '_id'.
id: Optional[str] = Field(alias="_id", default=None)
id: Annotated[Optional[str], Field(alias="_id")] = None
"""
Eine generische ID, die für eigene Zwecke genutzt werden kann.
Z.B. könnten hier UUIDs aus einer Datenbank stehen oder URLs zu einem Backend-System.
Expand Down

0 comments on commit b899d5b

Please sign in to comment.