From 846df227ba594c14406e4283f1820eb76a5252bb Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sat, 6 Sep 2025 11:51:00 +0100 Subject: [PATCH] Discover schema is working --- trustgraph-cli/trustgraph/cli/load_structured_data.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trustgraph-cli/trustgraph/cli/load_structured_data.py b/trustgraph-cli/trustgraph/cli/load_structured_data.py index e3006c3c..05ced8df 100644 --- a/trustgraph-cli/trustgraph/cli/load_structured_data.py +++ b/trustgraph-cli/trustgraph/cli/load_structured_data.py @@ -163,16 +163,22 @@ def load_structured_data( response = _auto_discover_schema(api_url, input_file, sample_chars, flow, logger, return_raw_response=True) if response: + # Debug: print response type and content + logger.debug(f"Response type: {type(response)}, content: {response}") if isinstance(response, list) and len(response) == 1: # Just print the schema name for clean output print(response[0]) + elif isinstance(response, list): + # Multiple schemas - show the list + print("Multiple schemas found:") + for schema in response: + print(f" - {schema}") else: - # For multiple schemas or complex responses, show full details + # Show full response for debugging print("Schema Discovery Results:") print("=" * 50) print(response) print("=" * 50) - print("\nUse --generate-descriptor with --schema-name to create a descriptor configuration.") else: print("Could not determine the best matching schema for your data.") print("Available schemas can be viewed using: tg-config-list schema")