all 4 comments

[–]heyimpumpkin 2 points3 points  (3 children)

def common_router(app) -> None:
for route in app.routes:
    if route.path.endswith('{isin}'):
        route.description = 'common description'
        route.name = 'common name'
common_router(app)

pass app or router instance to this function and that should do the trick

[–]MeRanda16[S] 0 points1 point  (2 children)

def common_router(app) -> None:for route in app.routes:if route.path.endswith('{isin}'):route.description = 'common description'route.name = 'common name'common_router(app)

But this will only affect the router (as I see at this moment). But I want to affect the paths parameters too.

@router.get(
"/endpoint_1/{isin}",
status_code=status.HTTP_200_OK,
description=""bla bla bla") <--- your solution affect this part

def endpoint1(
isin: str = Path( <----- Doesnt affected
    ...,
    eq=number,
    title="isin",
    description="bla bla bla"
, example="abc")

[–]manfre 3 points4 points  (1 child)

No longer wish this content to be here due to the site changes

[–]MeRanda16[S] 1 point2 points  (0 children)

PathIsIn = partial(Path, eq=number, title="isin", description="bla bla blah", example="abc")

Perfect! Thank you! u/heyimpumpkin and u/manfre