From 4e5b99bde17af18b25afa079f11306175e78859c Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Fri, 5 Sep 2025 21:08:21 +0100 Subject: [PATCH] Fix schema extraction in --auto --- trustgraph-cli/trustgraph/cli/load_structured_data.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trustgraph-cli/trustgraph/cli/load_structured_data.py b/trustgraph-cli/trustgraph/cli/load_structured_data.py index 4b8099fb..8a082e1b 100644 --- a/trustgraph-cli/trustgraph/cli/load_structured_data.py +++ b/trustgraph-cli/trustgraph/cli/load_structured_data.py @@ -544,6 +544,10 @@ def _auto_discover_schema(api_url, input_file, sample_chars, logger, return_raw_ # Extract schema name from response if isinstance(response, dict) and 'schema' in response: return response['schema'] + elif isinstance(response, list) and len(response) > 0: + # If response is a list, use the first element + logger.info(f"Extracted schema '{response[0]}' from list response") + return response[0] elif isinstance(response, str): # Try to extract schema name from text response response_lower = response.lower().strip()