Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit da22d32

Browse files
author
Phil Varner
authored
change Order id to only allow string (#108)
1 parent 3011357 commit da22d32

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ none
1313

1414
### Changed
1515

16-
none
16+
- Order field `id` must be a string, instead of previously allowing int. This is because while an
17+
order ID may an integral numeric value, it is not a "number" in the sense that math will be performed
18+
order ID values, so string represents this better.
1719

1820
### Deprecated
1921

src/stapi_fastapi/models/order.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
BaseModel,
99
ConfigDict,
1010
Field,
11-
StrictInt,
1211
StrictStr,
1312
)
1413

@@ -75,7 +74,7 @@ class OrderProperties(BaseModel):
7574
class Order(Feature[Geometry, OrderProperties]):
7675
# We need to enforce that orders have an id defined, as that is required to
7776
# retrieve them via the API
78-
id: StrictInt | StrictStr
77+
id: StrictStr
7978
type: Literal["Feature"] = "Feature"
8079
links: list[Link] = Field(default_factory=list)
8180

0 commit comments

Comments
 (0)