Only include /api routes in OpenAPI schema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 05:33:47 -04:00
parent 9b5e430b9c
commit 8f19cd63c0
+2
View File
@@ -1192,6 +1192,8 @@ async def api_schema(req, resp):
route = getattr(r, "route", None)
if not fn or not route or fn.__name__ in skip:
continue
if not route.startswith("/api"):
continue
doc = (fn.__doc__ or fn.__name__.replace("_", " ").title()).split("\n")[0].strip()
params = []
for part in route.split("/"):