Bug Description
Commands notion get <database_id> and notion db get <database_id> fail with error:
"Schema has no property with attribute name properties"
Root Cause
The code uses obj.schema.properties.items() but according to ultimate_notion API:
Schema does NOT have a .properties attribute
- Correct API is
schema.to_dict() which returns dict[str, Property]
Files Affected
src/notion_cli/commands/get.py line 53-55
src/notion_cli/commands/database.py line 26
Expected Behavior
notion db get <id> should return database schema with properties
notion get <id> should work for both pages and databases
Reproduction
notion db get "400821ec-bbb5-4f69-b1d1-7af3e99a0264" --json
# Returns: {"success": false, "error": {"code": "DB_GET_ERROR", "message": "Schema has no property with attribute name properties"}}
Suggested Fix
Use schema.to_dict() instead of schema.properties.items():
# Wrong:
{name: prop.type for name, prop in db.schema.properties.items()}
# Correct:
{name: type(prop).__name__ for name, prop in db.schema.to_dict().items()}
Bug Description
Commands
notion get <database_id>andnotion db get <database_id>fail with error:Root Cause
The code uses
obj.schema.properties.items()but according to ultimate_notion API:Schemadoes NOT have a.propertiesattributeschema.to_dict()which returnsdict[str, Property]Files Affected
src/notion_cli/commands/get.pyline 53-55src/notion_cli/commands/database.pyline 26Expected Behavior
notion db get <id>should return database schema with propertiesnotion get <id>should work for both pages and databasesReproduction
Suggested Fix
Use
schema.to_dict()instead ofschema.properties.items():