Fix Index name parsing error message to fit the specification

This commit is contained in:
ManyTheFish
2022-11-08 14:37:34 +01:00
parent 3999f74f78
commit 8bb260bf3e
7 changed files with 32 additions and 15 deletions

View File

@ -352,7 +352,7 @@ async fn error_add_api_key_invalid_parameters_indexes() {
assert_eq!(400, code, "{:?}", &response);
let expected_response = json!({
"message": r#"`{"name":"products"}` is not a valid index uid. It should be an array of string representing index names."#,
"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"
@ -377,7 +377,7 @@ async fn error_add_api_key_invalid_index_uids() {
let (response, code) = server.add_api_key(content).await;
let expected_response = json!({
"message": r#"`["invalid index # / \\name with spaces"]` is not a valid index uid. It should be an array of string representing index names."#,
"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"