Skip to content

Commit 25a40ae

Browse files
authored
Merge pull request #68 from ecmwf-projects/COPDS-797-inject-endpoints-doc
Implement mechanism to define custom endpoints descriptions
2 parents ae0f149 + 297354b commit 25a40ae

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ogc_api_processes_fastapi/clients.py

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@
2525
class BaseClient(abc.ABC):
2626
"""Defines a pattern for implementing OGC API - Processes endpoints."""
2727

28+
endpoints_description: Dict[str, str] = {
29+
"GetLandingPage": "Get landing page",
30+
"GetConformance": "Get conformance classes",
31+
"GetProcesses": "Get all available processes",
32+
"GetProcess": "Get description of the process",
33+
"PostProcessExecution": "Post request for execution of the process",
34+
"GetJobs": "Get the list of submitted jobs",
35+
"GetJob": "Get status information of the job",
36+
"GetJobResults": "Get results of the job",
37+
"DeleteJob": "Cancel the job",
38+
}
39+
2840
@abc.abstractmethod
2941
def get_processes(
3042
self, limit: Optional[int] = fastapi.Query(None)

ogc_api_processes_fastapi/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def register_route(
3535
route_endpoint = endpoints.create_endpoint(route_name, client=client)
3636
router.add_api_route(
3737
name=route_name,
38+
description=client.endpoints_description.get(route_name, ""),
3839
response_model=response_model,
3940
response_model_exclude_unset=True,
4041
response_model_exclude_none=True,

0 commit comments

Comments
 (0)