feat: add metadata for api doc
This commit is contained in:
+12
-3
@@ -5,12 +5,21 @@ use crate::routes;
|
|||||||
|
|
||||||
#[derive(OpenApi)]
|
#[derive(OpenApi)]
|
||||||
#[openapi(
|
#[openapi(
|
||||||
|
info(
|
||||||
|
title = "Ollama Proxy",
|
||||||
|
description = "OpenAI-compatible proxy for local Ollama models",
|
||||||
|
version = "0.1.0",
|
||||||
|
license(
|
||||||
|
name = "MIT",
|
||||||
|
url = "https://opensource.org/licenses/MIT"
|
||||||
|
),
|
||||||
|
),
|
||||||
paths(
|
paths(
|
||||||
routes::v1::chat::completions,
|
routes::v1::chat::completions,
|
||||||
routes::v1::chat::chat_completions,
|
routes::v1::chat::chat_completions,
|
||||||
// routes::v1::models::list_models,
|
routes::v1::models::list_models,
|
||||||
// routes::v1::models::load_model,
|
routes::v1::models::load_model,
|
||||||
// routes::v1::models::unload_model,
|
routes::v1::models::unload_model,
|
||||||
),
|
),
|
||||||
components(
|
components(
|
||||||
schemas(
|
schemas(
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ async fn openapi_json() -> Json<utoipa::openapi::OpenApi> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn public_router() -> Router<AppState> {
|
fn public_router() -> Router<AppState> {
|
||||||
Router::new().route("/openapi.json", get(openapi_json))
|
Router::new().route("/docs.json", get(openapi_json))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn protected_router() -> Router<AppState> {
|
pub fn protected_router() -> Router<AppState> {
|
||||||
|
|||||||
Reference in New Issue
Block a user