diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index ec56602..d3f0b0b 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -121,10 +121,8 @@ def api_routes(m_dom: ModuleType) -> Generator: for verb in VERBS: if verb not in d_route.keys(): continue - d_res[path][verb] = { - 'params': str_acl(d_route[verb]['params']), - 'fct': d_route[verb]['fct'].__name__ - } + d_res[path][verb] = str_acl(d_route[verb]['params']) - yield path, d_res + print(d_res) + return d_res diff --git a/halfapi/lib/schemas.py b/halfapi/lib/schemas.py index c2ee907..909bd01 100644 --- a/halfapi/lib/schemas.py +++ b/halfapi/lib/schemas.py @@ -38,10 +38,10 @@ async def get_api_routes(request, *args, **kwargs): } """ #TODO: LADOC - return ORJSONResponse({ - domain: { path: route for path, route in api_routes(m_domain) } - for domain, m_domain in DOMAINSDICT.items() - }) + d_api = {} + for domain, m_domain in DOMAINSDICT.items(): + d_api[domain] = api_routes(m_domain) + return ORJSONResponse(d_api) async def schema_json(request, *args, **kwargs):