Page MenuHomePhabricator

πŸ”‘ [Generalized error] invalid-key in request body
Closed, ResolvedPublic5 Estimated Story Points

Description

We originally included it in T366181 but that didn't make sense because language codes in the request body aren't values, they're the keys in labels/descriptions/aliases. This applies to both language_code and site_id keys.

response code: 400
error code: invalid-key
message: "Invalid key '{key}' in '{json_pointer_to_parent}'"
context: { "path": "{json_pointer_to_parent}", "key": "{key}" }

Event Timeline

Polishing - We don't think 'unexpected field' would work considering that it IS an expected field, just with an invalid value.

Another case that came up was for invalid-site-id (in the POST item)

We'd prefer keeping the original message for both

Refinement: Alt. generalized error that would fit both cases i.e., invalid language code and invalid site id. Error code to be "invalid-key" and error message TBD and HTTP error code will be 400.

Ifrahkhanyaree_WMDE renamed this task from Decide what to do about the invalid-language-code error to [Generalize error] invalid-key.Jul 23 2024, 9:48 AM

Task Breakdown notes

Two subtasks:

  • language_code
  • site_id
Dima_Koushha_WMDE renamed this task from [Generalize error] invalid-key to πŸ”‘ [Generalize error] invalid-key.Jul 23 2024, 3:06 PM
Dima_Koushha_WMDE renamed this task from πŸ”‘ [Generalize error] invalid-key to πŸ”‘ [Generalized error] invalid-key.Jul 24 2024, 10:14 AM
Ollie.Shotton_WMDE renamed this task from πŸ”‘ [Generalized error] invalid-key to πŸ”‘ [Generalized error] invalid-key in request body.Jul 24 2024, 10:23 AM