Skip to content

Main

map_routes(template)

Map the content from YAML configuration with FastAPI route

Parameters:

Name Type Description Default
parser src.parse_api.model.Parse

YAML configuration parsed

required
Source code in main.py
10
11
12
13
14
15
16
17
18
19
20
def map_routes(template: Template) -> None:
    """Map the content from YAML configuration with FastAPI route

    Args:
        parser (src.parse_api.model.Parse): YAML configuration parsed
    """
    app.add_api_route(
        path=template.path,
        endpoint=template.response.get_response,
        methods=[template.method],
    )