This commit is contained in:
2026-03-23 09:58:40 -03:00
parent 9c9c7dff09
commit 8186bb5fe6
40 changed files with 3996 additions and 17 deletions

View File

@@ -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):