From aadaee476e52a7a74058e6d62ea3b4fd22f72f06 Mon Sep 17 00:00:00 2001 From: Amund Isaksen Date: Mon, 9 Dec 2024 09:37:04 +0100 Subject: [PATCH] Use openapi metadata in ladingpage metadata --- api/metadata_endpoints.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/api/metadata_endpoints.py b/api/metadata_endpoints.py index 82ed8df4..668db06d 100644 --- a/api/metadata_endpoints.py +++ b/api/metadata_endpoints.py @@ -30,6 +30,9 @@ from utilities import seconds_to_iso_8601_duration from utilities import convert_cm_to_m +from openapi.openapi_metadata import openapi_metadata + + logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -58,9 +61,8 @@ def datetime_to_iso_string(value: datetime) -> str: def get_landing_page(request): return LandingPageModel( - title="EDR Observations API Europe EUMETNET", - description="OGC EDR API data service for European environmental observations from EUMETNET," - " co-funded by the European Union.", + title=openapi_metadata["title"], + description=openapi_metadata["description"], keywords=[ "weather", "temperature", @@ -70,8 +72,11 @@ def get_landing_page(request): "clouds", "radiation", ], - provider=Provider(name="RODEO", url="https://rodeo-project.eu/"), - contact=Contact(email="eucos@metoffice.gov.uk"), + provider=Provider( + name=openapi_metadata["contact"]["name"], + url=openapi_metadata["contact"]["url"], + ), + contact=Contact(email=openapi_metadata["contact"]["email"]), links=[ Link( href=f"{request.url}",