feat(kis-collection): finalize sqlite migration, add fallback resilience, and update WBS documentation
This commit is contained in:
@@ -31,6 +31,7 @@ def to_module_name(path: Path) -> str:
|
||||
def render_module(schema_path: Path, schema: dict[str, Any]) -> str:
|
||||
title = str(schema.get("title") or schema_path.stem)
|
||||
schema_id = str(schema.get("$id") or f"schema://{title}")
|
||||
schema_rel_path = str(schema_path.relative_to(ROOT)).replace("\\", "/")
|
||||
props = schema.get("properties") if isinstance(schema.get("properties"), dict) else {}
|
||||
required = schema.get("required") if isinstance(schema.get("required"), list) else []
|
||||
prop_names = list(props.keys())
|
||||
@@ -43,7 +44,7 @@ def render_module(schema_path: Path, schema: dict[str, Any]) -> str:
|
||||
"from typing import Any\n\n"
|
||||
f"SCHEMA_TITLE = {title!r}\n"
|
||||
f"SCHEMA_ID = {schema_id!r}\n"
|
||||
f"SCHEMA_PATH = {str(schema_path.relative_to(ROOT)).replace('\\', '/')!r}\n"
|
||||
f"SCHEMA_PATH = {schema_rel_path!r}\n"
|
||||
f"SCHEMA_PROPERTIES = {prop_names!r}\n"
|
||||
f"SCHEMA_REQUIRED = {required!r}\n\n"
|
||||
"@dataclass(frozen=True)\n"
|
||||
|
||||
Reference in New Issue
Block a user