diff --git a/policyengine_api/country.py b/policyengine_api/country.py index a4536f3d..36725c30 100644 --- a/policyengine_api/country.py +++ b/policyengine_api/country.py @@ -41,8 +41,6 @@ def __init__(self, country_package_name: str, country_id: str): def build_metadata(self): self.metadata = dict( - status="ok", - message=None, result=dict( variables=self.build_variables(), parameters=self.build_parameters(), diff --git a/policyengine_api/routes/metadata_routes.py b/policyengine_api/routes/metadata_routes.py index 3c37e2cd..b61b3afd 100644 --- a/policyengine_api/routes/metadata_routes.py +++ b/policyengine_api/routes/metadata_routes.py @@ -16,4 +16,18 @@ def get_metadata(country_id: str) -> Response: Args: country_id (str): The country ID. """ - return metadata_service.get_metadata(country_id) + + # Retrieve country metadata and adding status and message + # to the response + country_metadata = metadata_service.get_metadata(country_id) + return Response( + json.dumps( + { + "status": "ok", + "message": None, + "result": country_metadata + } + ), + status=200, + mimetype="application/json" + )