mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 05:54:30 +01:00
Merge #2930
2930: fix wrong variant returned for invalid_api_key_indexes error r=ManyTheFish a=vishalsodani # Pull Request ## Related issue Fixes #2924 ## What does this PR do? - ... ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: vishalsodani <vishalsodani@rediffmail.com>
This commit is contained in:
commit
1d85eeecef
@ -12,7 +12,9 @@ pub enum AuthControllerError {
|
||||
MissingParameter(&'static str),
|
||||
#[error("`actions` field value `{0}` is invalid. It should be an array of string representing action names.")]
|
||||
InvalidApiKeyActions(Value),
|
||||
#[error("`indexes` field value `{0}` is invalid. It should be an array of string representing index names.")]
|
||||
#[error(
|
||||
"`{0}` is not a valid index uid. It should be an array of string representing index names."
|
||||
)]
|
||||
InvalidApiKeyIndexes(Value),
|
||||
#[error("`expiresAt` field value `{0}` 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'.")]
|
||||
InvalidApiKeyExpiresAt(Value),
|
||||
|
@ -350,7 +350,7 @@ async fn error_add_api_key_invalid_parameters_indexes() {
|
||||
assert_eq!(400, code, "{:?}", &response);
|
||||
|
||||
let expected_response = json!({
|
||||
"message": r#"`indexes` field value `{"name":"products"}` is invalid. It should be an array of string representing index names."#,
|
||||
"message": r#"`{"name":"products"}` is not a valid index uid. 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"
|
||||
@ -375,7 +375,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#"`indexes` field value `["invalid index # / \\name with spaces"]` is invalid. It should be an array of string representing index names."#,
|
||||
"message": r#"`["invalid index # / \\name with spaces"]` is not a valid index uid. 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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user