Error responses from the new MW REST API endpoints for Reading Lists (see T348491: Reading List REST Interface: create REST endpoints) differ from the existing RESTBase Reading Lists endpoints. Our mobile apps access fields within the existing JSON response, so this would be a breaking change. In particular, error responses are used to determine whether reading lists are set up for a user, so this would affect normal operations and not just error situations.
Because users may choose to run older versions of mobile apps, there would be no realistic way to change this on the mobile app side, even if we wanted to. So to avoid breakage, adjust error responses from the new endpoints to match error responses from the existing endpoints.
Example error response from RESTBase:
{
"type": "https://mediawiki.org/wiki/HyperSwitch/errors/bad_request",
"title": "readinglists-db-error-not-set-up",
"method": "post",
"detail": "Reading lists have not been set up for this user.",
"uri": "/en.wikipedia.org/v1/data/lists/teardown"
}Example error response from current MW REST endpoint:
{
"errorKey": "readinglists-db-error-not-set-up",
"httpCode": 400,
"httpReason": "Bad Request",
"messageTranslations": {
"en": "Reading lists have not been set up for this user."
}
}The teardown endpoint was used as an example, but this applies to all the MW REST Reading Lists endpoints:
- POST lists/setup endpoint
- POST lists/teardown endpoint
- GET lists endpoint
- GET lists/pages endpoint
- GET lists/changes/since endpoint
- POST lists endpoint
- POST lists/batch endpoint
- PUT lists endpoint
- DELETE lists endpoint
- GET lists/{id}/entries endpoint
- POST lists/{id}/entries endpoint
- POST lists/{id}/entries/batch endpoint
- DELETE lists/{id}/entries endpoint
