kk
This commit is contained in:
@@ -80,6 +80,23 @@ def _discover_store_classes() -> Dict[str, Type[BaseStore]]:
|
||||
|
||||
|
||||
def _required_keys_for(store_cls: Type[BaseStore]) -> list[str]:
|
||||
# Support new config() schema
|
||||
if hasattr(store_cls, "config") and callable(store_cls.config):
|
||||
try:
|
||||
schema = store_cls.config()
|
||||
keys = []
|
||||
if isinstance(schema, list):
|
||||
for field in schema:
|
||||
if isinstance(field, dict) and field.get("required"):
|
||||
k = field.get("key")
|
||||
if k:
|
||||
keys.append(str(k))
|
||||
if keys:
|
||||
return keys
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Legacy __new__.keys support
|
||||
keys = getattr(store_cls.__new__, "keys", None)
|
||||
if keys is None:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user