Skip to main content

custom_generate_unique_id

Generates a unique identifier for an API route by concatenating the first tag and the route name.

def custom_generate_unique_id(
route: APIRoute
) - > string

Generates a unique identifier for an API route by combining its first tag and its name. Use this to create consistent operation IDs for OpenAPI documentation and client generation.

Parameters​

NameTypeDescription
routeAPIRouteThe FastAPI route object containing the tags and name used to construct the identifier.

Returns​

TypeDescription
stringA hyphenated string combining the primary tag and the route name, such as 'users-get-profile'.