feat: endpoint list producer
This commit is contained in:
parent
af680dbc38
commit
905fcf8814
2 changed files with 26 additions and 0 deletions
|
|
@ -66,3 +66,26 @@ def _seed(db):
|
|||
db.flush()
|
||||
group_model.user_rel.append(user_model)
|
||||
db.commit()
|
||||
|
||||
# # Produces a text file with method and path for every endpoint in the API
|
||||
# from fastapi.routing import APIRoute
|
||||
#
|
||||
# def get_testable_routes():
|
||||
# routes = []
|
||||
#
|
||||
# for route in app.routes:
|
||||
# if not isinstance(route, APIRoute):
|
||||
# continue
|
||||
#
|
||||
# for method in route.methods:
|
||||
# if method in {"HEAD", "OPTIONS"}:
|
||||
# continue
|
||||
#
|
||||
# routes.append((route.path, method))
|
||||
#
|
||||
# return routes
|
||||
#
|
||||
#
|
||||
# with open("endpoints.txt", "w") as f:
|
||||
# for ep in get_testable_routes():
|
||||
# f.write(f"{ep[1]} {ep[0]}\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue