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

change Order id to only allow string #108

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ none

### Changed

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

### Deprecated

Expand Down
3 changes: 1 addition & 2 deletions src/stapi_fastapi/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
BaseModel,
ConfigDict,
Field,
StrictInt,
StrictStr,
)

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

Expand Down