fix: restore missing OpenAPI handler and fix Swagger UI route reference

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-12 16:55:14 -03:00
parent 01b27fb61d
commit 27a590a566

View File

@@ -1,3 +1,41 @@
use axum::response::{Html, Json};
use serde_json::json;
use serde_json::Value;
use crate::modes::server::common::AppState;
use axum::{
routing::get,
Router,
};
pub async fn handle_openapi() -> Json<Value> {
let openapi_spec = json!({
"openapi": "3.0.0",
"info": {
"title": "Keep API",
"version": "1.0.0",
"description": "REST API for the Keep data storage system"
},
"servers": [
{
"url": "/",
"description": "Local server"
}
],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
},
"security": [{"bearerAuth": []}],
"paths": {}
});
Json(openapi_spec)
}
pub async fn handle_swagger_ui() -> Html<&'static str> {
let html = r#"<!DOCTYPE html>