From 94809090a37fb73a2febd697c9808bca16afa3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 9 Jul 2024 11:11:24 +0200 Subject: [PATCH] Support not specifying a context --- meilisearch/src/routes/indexes/documents.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meilisearch/src/routes/indexes/documents.rs b/meilisearch/src/routes/indexes/documents.rs index 9faf8bc67..412ac8e47 100644 --- a/meilisearch/src/routes/indexes/documents.rs +++ b/meilisearch/src/routes/indexes/documents.rs @@ -24,7 +24,7 @@ use meilisearch_types::{milli, Document, Index}; use mime::Mime; use once_cell::sync::Lazy; use serde::Deserialize; -use serde_json::Value; +use serde_json::{Map, Value}; use tempfile::tempfile; use tokio::fs::File; use tokio::io::{AsyncSeekExt, AsyncWriteExt, BufWriter}; @@ -629,6 +629,7 @@ pub async fn edit_documents_by_function( filter_expr: filter, context: match context { Some(Value::Object(m)) => Some(m), + None => Some(Map::default()), _ => { return Err(ResponseError::from_msg( "The context must be an object".to_string(),