summaryrefslogtreecommitdiff
path: root/src/api/search_results.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/search_results.rs')
-rw-r--r--src/api/search_results.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/api/search_results.rs b/src/api/search_results.rs
index f53bce8..cd47054 100644
--- a/src/api/search_results.rs
+++ b/src/api/search_results.rs
@@ -4,12 +4,22 @@ use crate::database::song::Song;
use crate::AppState;
use actix_web::{get, web, HttpResponse};
use serde::Deserialize;
+use utoipa::IntoParams;
-#[derive(Deserialize)]
+#[derive(Deserialize, IntoParams)]
struct SearchQueryOptions {
name: Option<String>,
}
+#[utoipa::path(
+ params(SearchQueryOptions),
+ context_path = "/api",
+ description = "Performs a search based on the 'name' parameter and returns a list.",
+ responses(
+ (status = 200, description = "Return a list of artists, albums and songs"),
+ (status = 400, description = "Errors found, unfulfilled request"),
+ ),
+)]
#[get("/search-results")]
pub async fn search_results(
app_state: web::Data<AppState>,