Skip to content

Commit 5568c1a

Browse files
committed
enough
1 parent 79e62bf commit 5568c1a

3 files changed

Lines changed: 81 additions & 118 deletions

File tree

pystapi-schema-generator/src/pystapi_schema_generator/application.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,40 @@ def create_app() -> FastAPI:
1010
app = FastAPI(
1111
title="STAPI API",
1212
description=(
13-
"Implementation of the STAPI specification. This API provides endpoints for discovering remote "
14-
"sensing data products, creating orders, and searching for acquisition opportunities across various "
15-
"remote sensing platforms and sensors. The API follows the STAPI specification for standardized "
16-
"interaction with remote sensing data providers."
13+
"The Sensor Tasking API (STAPI) defines a JSON-based web API to query for "
14+
"spatio-temporal analytic and data products derived from remote sensing "
15+
"(satellite or airborne) providers. The specification supports both products "
16+
"derived from new tasking and products from provider archives."
1717
),
1818
version=STAPI_VERSION,
1919
openapi_tags=[
2020
{
2121
"name": "Core",
22-
"description": (
23-
"Core endpoints for API discovery and metadata. These endpoints provide "
24-
"essential information about the API's capabilities and available resources."
25-
),
22+
"description": "Core endpoints for API discovery and metadata.",
2623
"externalDocs": {
2724
"description": "STAPI Core Specification",
2825
"url": "https://github.com/stapi-spec/stapi-spec/blob/main/core/README.md",
2926
},
3027
},
3128
{
3229
"name": "Products",
33-
"description": (
34-
"Endpoints for discovering and accessing remote sensing data products. "
35-
"Each product endpoint provides detailed metadata, queryable properties, "
36-
"and order parameters specific to that product."
37-
),
30+
"description": "Endpoints for discovering and accessing remote sensing data products.",
3831
"externalDocs": {
3932
"description": "STAPI Product Specification",
4033
"url": "https://github.com/stapi-spec/stapi-spec/blob/main/product/README.md",
4134
},
4235
},
4336
{
4437
"name": "Orders",
45-
"description": (
46-
"Endpoints for creating and managing remote sensing data orders. "
47-
"Supports order creation, status tracking, and delivery management "
48-
"with comprehensive state machine implementation."
49-
),
38+
"description": "Endpoints for creating and managing remote sensing data orders.",
5039
"externalDocs": {
5140
"description": "STAPI Order Specification",
5241
"url": "https://github.com/stapi-spec/stapi-spec/blob/main/order/README.md",
5342
},
5443
},
5544
{
5645
"name": "Opportunities",
57-
"description": (
58-
"Endpoints for searching remote sensing acquisition opportunities. "
59-
"Supports both synchronous and asynchronous search modes with "
60-
"spatial, temporal, and property-based filtering."
61-
),
46+
"description": "Endpoints for searching remote sensing acquisition opportunities.",
6247
"externalDocs": {
6348
"description": "STAPI Opportunity Specification",
6449
"url": "https://github.com/stapi-spec/stapi-spec/blob/main/opportunity/README.md",

pystapi-schema-generator/src/pystapi_schema_generator/product_router.py

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,10 @@ def _setup_routes(self) -> None:
5656
endpoint=self.get_product,
5757
methods=["GET"],
5858
tags=["Products"],
59-
summary="Get product details",
59+
summary="Get product",
6060
description=(
61-
"Returns detailed information about a specific product. The response includes "
62-
"all product metadata, including required fields (type, id, title, description, "
63-
"license, providers, links) and optional fields (keywords, queryables, parameters, "
64-
"properties). The parameters field defines what can be ordered for this product, "
65-
"while the properties field describes inherent characteristics of the product. "
66-
"The response includes links to related endpoints such as queryables, order "
67-
"parameters, and conformance information."
61+
"Returns detailed information about a specific product, including its metadata, "
62+
"capabilities, and configuration options."
6863
),
6964
response_model=Product,
7065
responses={
@@ -73,7 +68,7 @@ def _setup_routes(self) -> None:
7368
"content": {
7469
"application/json": {
7570
"example": {
76-
"type": "Product",
71+
"type": "Collection",
7772
"stapi_type": "Product",
7873
"stapi_version": STAPI_VERSION,
7974
"id": "{productId}",
@@ -86,7 +81,13 @@ def _setup_routes(self) -> None:
8681
"roles": ["producer"],
8782
"url": "https://example.com/provider",
8883
"description": "Example provider for demonstration purposes",
89-
}
84+
},
85+
{
86+
"name": "Example Host",
87+
"roles": ["host"],
88+
"url": "https://example.com/host",
89+
"description": "Example host for demonstration purposes",
90+
},
9091
],
9192
"conformsTo": [
9293
f"{STAPI_BASE_URL}/{STAPI_VERSION}/core",
@@ -129,11 +130,8 @@ def _setup_routes(self) -> None:
129130
tags=["Products"],
130131
summary="Get product conformance",
131132
description=(
132-
"Returns the conformance classes that apply specifically to this product. "
133-
"These classes indicate which features and capabilities are supported by "
134-
"this product, such as supported geometry types, parameter types, and "
135-
"other product-specific capabilities. The conformance classes help clients "
136-
"understand what operations and parameters are available for this product."
133+
"Returns the conformance classes that apply specifically to this product, "
134+
"indicating which features and capabilities are supported."
137135
),
138136
response_model=Conformance,
139137
responses={
@@ -162,14 +160,10 @@ def _setup_routes(self) -> None:
162160
endpoint=self.get_queryables,
163161
methods=["GET"],
164162
tags=["Products"],
165-
summary="Get queryable properties",
163+
summary="Get queryables",
166164
description=(
167-
"Returns a JSON Schema definition of the properties that can be used to "
168-
"filter opportunities and orders for this product. These queryables define "
169-
"the constraints that can be applied when searching for or ordering this "
170-
"product, such as cloud cover limits, resolution requirements, or other "
171-
"product-specific parameters. The schema follows JSON Schema draft-07 and "
172-
"provides detailed information about each queryable property."
165+
"Returns a JSON Schema definition of the properties that can be used to filter "
166+
"opportunities and orders for this product."
173167
),
174168
response_model=Queryables,
175169
responses={
@@ -212,11 +206,8 @@ def _setup_routes(self) -> None:
212206
tags=["Products"],
213207
summary="Get order parameters",
214208
description=(
215-
"Returns a JSON Schema definition of the parameters that can be specified "
216-
"when creating an order for this product. These parameters define the "
217-
"configurable options for the order, such as delivery format, processing "
218-
"level, or other product-specific options. The schema follows JSON Schema "
219-
"draft-07 and provides detailed information about each parameter."
209+
"Returns a JSON Schema definition of the parameters that can be specified when "
210+
"creating an order for this product."
220211
),
221212
response_model=OrderParameters,
222213
responses={
@@ -261,12 +252,8 @@ def _setup_routes(self) -> None:
261252
tags=["Orders"],
262253
summary="Create order",
263254
description=(
264-
"Creates a new order for this product. The request must include the required "
265-
"fields (datetime, geometry) and may include optional fields (queryables, "
266-
"order_parameters). The datetime field specifies the temporal extent of the "
267-
"order, while the geometry field defines its spatial extent. The response "
268-
"is a GeoJSON Feature representing the created order. The order will be "
269-
"processed according to the specified parameters and constraints."
255+
"Creates a new order for this product using the parameters defined in the product "
256+
"or provided through the opportunities endpoint."
270257
),
271258
response_model=Order[OrderStatus],
272259
responses={
@@ -321,12 +308,8 @@ def _setup_routes(self) -> None:
321308
tags=["Orders"],
322309
summary="List product orders",
323310
description=(
324-
"Returns a collection of orders for this product. Each order is a GeoJSON "
325-
"Feature containing the order details, including status, parameters, and "
326-
"metadata. The response is a GeoJSON FeatureCollection and includes "
327-
"pagination links for navigating through the order collection. Orders can "
328-
"be filtered by various parameters and support pagination for efficient "
329-
"retrieval of large result sets."
311+
"Returns a collection of orders for this product. The response includes pagination "
312+
"links for navigating through the order collection."
330313
),
331314
response_model=OrderCollection[OrderStatus],
332315
responses={
@@ -377,13 +360,8 @@ def _setup_routes(self) -> None:
377360
tags=["Opportunities"],
378361
summary="Search opportunities",
379362
description=(
380-
"Searches for potential acquisition opportunities for this product. The request "
381-
"must include the required fields (datetime, geometry) and may include optional "
382-
"fields (filter). The datetime field specifies the temporal extent of the search, "
383-
"while the geometry field defines its spatial extent. The filter field allows "
384-
"specifying additional constraints using CQL2 JSON. The response is a GeoJSON "
385-
"FeatureCollection containing the matching opportunities. Supports both "
386-
"synchronous and asynchronous search modes."
363+
"Explores the opportunities available for this product based on the provided "
364+
"parameters. Supports both synchronous and asynchronous search modes."
387365
),
388366
response_model=OpportunityCollection[Polygon, OpportunityProperties],
389367
responses={
@@ -483,10 +461,8 @@ def _setup_routes(self) -> None:
483461
tags=["Opportunities"],
484462
summary="Get opportunity collection",
485463
description=(
486-
"Returns the opportunity collection for an asynchronous search. This endpoint "
487-
"is used to retrieve the results of an asynchronous opportunity search. The "
488-
"response is a GeoJSON FeatureCollection containing the matching opportunities. "
489-
"The collection may be paginated if there are many results."
464+
"Returns the opportunity collection for an asynchronous search. The response "
465+
"includes pagination links for navigating through the opportunity collection."
490466
),
491467
response_model=OpportunityCollection[Polygon, OpportunityProperties],
492468
responses={

0 commit comments

Comments
 (0)