From 5c7fa9b92457c1adc6b557ee49ffeaa906516994 Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 13 Jan 2025 11:40:57 +0100 Subject: [PATCH] fix the examples of the experimental-feature route --- crates/meilisearch/src/routes/features.rs | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/meilisearch/src/routes/features.rs b/crates/meilisearch/src/routes/features.rs index b7e85882f..30838de6f 100644 --- a/crates/meilisearch/src/routes/features.rs +++ b/crates/meilisearch/src/routes/features.rs @@ -45,13 +45,13 @@ pub fn configure(cfg: &mut web::ServiceConfig) { tag = "Experimental features", security(("Bearer" = ["experimental_features.get", "experimental_features.*", "*"])), responses( - (status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!( - { - "metrics": false, - "logsRoute": true, - "vectorSearch": false, - } - )), + (status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!(RuntimeTogglableFeatures { + vector_store: Some(true), + metrics: Some(true), + logs_route: Some(false), + edit_documents_by_function: Some(false), + contains_filter: Some(false), + })), (status = 401, description = "The authorization header is missing", body = ResponseError, content_type = "application/json", example = json!( { "message": "The Authorization header is missing. It must use the bearer authorization method.", @@ -75,8 +75,9 @@ async fn get_features( HttpResponse::Ok().json(features) } -#[derive(Debug, Deserr, ToSchema)] +#[derive(Debug, Deserr, ToSchema, Serialize)] #[deserr(error = DeserrJsonError, rename_all = camelCase, deny_unknown_fields)] +#[serde(rename_all = "camelCase")] #[schema(rename_all = "camelCase")] pub struct RuntimeTogglableFeatures { #[deserr(default)] @@ -129,13 +130,13 @@ impl Aggregate for PatchExperimentalFeatureAnalytics { tag = "Experimental features", security(("Bearer" = ["experimental_features.update", "experimental_features.*", "*"])), responses( - (status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!( - { - "metrics": false, - "logsRoute": true, - "vectorSearch": false, - } - )), + (status = OK, description = "Experimental features are returned", body = RuntimeTogglableFeatures, content_type = "application/json", example = json!(RuntimeTogglableFeatures { + vector_store: Some(true), + metrics: Some(true), + logs_route: Some(false), + edit_documents_by_function: Some(false), + contains_filter: Some(false), + })), (status = 401, description = "The authorization header is missing", body = ResponseError, content_type = "application/json", example = json!( { "message": "The Authorization header is missing. It must use the bearer authorization method.",