[lib.domain] SUBROUTER can be a path parameter if including ":"
This commit is contained in:
parent
138420461d
commit
aa4c309778
|
@ -135,8 +135,6 @@ def gen_router_routes(m_router: ModuleType, path: List[str]) -> Generator:
|
|||
routes[''][verb.upper()] = [{
|
||||
'acl': acl.public
|
||||
}]
|
||||
else:
|
||||
print(f'no {verb.lower()} in {m_router}')
|
||||
|
||||
routes['']['SUBROUTES'] = []
|
||||
for item in os.listdir(list(m_router.__path__)[0]):
|
||||
|
@ -153,6 +151,9 @@ def gen_router_routes(m_router: ModuleType, path: List[str]) -> Generator:
|
|||
subroutes = route_params.get('SUBROUTES', [])
|
||||
for subroute in subroutes:
|
||||
logger.debug('Processing subroute **%s** - %s', subroute, m_router.__name__)
|
||||
if ':' in subroute:
|
||||
path.append(f'{{{subroute}}}')
|
||||
else:
|
||||
path.append(subroute)
|
||||
try:
|
||||
submod = importlib.import_module(f'.{subroute}', m_router.__name__)
|
||||
|
|
Loading…
Reference in New Issue