tsk-170: Adding code to document API
This commit is contained in:
@@ -856,6 +856,9 @@ mod song_queue {
|
||||
|
||||
pub mod endpoint {
|
||||
use axum::{Json, http::StatusCode, response::IntoResponse};
|
||||
use utoipa::OpenApi;
|
||||
use utoipa_swagger_ui::SwaggerUi;
|
||||
|
||||
use std::io::Write;
|
||||
|
||||
use crate::callers::song::song_queue;
|
||||
|
||||
+11
@@ -1,6 +1,7 @@
|
||||
pub mod auth;
|
||||
pub mod callers;
|
||||
|
||||
|
||||
pub mod db {
|
||||
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
@@ -29,6 +30,16 @@ pub mod db {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(utoipa::OpenApi)]
|
||||
#[openapi(
|
||||
paths(crate::callers::song::endpoint::queue_song),
|
||||
components(schemas(crate::callers::song::response::Response)),
|
||||
tags(
|
||||
(name = "queue song", description = "Start process to upload song by queueing the song")
|
||||
)
|
||||
)]
|
||||
struct ApiDoc;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// initialize tracing
|
||||
|
||||
Reference in New Issue
Block a user