3434)
3535
3636from stapi_fastapi .constants import TYPE_JSON
37- from stapi_fastapi .exceptions import ConstraintsException , NotFoundException
37+ from stapi_fastapi .exceptions import NotFoundException , QueryablesException
3838from stapi_fastapi .models .product import Product
3939from stapi_fastapi .responses import GeoJSONResponse
4040from stapi_fastapi .routers .route_names import (
4141 CONFORMANCE ,
4242 CREATE_ORDER ,
43- GET_CONSTRAINTS ,
4443 GET_OPPORTUNITY_COLLECTION ,
4544 GET_ORDER_PARAMETERS ,
4645 GET_PRODUCT ,
46+ GET_QUERYABLES ,
4747 SEARCH_OPPORTUNITIES ,
4848)
4949
@@ -103,11 +103,11 @@ def __init__(
103103 )
104104
105105 self .add_api_route (
106- path = "/constraints " ,
107- endpoint = self .get_product_constraints ,
108- name = f"{ self .root_router .name } :{ self .product .id } :{ GET_CONSTRAINTS } " ,
106+ path = "/queryables " ,
107+ endpoint = self .get_product_queryables ,
108+ name = f"{ self .root_router .name } :{ self .product .id } :{ GET_QUERYABLES } " ,
109109 methods = ["GET" ],
110- summary = "Get constraints for the product" ,
110+ summary = "Get queryables for the product" ,
111111 tags = ["Products" ],
112112 )
113113
@@ -156,7 +156,7 @@ async def _create_order(
156156 name = f"{ self .root_router .name } :{ self .product .id } :{ SEARCH_OPPORTUNITIES } " ,
157157 methods = ["POST" ],
158158 response_class = GeoJSONResponse ,
159- # unknown why mypy can't see the constraints property on Product, ignoring
159+ # unknown why mypy can't see the queryables property on Product, ignoring
160160 response_model = OpportunityCollection [
161161 Geometry ,
162162 self .product .opportunity_properties , # type: ignore
@@ -205,10 +205,10 @@ def get_product(self, request: Request) -> ProductPydantic:
205205 Link (
206206 href = str (
207207 request .url_for (
208- f"{ self .root_router .name } :{ self .product .id } :{ GET_CONSTRAINTS } " ,
208+ f"{ self .root_router .name } :{ self .product .id } :{ GET_QUERYABLES } " ,
209209 ),
210210 ),
211- rel = "constraints " ,
211+ rel = "queryables " ,
212212 type = TYPE_JSON ,
213213 ),
214214 Link (
@@ -255,7 +255,7 @@ async def search_opportunities(
255255 prefer : Prefer | None = Depends (get_prefer ),
256256 ) -> OpportunityCollection | Response : # type: ignore
257257 """
258- Explore the opportunities available for a particular set of constraints
258+ Explore the opportunities available for a particular set of queryables
259259 """
260260 # sync
261261 if not self .root_router .supports_async_opportunity_search or (
@@ -300,7 +300,7 @@ async def search_opportunities_sync(
300300 links .append (self .pagination_link (request , search , x ))
301301 case Maybe .empty :
302302 pass
303- case Failure (e ) if isinstance (e , ConstraintsException ):
303+ case Failure (e ) if isinstance (e , QueryablesException ):
304304 raise e
305305 case Failure (e ):
306306 logger .error (
@@ -339,7 +339,7 @@ async def search_opportunities_async(
339339 content = search_record .model_dump (mode = "json" ),
340340 headers = headers ,
341341 )
342- case Failure (e ) if isinstance (e , ConstraintsException ):
342+ case Failure (e ) if isinstance (e , QueryablesException ):
343343 raise e
344344 case Failure (e ):
345345 logger .error (
@@ -359,15 +359,15 @@ def get_product_conformance(self) -> Conformance:
359359 """
360360 return Conformance .model_validate ({"conforms_to" : self .product .conformsTo })
361361
362- def get_product_constraints (self ) -> JsonSchemaModel :
362+ def get_product_queryables (self ) -> JsonSchemaModel :
363363 """
364- Return supported constraints of a specific product
364+ Return supported queryables of a specific product
365365 """
366- return self .product .constraints
366+ return self .product .queryables
367367
368368 def get_product_order_parameters (self ) -> JsonSchemaModel :
369369 """
370- Return supported constraints of a specific product
370+ Return supported order parameters of a specific product
371371 """
372372 return self .product .order_parameters
373373
@@ -385,7 +385,7 @@ async def create_order(self, payload: OrderPayload, request: Request, response:
385385 location = str (self .root_router .generate_order_href (request , order .id ))
386386 response .headers ["Location" ] = location
387387 return order # type: ignore
388- case Failure (e ) if isinstance (e , ConstraintsException ):
388+ case Failure (e ) if isinstance (e , QueryablesException ):
389389 raise e
390390 case Failure (e ):
391391 logger .error (
0 commit comments