diff --git a/daoip-5/scripts/API/run.py b/daoip-5/scripts/API/run.py index ceb3e58..93921ef 100644 --- a/daoip-5/scripts/API/run.py +++ b/daoip-5/scripts/API/run.py @@ -18,43 +18,76 @@ def display_help(): """ Endpoint to display API documentation. """ - documentation = { - "title": "DAOIP-5 Datalake API", - "repository": "https://github.com/opensource-observer/oss-funding/tree/main/daoip-5/json", - "endpoints": { - "/": { - "method": "GET", - "description": "List all grant systems (folders) in the JSON directory.", - "parameters": None, - "response": "A JSON array of grant system names." - }, - "/": { - "method": "GET", - "description": "List all grant pools (JSON files) within a specific grant system folder.", - "parameters": { - "grant_system": "string - The name of the grant system folder to inspect." - }, - "response": "A JSON array of JSON file names (grant pools) in the specified folder." - }, - "//.json": { - "method": "GET", - "description": "Retrieve a specific JSON file within a grant system folder.", - "parameters": { - "grant_system": "string - The name of the grant system folder.", - "filename": "string - The name of the JSON file (without .json extension) to retrieve." - }, - "response": "The JSON content of the specified file." - }, - "/help": { - "method": "GET", - "description": "Display this documentation.", - "parameters": None, - "response": "A JSON object detailing all API endpoints and their descriptions." - } - } - } - return jsonify(documentation), 200 - + documentation_html = """ + + + + + + DAOIP-5 Datalake API Documentation + + + +

DAOIP-5 Datalake API Documentation

+

Repository: DAOIP-5 JSON Repository

+ +
+

Endpoint: /

+

Method: GET

+

Description: List all grant systems (folders) in the JSON directory.

+

Parameters: None

+

Response: A JSON array of grant system names.

+
+ +
+

Endpoint: /<grant_system>

+

Method: GET

+

Description: List all grant pools (JSON files) within a specific grant system folder.

+
+

Parameters:

+
    +
  • grant_system (string): The name of the grant system folder to inspect.
  • +
+
+
+

Response: A JSON array of JSON file names (grant pools) in the specified folder.

+
+
+ +
+

Endpoint: /<grant_system>/<filename>.json

+

Method: GET

+

Description: Retrieve a specific JSON file within a grant system folder.

+
+

Parameters:

+
    +
  • grant_system (string): The name of the grant system folder.
  • +
  • filename (string): The name of the JSON file (without .json extension) to retrieve.
  • +
+
+
+

Response: The JSON content of the specified file.

+
+
+ +
+

Endpoint: /help

+

Method: GET

+

Description: Display this documentation.

+

Parameters: None

+

Response: A JSON object detailing all API endpoints and their descriptions.

+
+ + + """ + return documentation_html, 200, {'Content-Type': 'text/html'} def get_grant_pools(grant_system):