Page MenuHomePhabricator

Extend 422 invalid field error response for aliases
Closed, ResolvedPublic3 Estimated Story Points

Description

Description
This is what the error response looks like right now. We want the user to be able to know from the path, which alias from the array might be causing the error.

{
  "code": "patched-aliases-invalid-field",
  "message": "Patched value for '{field}' is invalid",
  "context": {
    "path": "{field}",
    "value": "{value}"
  }
}

Acceptance criteria

  • The path field includes the index of the alias that is causing the error

Example

{
  ...
  "context": {
    "path": "en/3",
    "value": "The\tThing"
  }
}

Event Timeline

Ifrahkhanyaree_WMDE renamed this task from Aliases invalid 422 - Path should indicate index of invalid alias to Extend 422 invalid field error response for aliases .Feb 13 2024, 4:12 PM
Ifrahkhanyaree_WMDE updated the task description. (Show Details)

Change #1020912 had a related patch set uploaded (by Dima koushha; author: Dima koushha):

[mediawiki/extensions/Wikibase@master] REST: Extend 422 invalid field error response for aliases

https://gerrit.wikimedia.org/r/1020912

Change #1020912 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Extend 422 invalid field error response for aliases

https://gerrit.wikimedia.org/r/1020912