INNER CODE UNIT · Python
custom_generate_unique_id
cording12/next-fast-turbo · apps/api/src/main.py:16
def custom_generate_unique_id(route: APIRoute):
"""Generates a custom ID when using the TypeScript Generator Client
Args:
route (APIRoute): The route to be customised
Returns:
str: tag-route_name, e.g. items-CreateItem
"""
return f"{route.tags[0]}-{route.name}"
def get_application():
_app = FastAPI(
title=settings.PROJECT_NAME,
description=settings.PROJECT_DESCRIPTION,
generate_unique_id_function=custom_generate_unique_id,
root_path=settings.ROOT,