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

Commit 18c7be5

Browse files
committed
type the opporunities to the product constraints model
1 parent f965f99 commit 18c7be5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/stapi_fastapi/routers/product_router.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import TYPE_CHECKING, Self
44

55
from fastapi import APIRouter, HTTPException, Request, Response, status
6+
from geojson_pydantic.geometries import Geometry
67

78
from stapi_fastapi.constants import TYPE_GEOJSON, TYPE_JSON
89
from stapi_fastapi.exceptions import ConstraintsException
@@ -46,6 +47,7 @@ def __init__(
4647
name=f"{self.root_router.name}:{self.product.id}:search-opportunities",
4748
methods=["POST"],
4849
response_class=GeoJSONResponse,
50+
response_model=OpportunityCollection[Geometry, self.product.constraints],
4951
summary="Search Opportunities for the product",
5052
)
5153

0 commit comments

Comments
 (0)