phase 1
This commit is contained in:
@@ -123,6 +123,20 @@ class SchemaLoader:
|
||||
methods=grpc_service.get("methods", []),
|
||||
)
|
||||
|
||||
# Generic group loader: any include group not handled above
|
||||
# is looked up as UPPER_CASE attribute on the module.
|
||||
# e.g. include "detect_views" → module.DETECT_VIEWS
|
||||
if include:
|
||||
known_groups = {"dataclasses", "enums", "api", "views", "grpc"}
|
||||
for group in include - known_groups:
|
||||
attr_name = group.upper()
|
||||
items = getattr(module, attr_name, [])
|
||||
for cls in items:
|
||||
if isinstance(cls, type) and dc.is_dataclass(cls):
|
||||
self.api_models.append(self._parse_dataclass(cls))
|
||||
elif isinstance(cls, type) and issubclass(cls, Enum):
|
||||
self.enums.append(self._parse_enum(cls))
|
||||
|
||||
return self
|
||||
|
||||
def _import_module(self, path: Path):
|
||||
|
||||
Reference in New Issue
Block a user