feat: endpoint list producer
This commit is contained in:
parent
af680dbc38
commit
905fcf8814
2 changed files with 26 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -205,3 +205,6 @@ cython_debug/
|
||||||
marimo/_static/
|
marimo/_static/
|
||||||
marimo/_lsp/
|
marimo/_lsp/
|
||||||
__marimo__/
|
__marimo__/
|
||||||
|
|
||||||
|
|
||||||
|
endpoints.txt
|
||||||
|
|
@ -66,3 +66,26 @@ def _seed(db):
|
||||||
db.flush()
|
db.flush()
|
||||||
group_model.user_rel.append(user_model)
|
group_model.user_rel.append(user_model)
|
||||||
db.commit()
|
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