Skip to content

Commit 8cfdab6

Browse files
committed
exclude unwanted endpoints to the swagger ui
1 parent 64d8e60 commit 8cfdab6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ async def custom_swagger_ui(request: Request) -> HTMLResponse:
105105

106106

107107
@app.get("/api", include_in_schema=True)
108-
@app.get("/api/", include_in_schema=True)
108+
@app.get("/api/", include_in_schema=False)
109109
def openapi_json_get() -> JSONResponse:
110110
"""Return the OpenAPI schema (openapi.json)."""
111111
return JSONResponse(app.openapi())
112112

113113

114-
@app.post("/api", include_in_schema=False)
115-
@app.post("/api/", include_in_schema=True)
114+
@app.post("/api", include_in_schema=True)
115+
@app.post("/api/", include_in_schema=False)
116116
def openapi_json_post() -> JSONResponse:
117117
"""Return the OpenAPI schema (openapi.json)."""
118118
return JSONResponse(app.openapi())

0 commit comments

Comments
 (0)