refactor: Change endpoint order in swagger (#1004)
<!-- .github/pull_request_template.md --> ## Description <!-- Provide a clear description of the changes in this PR --> ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
parent
2cb8f7f8e3
commit
3a48507598
2 changed files with 28 additions and 29 deletions
|
|
@ -108,6 +108,22 @@ async def exception_handler(_: Request, exc: CogneeApiError) -> JSONResponse:
|
|||
return JSONResponse(status_code=status_code, content={"detail": detail["message"]})
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
"""
|
||||
Root endpoint that returns a welcome message.
|
||||
"""
|
||||
return {"message": "Hello, World, I am alive!"}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health_check():
|
||||
"""
|
||||
Health check endpoint that returns the server status.
|
||||
"""
|
||||
return Response(status_code=200)
|
||||
|
||||
|
||||
app.include_router(get_auth_router(), prefix="/api/v1/auth", tags=["auth"])
|
||||
|
||||
app.include_router(
|
||||
|
|
@ -128,11 +144,11 @@ app.include_router(
|
|||
tags=["auth"],
|
||||
)
|
||||
|
||||
app.include_router(
|
||||
get_users_router(),
|
||||
prefix="/api/v1/users",
|
||||
tags=["users"],
|
||||
)
|
||||
app.include_router(get_add_router(), prefix="/api/v1/add", tags=["add"])
|
||||
|
||||
app.include_router(get_cognify_router(), prefix="/api/v1/cognify", tags=["cognify"])
|
||||
|
||||
app.include_router(get_search_router(), prefix="/api/v1/search", tags=["search"])
|
||||
|
||||
app.include_router(
|
||||
get_permissions_router(),
|
||||
|
|
@ -140,31 +156,8 @@ app.include_router(
|
|||
tags=["permissions"],
|
||||
)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
"""
|
||||
Root endpoint that returns a welcome message.
|
||||
"""
|
||||
return {"message": "Hello, World, I am alive!"}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health_check():
|
||||
"""
|
||||
Health check endpoint that returns the server status.
|
||||
"""
|
||||
return Response(status_code=200)
|
||||
|
||||
|
||||
app.include_router(get_datasets_router(), prefix="/api/v1/datasets", tags=["datasets"])
|
||||
|
||||
app.include_router(get_add_router(), prefix="/api/v1/add", tags=["add"])
|
||||
|
||||
app.include_router(get_cognify_router(), prefix="/api/v1/cognify", tags=["cognify"])
|
||||
|
||||
app.include_router(get_search_router(), prefix="/api/v1/search", tags=["search"])
|
||||
|
||||
app.include_router(get_settings_router(), prefix="/api/v1/settings", tags=["settings"])
|
||||
|
||||
app.include_router(get_visualize_router(), prefix="/api/v1/visualize", tags=["visualize"])
|
||||
|
|
@ -177,6 +170,12 @@ codegraph_routes = get_code_pipeline_router()
|
|||
if codegraph_routes:
|
||||
app.include_router(codegraph_routes, prefix="/api/v1/code-pipeline", tags=["code-pipeline"])
|
||||
|
||||
app.include_router(
|
||||
get_users_router(),
|
||||
prefix="/api/v1/users",
|
||||
tags=["users"],
|
||||
)
|
||||
|
||||
|
||||
def start_api_server(host: str = "0.0.0.0", port: int = 8000):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TestCogneeServerStart(unittest.TestCase):
|
|||
|
||||
payload = {"datasets": ["test"]}
|
||||
|
||||
cognify_response = requests.post(url, headers=headers, json=payload, timeout=15)
|
||||
cognify_response = requests.post(url, headers=headers, json=payload, timeout=150)
|
||||
cognify_response.raise_for_status() # raises on HTTP 4xx/5xx
|
||||
|
||||
# TODO: Add test to verify cognify pipeline is complete before testing search
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue