diff --git a/Cargo.lock b/Cargo.lock index 82ed8df6a..87d477d8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,6 +795,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cookie" version = "0.16.1" @@ -1040,7 +1049,7 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2 1.0.47", "quote 1.0.21", "rustc_version 0.4.0", @@ -2380,6 +2389,7 @@ version = "1.0.0" dependencies = [ "actix-web", "anyhow", + "convert_case 0.6.0", "csv", "either", "enum-iterator", diff --git a/dump/src/reader/compat/v5_to_v6.rs b/dump/src/reader/compat/v5_to_v6.rs index 8c0bad814..1b1555217 100644 --- a/dump/src/reader/compat/v5_to_v6.rs +++ b/dump/src/reader/compat/v5_to_v6.rs @@ -419,7 +419,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"41f91d3a94911b2735ec41b07540df5c"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"10c673c97f053830aa659876d7aa0b53"); assert_eq!(update_files.len(), 22); assert!(update_files[0].is_none()); // the dump creation assert!(update_files[1].is_some()); // the enqueued document addition diff --git a/dump/src/reader/mod.rs b/dump/src/reader/mod.rs index d7397b43a..ff11207e8 100644 --- a/dump/src/reader/mod.rs +++ b/dump/src/reader/mod.rs @@ -201,7 +201,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"41f91d3a94911b2735ec41b07540df5c"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"10c673c97f053830aa659876d7aa0b53"); assert_eq!(update_files.len(), 22); assert!(update_files[0].is_none()); // the dump creation assert!(update_files[1].is_some()); // the enqueued document addition @@ -279,7 +279,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"c2445ddd1785528b80f2ba534d3bd00c"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"e5528f611b0627ca23dc5ec835c2912f"); assert_eq!(update_files.len(), 10); assert!(update_files[0].is_some()); // the enqueued document addition assert!(update_files[1..].iter().all(|u| u.is_none())); // everything already processed @@ -356,7 +356,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"cd12efd308fe3ed226356a727ab42ed3"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"c3f9f3a22aa84613e9bb16617bdd5f11"); assert_eq!(update_files.len(), 10); assert!(update_files[0].is_some()); // the enqueued document addition assert!(update_files[1..].iter().all(|u| u.is_none())); // everything already processed @@ -449,7 +449,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"bc616290adfe7d09a624cf6065ca9069"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"2901e01c9a5ea7e44cc119164d24af75"); assert_eq!(update_files.len(), 9); assert!(update_files[0].is_some()); // the enqueued document addition assert!(update_files[1..].iter().all(|u| u.is_none())); // everything already processed @@ -542,7 +542,7 @@ pub(crate) mod test { // tasks let tasks = dump.tasks().unwrap().collect::>>().unwrap(); let (tasks, update_files): (Vec<_>, Vec<_>) = tasks.into_iter().unzip(); - meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"b3e3652bfc10a76670be157d2507d761"); + meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"9725ccfceea3f8d5846c44006c9e1e7b"); assert_eq!(update_files.len(), 9); assert!(update_files[..].iter().all(|u| u.is_none())); // no update file in dump v1 diff --git a/index-scheduler/src/snapshots/lib.rs/swap_indexes_errors/first_swap_failed.snap b/index-scheduler/src/snapshots/lib.rs/swap_indexes_errors/first_swap_failed.snap index fd9790835..3e95c5b25 100644 --- a/index-scheduler/src/snapshots/lib.rs/swap_indexes_errors/first_swap_failed.snap +++ b/index-scheduler/src/snapshots/lib.rs/swap_indexes_errors/first_swap_failed.snap @@ -10,7 +10,7 @@ source: index-scheduler/src/lib.rs 1 {uid: 1, status: succeeded, details: { primary_key: Some("id") }, kind: IndexCreation { index_uid: "b", primary_key: Some("id") }} 2 {uid: 2, status: succeeded, details: { primary_key: Some("id") }, kind: IndexCreation { index_uid: "c", primary_key: Some("id") }} 3 {uid: 3, status: succeeded, details: { primary_key: Some("id") }, kind: IndexCreation { index_uid: "d", primary_key: Some("id") }} -4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Indexes `e`, `f` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { swaps: [IndexSwap { indexes: ("a", "b") }, IndexSwap { indexes: ("c", "e") }, IndexSwap { indexes: ("d", "f") }] }, kind: IndexSwap { swaps: [IndexSwap { indexes: ("a", "b") }, IndexSwap { indexes: ("c", "e") }, IndexSwap { indexes: ("d", "f") }] }} +4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Indexes `e`, `f` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { swaps: [IndexSwap { indexes: ("a", "b") }, IndexSwap { indexes: ("c", "e") }, IndexSwap { indexes: ("d", "f") }] }, kind: IndexSwap { swaps: [IndexSwap { indexes: ("a", "b") }, IndexSwap { indexes: ("c", "e") }, IndexSwap { indexes: ("d", "f") }] }} ---------------------------------------------------------------------- ### Status: enqueued [] diff --git a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index/after_processing_the_10_tasks.snap b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index/after_processing_the_10_tasks.snap index ed28c121b..59e7a4509 100644 --- a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index/after_processing_the_10_tasks.snap +++ b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index/after_processing_the_10_tasks.snap @@ -6,16 +6,16 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} -1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} -2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} -3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} -4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} -5 {uid: 5, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000005, documents_count: 1, allow_index_creation: false }} -6 {uid: 6, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000006, documents_count: 1, allow_index_creation: false }} -7 {uid: 7, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000007, documents_count: 1, allow_index_creation: false }} -8 {uid: 8, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000008, documents_count: 1, allow_index_creation: false }} -9 {uid: 9, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000009, documents_count: 1, allow_index_creation: false }} +0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} +1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} +2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} +3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} +4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} +5 {uid: 5, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000005, documents_count: 1, allow_index_creation: false }} +6 {uid: 6, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000006, documents_count: 1, allow_index_creation: false }} +7 {uid: 7, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000007, documents_count: 1, allow_index_creation: false }} +8 {uid: 8, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000008, documents_count: 1, allow_index_creation: false }} +9 {uid: 9, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000009, documents_count: 1, allow_index_creation: false }} ---------------------------------------------------------------------- ### Status: enqueued [] diff --git a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/all_tasks_processed.snap b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/all_tasks_processed.snap index d995cab9e..05da8f83b 100644 --- a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/all_tasks_processed.snap +++ b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/all_tasks_processed.snap @@ -6,16 +6,16 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} -1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} -2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} -3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} -4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} -5 {uid: 5, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000005, documents_count: 1, allow_index_creation: false }} -6 {uid: 6, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000006, documents_count: 1, allow_index_creation: false }} -7 {uid: 7, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000007, documents_count: 1, allow_index_creation: false }} -8 {uid: 8, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000008, documents_count: 1, allow_index_creation: false }} -9 {uid: 9, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000009, documents_count: 1, allow_index_creation: false }} +0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} +1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} +2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} +3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} +4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} +5 {uid: 5, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000005, documents_count: 1, allow_index_creation: false }} +6 {uid: 6, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000006, documents_count: 1, allow_index_creation: false }} +7 {uid: 7, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000007, documents_count: 1, allow_index_creation: false }} +8 {uid: 8, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000008, documents_count: 1, allow_index_creation: false }} +9 {uid: 9, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000009, documents_count: 1, allow_index_creation: false }} ---------------------------------------------------------------------- ### Status: enqueued [] diff --git a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/five_tasks_processed.snap b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/five_tasks_processed.snap index 3ae875bff..3c33a3f57 100644 --- a/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/five_tasks_processed.snap +++ b/index-scheduler/src/snapshots/lib.rs/test_document_addition_cant_create_index_without_index_without_autobatching/five_tasks_processed.snap @@ -6,11 +6,11 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} -1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} -2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} -3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} -4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} +0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} +1 {uid: 1, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: false }} +2 {uid: 2, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} +3 {uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: false }} +4 {uid: 4, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000004, documents_count: 1, allow_index_creation: false }} 5 {uid: 5, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000005, documents_count: 1, allow_index_creation: false }} 6 {uid: 6, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000006, documents_count: 1, allow_index_creation: false }} 7 {uid: 7, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000007, documents_count: 1, allow_index_creation: false }} diff --git a/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/all_tasks_processed.snap b/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/all_tasks_processed.snap index 19ee47359..d2ebddf08 100644 --- a/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/all_tasks_processed.snap +++ b/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/all_tasks_processed.snap @@ -6,7 +6,7 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} +0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} 1 {uid: 1, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} 2 {uid: 2, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} 3 {uid: 3, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: true }} diff --git a/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/only_first_task_failed.snap b/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/only_first_task_failed.snap index ed57bc4e3..00edf1ef7 100644 --- a/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/only_first_task_failed.snap +++ b/index-scheduler/src/snapshots/lib.rs/test_document_addition_mixed_right_without_index_starts_with_cant_create/only_first_task_failed.snap @@ -6,7 +6,7 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_not_found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} +0 {uid: 0, status: failed, error: ResponseError { code: 200, message: "Index `doggos` not found.", error_code: "index_not_found", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index-not-found" }, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: false }} 1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} 2 {uid: 2, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 1, allow_index_creation: false }} 3 {uid: 3, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000003, documents_count: 1, allow_index_creation: true }} diff --git a/meilisearch-types/Cargo.toml b/meilisearch-types/Cargo.toml index b0e55b1d5..72170359a 100644 --- a/meilisearch-types/Cargo.toml +++ b/meilisearch-types/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] actix-web = { version = "4.2.1", default-features = false } anyhow = "1.0.65" +convert_case = "0.6.0" csv = "1.1.6" either = { version = "1.6.1", features = ["serde"] } enum-iterator = "1.1.3" diff --git a/meilisearch-types/src/error.rs b/meilisearch-types/src/error.rs index 846b690b0..54231cf2b 100644 --- a/meilisearch-types/src/error.rs +++ b/meilisearch-types/src/error.rs @@ -3,6 +3,7 @@ use std::{fmt, io}; use actix_web::http::StatusCode; use actix_web::{self as aweb, HttpResponseBuilder}; use aweb::rt::task::JoinError; +use convert_case::Casing; use milli::heed::{Error as HeedError, MdbError}; use serde::{Deserialize, Serialize}; @@ -355,7 +356,10 @@ impl Code { /// return the doc url associated with the error fn url(&self) -> String { - format!("https://docs.meilisearch.com/errors#{}", self.name()) + format!( + "https://docs.meilisearch.com/errors#{}", + self.name().to_case(convert_case::Case::Kebab) + ) } } diff --git a/meilisearch/tests/auth/api_keys.rs b/meilisearch/tests/auth/api_keys.rs index 052eb7509..80e5d01f6 100644 --- a/meilisearch/tests/auth/api_keys.rs +++ b/meilisearch/tests/auth/api_keys.rs @@ -199,7 +199,7 @@ async fn error_add_api_key_no_header() { "message": "The Authorization header is missing. It must use the bearer authorization method.", "code": "missing_authorization_header", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_authorization_header" + "link": "https://docs.meilisearch.com/errors#missing-authorization-header" }); assert_eq!(response, expected_response); @@ -223,7 +223,7 @@ async fn error_add_api_key_bad_key() { "message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }); assert_eq!(response, expected_response); @@ -247,7 +247,7 @@ async fn error_add_api_key_missing_parameter() { "message": "`indexes` field is mandatory.", "code": "missing_parameter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_parameter" + "link": "https://docs.meilisearch.com/errors#missing-parameter" }); assert_eq!(response, expected_response); @@ -265,7 +265,7 @@ async fn error_add_api_key_missing_parameter() { "message": "`actions` field is mandatory.", "code": "missing_parameter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_parameter" + "link": "https://docs.meilisearch.com/errors#missing-parameter" }); assert_eq!(response, expected_response); @@ -283,7 +283,7 @@ async fn error_add_api_key_missing_parameter() { "message": "`expiresAt` field is mandatory.", "code": "missing_parameter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_parameter" + "link": "https://docs.meilisearch.com/errors#missing-parameter" }); assert_eq!(response, expected_response); @@ -307,7 +307,7 @@ async fn error_add_api_key_invalid_parameters_description() { "message": r#"`description` field value `{"name":"products"}` is invalid. It should be a string or specified as a null value."#, "code": "invalid_api_key_description", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_description" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-description" }); assert_eq!(response, expected_response); @@ -331,7 +331,7 @@ async fn error_add_api_key_invalid_parameters_name() { "message": r#"`name` field value `{"name":"products"}` is invalid. It should be a string or specified as a null value."#, "code": "invalid_api_key_name", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_name" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-name" }); assert_eq!(response, expected_response); @@ -355,7 +355,7 @@ async fn error_add_api_key_invalid_parameters_indexes() { "message": r#"`indexes` field value `{"name":"products"}` is invalid. It should be an array of string representing index names."#, "code": "invalid_api_key_indexes", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_indexes" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-indexes" }); assert_eq!(response, expected_response); @@ -380,7 +380,7 @@ async fn error_add_api_key_invalid_index_uids() { "message": r#"`invalid index # / \name with spaces` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_)."#, "code": "invalid_api_key_indexes", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_indexes" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-indexes" }); assert_eq!(response, expected_response); @@ -405,7 +405,7 @@ async fn error_add_api_key_invalid_parameters_actions() { "message": r#"`actions` field value `{"name":"products"}` is invalid. It should be an array of string representing action names."#, "code": "invalid_api_key_actions", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_actions" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-actions" }); assert_eq!(response, expected_response); @@ -425,7 +425,7 @@ async fn error_add_api_key_invalid_parameters_actions() { "message": r#"`actions` field value `["doc.add"]` is invalid. It should be an array of string representing action names."#, "code": "invalid_api_key_actions", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_actions" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-actions" }); assert_eq!(response, expected_response); @@ -449,7 +449,7 @@ async fn error_add_api_key_invalid_parameters_expires_at() { "message": r#"`expiresAt` field value `{"name":"products"}` is invalid. It should follow the RFC 3339 format to represents a date or datetime in the future or specified as a null value. e.g. 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'."#, "code": "invalid_api_key_expires_at", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_expires_at" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-expires-at" }); assert_eq!(response, expected_response); @@ -473,7 +473,7 @@ async fn error_add_api_key_invalid_parameters_expires_at_in_the_past() { "message": r#"`expiresAt` field value `"2010-11-13T00:00:00Z"` is invalid. It should follow the RFC 3339 format to represents a date or datetime in the future or specified as a null value. e.g. 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'."#, "code": "invalid_api_key_expires_at", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_expires_at" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-expires-at" }); assert_eq!(response, expected_response); @@ -498,7 +498,7 @@ async fn error_add_api_key_invalid_parameters_uid() { "message": r#"`uid` field value `"aaaaabbbbbccc"` is invalid. It should be a valid UUID v4 string or omitted."#, "code": "invalid_api_key_uid", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_uid" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-uid" }); assert_eq!(response, expected_response); @@ -527,7 +527,7 @@ async fn error_add_api_key_parameters_uid_already_exist() { "message": "`uid` field value `4bc0887a-0e41-4f3b-935d-0c451dcee9c8` is already an existing API key.", "code": "api_key_already_exists", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#api_key_already_exists" + "link": "https://docs.meilisearch.com/errors#api-key-already-exists" }); assert_eq!(response, expected_response); @@ -622,7 +622,7 @@ async fn error_get_api_key_no_header() { "message": "The Authorization header is missing. It must use the bearer authorization method.", "code": "missing_authorization_header", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_authorization_header" + "link": "https://docs.meilisearch.com/errors#missing-authorization-header" }); assert_eq!(response, expected_response); @@ -642,7 +642,7 @@ async fn error_get_api_key_bad_key() { "message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }); assert_eq!(response, expected_response); @@ -662,7 +662,7 @@ async fn error_get_api_key_not_found() { "message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.", "code": "api_key_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#api_key_not_found" + "link": "https://docs.meilisearch.com/errors#api-key-not-found" }); assert_eq!(response, expected_response); @@ -757,7 +757,7 @@ async fn error_list_api_keys_no_header() { "message": "The Authorization header is missing. It must use the bearer authorization method.", "code": "missing_authorization_header", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_authorization_header" + "link": "https://docs.meilisearch.com/errors#missing-authorization-header" }); assert_eq!(response, expected_response); @@ -775,7 +775,7 @@ async fn error_list_api_keys_bad_key() { "message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }); assert_eq!(response, expected_response); @@ -835,7 +835,7 @@ async fn error_delete_api_key_no_header() { "message": "The Authorization header is missing. It must use the bearer authorization method.", "code": "missing_authorization_header", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_authorization_header" + "link": "https://docs.meilisearch.com/errors#missing-authorization-header" }); assert_eq!(response, expected_response); @@ -855,7 +855,7 @@ async fn error_delete_api_key_bad_key() { "message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }); assert_eq!(response, expected_response); @@ -875,7 +875,7 @@ async fn error_delete_api_key_not_found() { "message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.", "code": "api_key_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#api_key_not_found" + "link": "https://docs.meilisearch.com/errors#api-key-not-found" }); assert_eq!(response, expected_response); @@ -1168,7 +1168,7 @@ async fn error_patch_api_key_indexes() { let expected = json!({"message": "The `indexes` field cannot be modified for the given resource.", "code": "immutable_field", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#immutable_field" + "link": "https://docs.meilisearch.com/errors#immutable-field" }); assert_json_include!(actual: response, expected: expected); @@ -1223,7 +1223,7 @@ async fn error_patch_api_key_actions() { let expected = json!({"message": "The `actions` field cannot be modified for the given resource.", "code": "immutable_field", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#immutable_field" + "link": "https://docs.meilisearch.com/errors#immutable-field" }); assert_json_include!(actual: response, expected: expected); @@ -1270,7 +1270,7 @@ async fn error_patch_api_key_expiration_date() { let expected = json!({"message": "The `expiresAt` field cannot be modified for the given resource.", "code": "immutable_field", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#immutable_field" + "link": "https://docs.meilisearch.com/errors#immutable-field" }); assert_json_include!(actual: response, expected: expected); @@ -1292,7 +1292,7 @@ async fn error_patch_api_key_no_header() { "message": "The Authorization header is missing. It must use the bearer authorization method.", "code": "missing_authorization_header", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_authorization_header" + "link": "https://docs.meilisearch.com/errors#missing-authorization-header" }); assert_eq!(response, expected_response); @@ -1315,7 +1315,7 @@ async fn error_patch_api_key_bad_key() { "message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }); assert_eq!(response, expected_response); @@ -1338,7 +1338,7 @@ async fn error_patch_api_key_not_found() { "message": "API key `d0552b41d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4` not found.", "code": "api_key_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#api_key_not_found" + "link": "https://docs.meilisearch.com/errors#api-key-not-found" }); assert_eq!(response, expected_response); @@ -1377,7 +1377,7 @@ async fn error_patch_api_key_indexes_invalid_parameters() { "message": "`description` field value `13` is invalid. It should be a string or specified as a null value.", "code": "invalid_api_key_description", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_description" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-description" }); assert_eq!(response, expected_response); @@ -1394,7 +1394,7 @@ async fn error_patch_api_key_indexes_invalid_parameters() { "message": "`name` field value `13` is invalid. It should be a string or specified as a null value.", "code": "invalid_api_key_name", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_api_key_name" + "link": "https://docs.meilisearch.com/errors#invalid-api-key-name" }); assert_eq!(response, expected_response); @@ -1408,7 +1408,7 @@ async fn error_access_api_key_routes_no_master_key_set() { "message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.", "code": "missing_master_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_master_key" + "link": "https://docs.meilisearch.com/errors#missing-master-key" }); let expected_code = 401; @@ -1438,7 +1438,7 @@ async fn error_access_api_key_routes_no_master_key_set() { "message": "Meilisearch is running without a master key. To access this API endpoint, you must have set a master key at launch.", "code": "missing_master_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#missing_master_key" + "link": "https://docs.meilisearch.com/errors#missing-master-key" }); let expected_code = 401; diff --git a/meilisearch/tests/auth/authorization.rs b/meilisearch/tests/auth/authorization.rs index fae6ee7e1..8ef2d108d 100644 --- a/meilisearch/tests/auth/authorization.rs +++ b/meilisearch/tests/auth/authorization.rs @@ -73,7 +73,7 @@ static INVALID_RESPONSE: Lazy = Lazy::new(|| { json!({"message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }) }); @@ -520,7 +520,7 @@ async fn error_creating_index_without_action() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); // try to create a index via add documents route diff --git a/meilisearch/tests/auth/payload.rs b/meilisearch/tests/auth/payload.rs index 78eec3eb2..8164acf48 100644 --- a/meilisearch/tests/auth/payload.rs +++ b/meilisearch/tests/auth/payload.rs @@ -37,7 +37,7 @@ async fn error_api_key_bad_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); // patch let req = test::TestRequest::patch() @@ -59,7 +59,7 @@ async fn error_api_key_bad_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); } #[actix_rt::test] @@ -96,7 +96,7 @@ async fn error_api_key_empty_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); // patch let req = test::TestRequest::patch() @@ -118,7 +118,7 @@ async fn error_api_key_empty_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); } #[actix_rt::test] @@ -154,7 +154,7 @@ async fn error_api_key_missing_content_types() { ); assert_eq!(response["code"], "missing_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing-content-type"); // patch let req = test::TestRequest::patch() @@ -175,7 +175,7 @@ async fn error_api_key_missing_content_types() { ); assert_eq!(response["code"], "missing_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing-content-type"); } #[actix_rt::test] @@ -200,7 +200,7 @@ async fn error_api_key_empty_payload() { assert_eq!(status_code, 400); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); assert_eq!(response["message"], json!(r#"A json payload is missing."#)); // patch @@ -217,7 +217,7 @@ async fn error_api_key_empty_payload() { assert_eq!(status_code, 400); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); assert_eq!(response["message"], json!(r#"A json payload is missing."#)); } @@ -243,7 +243,7 @@ async fn error_api_key_malformed_payload() { assert_eq!(status_code, 400); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); assert_eq!( response["message"], json!( @@ -265,7 +265,7 @@ async fn error_api_key_malformed_payload() { assert_eq!(status_code, 400); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); assert_eq!( response["message"], json!( diff --git a/meilisearch/tests/auth/tenant_token.rs b/meilisearch/tests/auth/tenant_token.rs index fbf9d2b49..af3e7c2a5 100644 --- a/meilisearch/tests/auth/tenant_token.rs +++ b/meilisearch/tests/auth/tenant_token.rs @@ -56,7 +56,7 @@ static INVALID_RESPONSE: Lazy = Lazy::new(|| { json!({"message": "The provided API key is invalid.", "code": "invalid_api_key", "type": "auth", - "link": "https://docs.meilisearch.com/errors#invalid_api_key" + "link": "https://docs.meilisearch.com/errors#invalid-api-key" }) }); diff --git a/meilisearch/tests/content_type.rs b/meilisearch/tests/content_type.rs index e16a83c06..5759d4d9e 100644 --- a/meilisearch/tests/content_type.rs +++ b/meilisearch/tests/content_type.rs @@ -88,7 +88,7 @@ async fn error_json_bad_content_type() { "message": r#"A Content-Type header is missing. Accepted values for the Content-Type header are: `application/json`"#, "code": "missing_content_type", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_content_type", + "link": "https://docs.meilisearch.com/errors#missing-content-type", }), "when calling the route `{}` with no content-type", route, @@ -117,7 +117,7 @@ async fn error_json_bad_content_type() { "message": expected_error_message, "code": "invalid_content_type", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_content_type", + "link": "https://docs.meilisearch.com/errors#invalid-content-type", }), "when calling the route `{}` with a content-type of `{}`", route, diff --git a/meilisearch/tests/documents/add_documents.rs b/meilisearch/tests/documents/add_documents.rs index 72bcf8568..9811a8420 100644 --- a/meilisearch/tests/documents/add_documents.rs +++ b/meilisearch/tests/documents/add_documents.rs @@ -193,7 +193,7 @@ async fn error_add_documents_test_bad_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); // put let req = test::TestRequest::put() @@ -214,7 +214,7 @@ async fn error_add_documents_test_bad_content_types() { ); assert_eq!(response["code"], "invalid_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#invalid-content-type"); } /// missing content-type must be refused @@ -248,7 +248,7 @@ async fn error_add_documents_test_no_content_type() { ); assert_eq!(response["code"], "missing_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing-content-type"); // put let req = test::TestRequest::put() @@ -268,7 +268,7 @@ async fn error_add_documents_test_no_content_type() { ); assert_eq!(response["code"], "missing_content_type"); assert_eq!(response["type"], "invalid_request"); - assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing_content_type"); + assert_eq!(response["link"], "https://docs.meilisearch.com/errors#missing-content-type"); } #[actix_rt::test] @@ -297,7 +297,7 @@ async fn error_add_malformed_csv_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); // put let req = test::TestRequest::put() @@ -318,7 +318,7 @@ async fn error_add_malformed_csv_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); } #[actix_rt::test] @@ -347,7 +347,7 @@ async fn error_add_malformed_json_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); // put let req = test::TestRequest::put() @@ -368,7 +368,7 @@ async fn error_add_malformed_json_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); // truncate @@ -393,7 +393,7 @@ async fn error_add_malformed_json_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); // add one more char to the long string to test if the truncating works. let document = format!("\"{}m\"", long); @@ -412,7 +412,7 @@ async fn error_add_malformed_json_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); } #[actix_rt::test] @@ -441,7 +441,7 @@ async fn error_add_malformed_ndjson_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); // put let req = test::TestRequest::put() @@ -460,7 +460,7 @@ async fn error_add_malformed_ndjson_documents() { ); assert_eq!(response["code"], json!("malformed_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#malformed-payload")); } #[actix_rt::test] @@ -484,7 +484,7 @@ async fn error_add_missing_payload_csv_documents() { assert_eq!(response["message"], json!(r#"A csv payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); // put let req = test::TestRequest::put() @@ -500,7 +500,7 @@ async fn error_add_missing_payload_csv_documents() { assert_eq!(response["message"], json!(r#"A csv payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); } #[actix_rt::test] @@ -524,7 +524,7 @@ async fn error_add_missing_payload_json_documents() { assert_eq!(response["message"], json!(r#"A json payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); // put let req = test::TestRequest::put() @@ -540,7 +540,7 @@ async fn error_add_missing_payload_json_documents() { assert_eq!(response["message"], json!(r#"A json payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); } #[actix_rt::test] @@ -564,7 +564,7 @@ async fn error_add_missing_payload_ndjson_documents() { assert_eq!(response["message"], json!(r#"A ndjson payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); // put let req = test::TestRequest::put() @@ -580,7 +580,7 @@ async fn error_add_missing_payload_ndjson_documents() { assert_eq!(response["message"], json!(r#"A ndjson payload is missing."#)); assert_eq!(response["code"], json!("missing_payload")); assert_eq!(response["type"], json!("invalid_request")); - assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing_payload")); + assert_eq!(response["link"], json!("https://docs.meilisearch.com/errors#missing-payload")); } #[actix_rt::test] @@ -639,7 +639,7 @@ async fn error_document_add_create_index_bad_uid() { "message": "`883 fj!` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).", "code": "invalid_index_uid", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_index_uid" + "link": "https://docs.meilisearch.com/errors#invalid-index-uid" }); assert_eq!(code, 400); @@ -765,7 +765,7 @@ async fn error_add_documents_bad_document_id() { assert_eq!(response["error"]["type"], json!("invalid_request")); assert_eq!( response["error"]["link"], - json!("https://docs.meilisearch.com/errors#invalid_document_id") + json!("https://docs.meilisearch.com/errors#invalid-document-id") ); } @@ -793,7 +793,7 @@ async fn error_add_documents_missing_document_id() { assert_eq!(response["error"]["type"], json!("invalid_request")); assert_eq!( response["error"]["link"], - json!("https://docs.meilisearch.com/errors#missing_document_id") + json!("https://docs.meilisearch.com/errors#missing-document-id") ); } @@ -827,7 +827,7 @@ async fn error_document_field_limit_reached() { "message": "A document cannot contain more than 65,535 fields.", "code": "document_fields_limit_reached", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#document_fields_limit_reached" + "link": "https://docs.meilisearch.com/errors#document-fields-limit-reached" }); assert_eq!(response["error"], expected_error); @@ -873,7 +873,7 @@ async fn error_add_documents_payload_size() { "message": "The provided payload reached the size limit.", "code": "payload_too_large", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#payload_too_large" + "link": "https://docs.meilisearch.com/errors#payload-too-large" }); assert_eq!(response, expected_response); @@ -913,7 +913,7 @@ async fn error_primary_key_inference() { "message": "The primary key inference process failed because the engine did not find any field ending with `id` in its name. Please specify the primary key manually using the `primaryKey` query parameter.", "code": "index_primary_key_no_candidate_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_primary_key_no_candidate_found" + "link": "https://docs.meilisearch.com/errors#index-primary-key-no-candidate-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -953,7 +953,7 @@ async fn error_primary_key_inference() { "message": "The primary key inference process failed because the engine found 3 fields ending with `id` in their name, such as 'id' and 'object_id'. Please specify the primary key manually using the `primaryKey` query parameter.", "code": "index_primary_key_multiple_candidates_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_primary_key_multiple_candidates_found" + "link": "https://docs.meilisearch.com/errors#index-primary-key-multiple-candidates-found" }, "duration": "[duration]", "enqueuedAt": "[date]", diff --git a/meilisearch/tests/documents/delete_documents.rs b/meilisearch/tests/documents/delete_documents.rs index e36e2f033..0abc24eca 100644 --- a/meilisearch/tests/documents/delete_documents.rs +++ b/meilisearch/tests/documents/delete_documents.rs @@ -95,7 +95,7 @@ async fn error_delete_batch_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); assert_eq!(code, 202); diff --git a/meilisearch/tests/documents/get_documents.rs b/meilisearch/tests/documents/get_documents.rs index 9bc54973e..69c60dbb4 100644 --- a/meilisearch/tests/documents/get_documents.rs +++ b/meilisearch/tests/documents/get_documents.rs @@ -27,7 +27,7 @@ async fn error_get_unexisting_document() { "message": "Document `1` not found.", "code": "document_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#document_not_found" + "link": "https://docs.meilisearch.com/errors#document-not-found" }); assert_eq!(response, expected_response); @@ -90,7 +90,7 @@ async fn error_get_unexisting_index_all_documents() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); assert_eq!(response, expected_response); diff --git a/meilisearch/tests/documents/update_documents.rs b/meilisearch/tests/documents/update_documents.rs index 688605861..3f31eb2e7 100644 --- a/meilisearch/tests/documents/update_documents.rs +++ b/meilisearch/tests/documents/update_documents.rs @@ -13,7 +13,7 @@ async fn error_document_update_create_index_bad_uid() { "message": "`883 fj!` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).", "code": "invalid_index_uid", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_index_uid" + "link": "https://docs.meilisearch.com/errors#invalid-index-uid" }); assert_eq!(code, 400); @@ -167,7 +167,7 @@ async fn error_update_documents_bad_document_id() { assert_eq!(response["error"]["type"], json!("invalid_request")); assert_eq!( response["error"]["link"], - json!("https://docs.meilisearch.com/errors#invalid_document_id") + json!("https://docs.meilisearch.com/errors#invalid-document-id") ); } @@ -193,6 +193,6 @@ async fn error_update_documents_missing_document_id() { assert_eq!(response["error"]["type"], "invalid_request"); assert_eq!( response["error"]["link"], - "https://docs.meilisearch.com/errors#missing_document_id" + "https://docs.meilisearch.com/errors#missing-document-id" ); } diff --git a/meilisearch/tests/index/create_index.rs b/meilisearch/tests/index/create_index.rs index 8e01a8113..6c5adb5c6 100644 --- a/meilisearch/tests/index/create_index.rs +++ b/meilisearch/tests/index/create_index.rs @@ -176,7 +176,7 @@ async fn error_create_existing_index() { "message": "Index `test` already exists.", "code": "index_already_exists", "type": "invalid_request", - "link":"https://docs.meilisearch.com/errors#index_already_exists" + "link":"https://docs.meilisearch.com/errors#index-already-exists" }); assert_eq!(response["error"], expected_response); @@ -192,7 +192,7 @@ async fn error_create_with_invalid_index_uid() { "message": "`test test#!` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).", "code": "invalid_index_uid", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_index_uid" + "link": "https://docs.meilisearch.com/errors#invalid-index-uid" }); assert_eq!(response, expected_response); diff --git a/meilisearch/tests/index/delete_index.rs b/meilisearch/tests/index/delete_index.rs index b6efc7a68..2c5fb51b2 100644 --- a/meilisearch/tests/index/delete_index.rs +++ b/meilisearch/tests/index/delete_index.rs @@ -35,7 +35,7 @@ async fn error_delete_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); let response = index.wait_task(0).await; diff --git a/meilisearch/tests/index/get_index.rs b/meilisearch/tests/index/get_index.rs index 3d3ba4b44..7bd8a0184 100644 --- a/meilisearch/tests/index/get_index.rs +++ b/meilisearch/tests/index/get_index.rs @@ -34,7 +34,7 @@ async fn error_get_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); assert_eq!(response, expected_response); @@ -190,7 +190,7 @@ async fn get_invalid_index_uid() { "message": "Index `this is not a valid index name` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }) ); } diff --git a/meilisearch/tests/index/stats.rs b/meilisearch/tests/index/stats.rs index 813f05b4a..a5828e32b 100644 --- a/meilisearch/tests/index/stats.rs +++ b/meilisearch/tests/index/stats.rs @@ -55,7 +55,7 @@ async fn error_get_stats_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); assert_eq!(response, expected_response); diff --git a/meilisearch/tests/index/update_index.rs b/meilisearch/tests/index/update_index.rs index 3c283407c..cad55babe 100644 --- a/meilisearch/tests/index/update_index.rs +++ b/meilisearch/tests/index/update_index.rs @@ -98,7 +98,7 @@ async fn error_update_existing_primary_key() { "message": "Index already has a primary key: `id`.", "code": "index_primary_key_already_exists", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_primary_key_already_exists" + "link": "https://docs.meilisearch.com/errors#index-primary-key-already-exists" }); assert_eq!(response["error"], expected_response); @@ -117,7 +117,7 @@ async fn error_update_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); assert_eq!(response["error"], expected_response); diff --git a/meilisearch/tests/search/errors.rs b/meilisearch/tests/search/errors.rs index add305083..731c86a73 100644 --- a/meilisearch/tests/search/errors.rs +++ b/meilisearch/tests/search/errors.rs @@ -12,7 +12,7 @@ async fn search_unexisting_index() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }); index @@ -73,7 +73,7 @@ async fn filter_invalid_syntax_object() { "message": "Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, or `_geoRadius` at `title & Glass`.\n1:14 title & Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": "title & Glass"}), |response, code| { @@ -98,7 +98,7 @@ async fn filter_invalid_syntax_array() { "message": "Was expecting an operation `=`, `!=`, `>=`, `>`, `<=`, `<`, `IN`, `NOT IN`, `TO`, `EXISTS`, `NOT EXISTS`, or `_geoRadius` at `title & Glass`.\n1:14 title & Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": ["title & Glass"]}), |response, code| { @@ -123,7 +123,7 @@ async fn filter_invalid_syntax_string() { "message": "Found unexpected characters at the end of the filter: `XOR title = Glass`. You probably forgot an `OR` or an `AND` rule.\n15:32 title = Glass XOR title = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": "title = Glass XOR title = Glass"}), |response, code| { @@ -148,7 +148,7 @@ async fn filter_invalid_attribute_array() { "message": "Attribute `many` is not filterable. Available filterable attributes are: `title`.\n1:5 many = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": ["many = Glass"]}), |response, code| { @@ -173,7 +173,7 @@ async fn filter_invalid_attribute_string() { "message": "Attribute `many` is not filterable. Available filterable attributes are: `title`.\n1:5 many = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": "many = Glass"}), |response, code| { @@ -198,7 +198,7 @@ async fn filter_reserved_geo_attribute_array() { "message": "`_geo` is a reserved keyword and thus can't be used as a filter expression. Use the _geoRadius(latitude, longitude, distance) built-in rule to filter on _geo field coordinates.\n1:5 _geo = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": ["_geo = Glass"]}), |response, code| { @@ -223,7 +223,7 @@ async fn filter_reserved_geo_attribute_string() { "message": "`_geo` is a reserved keyword and thus can't be used as a filter expression. Use the _geoRadius(latitude, longitude, distance) built-in rule to filter on _geo field coordinates.\n1:5 _geo = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": "_geo = Glass"}), |response, code| { @@ -248,7 +248,7 @@ async fn filter_reserved_attribute_array() { "message": "`_geoDistance` is a reserved keyword and thus can't be used as a filter expression.\n1:13 _geoDistance = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": ["_geoDistance = Glass"]}), |response, code| { @@ -273,7 +273,7 @@ async fn filter_reserved_attribute_string() { "message": "`_geoDistance` is a reserved keyword and thus can't be used as a filter expression.\n1:13 _geoDistance = Glass", "code": "invalid_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_filter" + "link": "https://docs.meilisearch.com/errors#invalid-filter" }); index .search(json!({"filter": "_geoDistance = Glass"}), |response, code| { @@ -298,7 +298,7 @@ async fn sort_geo_reserved_attribute() { "message": "`_geo` is a reserved keyword and thus can't be used as a sort expression. Use the _geoPoint(latitude, longitude) built-in rule to sort on _geo field coordinates.", "code": "invalid_sort", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_sort" + "link": "https://docs.meilisearch.com/errors#invalid-sort" }); index .search( @@ -328,7 +328,7 @@ async fn sort_reserved_attribute() { "message": "`_geoDistance` is a reserved keyword and thus can't be used as a sort expression.", "code": "invalid_sort", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_sort" + "link": "https://docs.meilisearch.com/errors#invalid-sort" }); index .search( @@ -358,7 +358,7 @@ async fn sort_unsortable_attribute() { "message": "Attribute `title` is not sortable. Available sortable attributes are: `id`.", "code": "invalid_sort", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_sort" + "link": "https://docs.meilisearch.com/errors#invalid-sort" }); index .search( @@ -388,7 +388,7 @@ async fn sort_invalid_syntax() { "message": "Invalid syntax for the sort parameter: expected expression ending by `:asc` or `:desc`, found `title`.", "code": "invalid_sort", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_sort" + "link": "https://docs.meilisearch.com/errors#invalid-sort" }); index .search( @@ -422,7 +422,7 @@ async fn sort_unset_ranking_rule() { "message": "The sort ranking rule must be specified in the ranking rules settings to use the sort parameter at search time.", "code": "invalid_sort", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_sort" + "link": "https://docs.meilisearch.com/errors#invalid-sort" }); index .search( diff --git a/meilisearch/tests/settings/get_settings.rs b/meilisearch/tests/settings/get_settings.rs index a3c667047..0b71dac1c 100644 --- a/meilisearch/tests/settings/get_settings.rs +++ b/meilisearch/tests/settings/get_settings.rs @@ -185,7 +185,7 @@ async fn error_update_setting_unexisting_index_invalid_uid() { "message": "`test##! ` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).", "code": "invalid_index_uid", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_index_uid"}); + "link": "https://docs.meilisearch.com/errors#invalid-index-uid"}); assert_eq!(response, expected); } @@ -290,7 +290,7 @@ async fn error_set_invalid_ranking_rules() { "message": r#"`manyTheFish` ranking rule is invalid. Valid ranking rules are words, typo, sort, proximity, attribute, exactness and custom ranking rules."#, "code": "invalid_ranking_rule", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_ranking_rule" + "link": "https://docs.meilisearch.com/errors#invalid-ranking-rule" }); assert_eq!(response["error"], expected_error); diff --git a/meilisearch/tests/tasks/mod.rs b/meilisearch/tests/tasks/mod.rs index 548fa90be..6341876fa 100644 --- a/meilisearch/tests/tasks/mod.rs +++ b/meilisearch/tests/tasks/mod.rs @@ -17,7 +17,7 @@ async fn error_get_unexisting_task_status() { "message": "Task `1` not found.", "code": "task_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#task_not_found" + "link": "https://docs.meilisearch.com/errors#task-not-found" }); assert_eq!(response, expected_response); @@ -184,7 +184,7 @@ async fn get_task_filter_error() { "message": "Query deserialize error: unknown field `lol`", "code": "bad_request", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#bad_request" + "link": "https://docs.meilisearch.com/errors#bad-request" } "###); @@ -195,7 +195,7 @@ async fn get_task_filter_error() { "message": "Task uid `pied` is invalid. It should only contain numeric characters.", "code": "invalid_task_uids_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_task_uids_filter" + "link": "https://docs.meilisearch.com/errors#invalid-task-uids-filter" } "###); @@ -206,7 +206,7 @@ async fn get_task_filter_error() { "message": "Query deserialize error: invalid digit found in string", "code": "bad_request", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#bad_request" + "link": "https://docs.meilisearch.com/errors#bad-request" } "###); @@ -217,7 +217,7 @@ async fn get_task_filter_error() { "message": "Task `beforeStartedAt` `pied` is invalid. It should follow the YYYY-MM-DD or RFC 3339 date-time format.", "code": "invalid_task_date_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_task_date_filter" + "link": "https://docs.meilisearch.com/errors#invalid-task-date-filter" } "###); } @@ -233,7 +233,7 @@ async fn delete_task_filter_error() { "message": "Query parameters to filter the tasks to delete are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.", "code": "missing_task_filters", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_task_filters" + "link": "https://docs.meilisearch.com/errors#missing-task-filters" } "###); @@ -244,7 +244,7 @@ async fn delete_task_filter_error() { "message": "Query deserialize error: unknown field `lol`", "code": "bad_request", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#bad_request" + "link": "https://docs.meilisearch.com/errors#bad-request" } "###); @@ -255,7 +255,7 @@ async fn delete_task_filter_error() { "message": "Task uid `pied` is invalid. It should only contain numeric characters.", "code": "invalid_task_uids_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_task_uids_filter" + "link": "https://docs.meilisearch.com/errors#invalid-task-uids-filter" } "###); } @@ -271,7 +271,7 @@ async fn cancel_task_filter_error() { "message": "Query parameters to filter the tasks to cancel are missing. Available query parameters are: `uids`, `indexUids`, `statuses`, `types`, `beforeEnqueuedAt`, `afterEnqueuedAt`, `beforeStartedAt`, `afterStartedAt`, `beforeFinishedAt`, `afterFinishedAt`.", "code": "missing_task_filters", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#missing_task_filters" + "link": "https://docs.meilisearch.com/errors#missing-task-filters" } "###); @@ -282,7 +282,7 @@ async fn cancel_task_filter_error() { "message": "Query deserialize error: unknown field `lol`", "code": "bad_request", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#bad_request" + "link": "https://docs.meilisearch.com/errors#bad-request" } "###); @@ -293,7 +293,7 @@ async fn cancel_task_filter_error() { "message": "Task uid `pied` is invalid. It should only contain numeric characters.", "code": "invalid_task_uids_filter", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_task_uids_filter" + "link": "https://docs.meilisearch.com/errors#invalid-task-uids-filter" } "###); } @@ -418,7 +418,7 @@ async fn test_summarized_delete_batch() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -477,7 +477,7 @@ async fn test_summarized_delete_document() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -539,7 +539,7 @@ async fn test_summarized_settings_update() { "message": "`custom` ranking rule is invalid. Valid ranking rules are words, typo, sort, proximity, attribute, exactness and custom ranking rules.", "code": "invalid_ranking_rule", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#invalid_ranking_rule" + "link": "https://docs.meilisearch.com/errors#invalid-ranking-rule" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -628,7 +628,7 @@ async fn test_summarized_index_creation() { "message": "Index `test` already exists.", "code": "index_already_exists", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_already_exists" + "link": "https://docs.meilisearch.com/errors#index-already-exists" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -661,7 +661,7 @@ async fn test_summarized_index_deletion() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -744,7 +744,7 @@ async fn test_summarized_index_update() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -772,7 +772,7 @@ async fn test_summarized_index_update() { "message": "Index `test` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]", @@ -864,7 +864,7 @@ async fn test_summarized_index_swap() { "message": "Indexes `cattos`, `doggos` not found.", "code": "index_not_found", "type": "invalid_request", - "link": "https://docs.meilisearch.com/errors#index_not_found" + "link": "https://docs.meilisearch.com/errors#index-not-found" }, "duration": "[duration]", "enqueuedAt": "[date]",