diff --git a/crates/meilisearch/src/routes/api_key.rs b/crates/meilisearch/src/routes/api_key.rs index 2a08448db..a0c34c3e4 100644 --- a/crates/meilisearch/src/routes/api_key.rs +++ b/crates/meilisearch/src/routes/api_key.rs @@ -208,7 +208,7 @@ pub async fn list_api_keys( /// Get an API key from its `uid` or its `key` field. #[utoipa::path( get, - path = "/{key}", + path = "/{uidOrKey}", tag = "Keys", security(("Bearer" = ["keys.get", "keys.*", "*"])), params(("uidOrKey" = String, Path, format = Password, example = "7b198a7f-52a0-4188-8762-9ad93cd608b2", description = "The `uid` or `key` field of an existing API key", nullable = false)), @@ -275,7 +275,7 @@ pub async fn get_api_key( /// If there is an issue with the `key` or `uid` of a key, then you must recreate one from scratch. #[utoipa::path( patch, - path = "/{key}", + path = "/{uidOrKey}", tag = "Keys", security(("Bearer" = ["keys.update", "keys.*", "*"])), params(("uidOrKey" = String, Path, format = Password, example = "7b198a7f-52a0-4188-8762-9ad93cd608b2", description = "The `uid` or `key` field of an existing API key", nullable = false)), @@ -345,7 +345,7 @@ pub async fn patch_api_key( /// If there is an issue with the `key` or `uid` of a key, then you must recreate one from scratch. #[utoipa::path( delete, - path = "/{key}", + path = "/{uidOrKey}", tag = "Keys", security(("Bearer" = ["keys.delete", "keys.*", "*"])), params(("uidOrKey" = String, Path, format = Password, example = "7b198a7f-52a0-4188-8762-9ad93cd608b2", description = "The `uid` or `key` field of an existing API key", nullable = false)), diff --git a/crates/meilisearch/src/routes/indexes/facet_search.rs b/crates/meilisearch/src/routes/indexes/facet_search.rs index ab335c528..7a41f1f81 100644 --- a/crates/meilisearch/src/routes/indexes/facet_search.rs +++ b/crates/meilisearch/src/routes/indexes/facet_search.rs @@ -177,12 +177,10 @@ impl Aggregate for FacetSearchAggregator { /// Search for a facet value within a given facet. #[utoipa::path( post, - path = "/{indexUid}/facet-search", - tags = ["Indexes", "Facet Search"], + path = "{indexUid}/facet-search", + tag = "Facet Search", security(("Bearer" = ["search", "*"])), - params( - ("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false), - ), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = FacetSearchQuery, responses( (status = 200, description = "The documents are returned", body = SearchResult, content_type = "application/json", example = json!( diff --git a/crates/meilisearch/src/routes/indexes/mod.rs b/crates/meilisearch/src/routes/indexes/mod.rs index c6f2a9397..96a7d0131 100644 --- a/crates/meilisearch/src/routes/indexes/mod.rs +++ b/crates/meilisearch/src/routes/indexes/mod.rs @@ -110,7 +110,7 @@ impl IndexView { #[derive(Deserr, Debug, Clone, Copy, IntoParams)] #[deserr(error = DeserrQueryParamError, rename_all = camelCase, deny_unknown_fields)] -#[into_params(rename_all = "camelCase")] +#[into_params(rename_all = "camelCase", parameter_in = Query)] pub struct ListIndexes { /// The number of indexes to skip before starting to retrieve anything #[param(value_type = Option, default, example = 100)] @@ -515,7 +515,7 @@ impl From for IndexStats { #[utoipa::path( get, path = "/{indexUid}/stats", - tags = ["Indexes", "Stats"], + tag = "Stats", security(("Bearer" = ["stats.get", "stats.*", "*"])), params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), responses( diff --git a/crates/meilisearch/src/routes/indexes/settings.rs b/crates/meilisearch/src/routes/indexes/settings.rs index 10d11b11b..17319f830 100644 --- a/crates/meilisearch/src/routes/indexes/settings.rs +++ b/crates/meilisearch/src/routes/indexes/settings.rs @@ -85,8 +85,9 @@ macro_rules! make_setting_route { #[utoipa::path( delete, path = concat!("{indexUid}/settings", $route), - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.update", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = $type, responses( (status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( @@ -146,8 +147,9 @@ macro_rules! make_setting_route { #[utoipa::path( $update_verb, path = concat!("{indexUid}/settings", $route), - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.update", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = $type, responses( (status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( @@ -229,8 +231,9 @@ macro_rules! make_setting_route { #[utoipa::path( get, path = concat!("{indexUid}/settings", $route), - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.get", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = $type, responses( (status = 200, description = concat!($camelcase_attr, " is returned"), body = SummarizedTaskView, content_type = "application/json", example = json!( @@ -500,8 +503,9 @@ make_setting_routes!( #[utoipa::path( patch, path = "{indexUid}/settings", - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.update", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = Settings, responses( (status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( @@ -609,8 +613,9 @@ pub async fn update_all( #[utoipa::path( get, path = "{indexUid}/settings", - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.update", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), responses( (status = 200, description = "Settings are returned", body = Settings, content_type = "application/json", example = json!( Settings::::default() @@ -644,8 +649,9 @@ pub async fn get_all( #[utoipa::path( delete, path = "{indexUid}/settings", - tags = ["Indexes", "Settings"], + tag = "Settings", security(("Bearer" = ["settings.update", "settings.*", "*"])), + params(("indexUid", example = "movies", description = "Index Unique Identifier", nullable = false)), responses( (status = 200, description = "Task successfully enqueued", body = SummarizedTaskView, content_type = "application/json", example = json!( { diff --git a/crates/meilisearch/src/routes/indexes/similar.rs b/crates/meilisearch/src/routes/indexes/similar.rs index 63022b28f..4e0673a7d 100644 --- a/crates/meilisearch/src/routes/indexes/similar.rs +++ b/crates/meilisearch/src/routes/indexes/similar.rs @@ -51,8 +51,8 @@ pub fn configure(cfg: &mut web::ServiceConfig) { /// Retrieve documents similar to a specific search result. #[utoipa::path( get, - path = "/{indexUid}/similar", - tags = ["Indexes", "Similar documents"], + path = "{indexUid}/similar", + tag = "Similar documents", security(("Bearer" = ["search", "*"])), params( ("indexUid" = String, Path, example = "movies", description = "Index Unique Identifier", nullable = false), @@ -135,12 +135,10 @@ pub async fn similar_get( /// Retrieve documents similar to a specific search result. #[utoipa::path( post, - path = "/{indexUid}/similar", - tags = ["Indexes", "Similar documents"], + path = "{indexUid}/similar", + tag = "Similar documents", security(("Bearer" = ["search", "*"])), - params( - ("indexUid" = String, Path, example = "movies", description = "Index Unique Identifier", nullable = false), - ), + params(("indexUid" = String, Path, example = "movies", description = "Index Unique Identifier", nullable = false)), request_body = SimilarQuery, responses( (status = 200, description = "The documents are returned", body = SimilarResult, content_type = "application/json", example = json!(