fastapi-crudrouter icon indicating copy to clipboard operation
fastapi-crudrouter copied to clipboard

Ability to add a custom summary for a route

Open ghost opened this issue 4 years ago • 1 comments

ghost avatar Jun 19 '21 22:06 ghost

You could iterate over the routes in the CRUDrouter and map the routes to a dict with descriptions/summaries:

r = CRUDRouter(
    create_schema=pydanticSchema,
    schema=pydanticSchema,
    db_model=tbl,
    db=get_db,
)
for route in r.routes:
    route.description = "my description"
    route.summary= "my summary"
app.include_router(r)

LindezaGrey avatar Sep 07 '21 11:09 LindezaGrey