Page MenuHomePhabricator

Improve language fallback documentation
Closed, ResolvedPublic1 Estimated Story Points

Description

The fact that the /labels_with_language_fallback and /descriptions_with_language_fallback endpoints implement language fallbacks through http redirects isn't documented well in our OpenAPI document. This may be confusing for users expecting to get the fallback labels/descriptions immediately in the response body, see e.g. T384522.

Relevant endpoints:

  • /entities/items/{item_id}/labels_with_language_fallback/{language_code}
  • /entities/items/{item_id}/descriptions_with_language_fallback/{language_code}
  • /entities/properties/{property_id}/labels_with_language_fallback/{language_code}
  • /entities/properties/{property_id}/descriptions_with_language_fallback/{language_code}

Acceptance criteria:

  • A description of relevant paths states " If a label is defined in the requested language, the API responds with a 200 status code and includes the label in the response payload. If a label only exists in a fallback language, the API returns a 307 status code and provides the location of the label" (and a respective text for description related paths)
  • For language fallback endpoints, description of 200 response code in Open API document and published "autodocs" page states: A label in a specific language. If a label only exists in a fallback language, its location will be provided with response status 307 or respectively A description in a specific language. If a description only exists in a fallback language, its location will be provided with response status 307
  • For language fallback endpoints, description of 307 response code in Open API document and published "autodocs" page states: A label in a fallback language exists in the indicated location or respectively A description in a fallback language exists in the indicated location

Event Timeline

A potential way of improving could be clarifying the "semantics" of 200 and 307 responses in the case of abc_with_language_fallback routes.

WMDE-leszek set the point value for this task to 1.Jan 30 2025, 11:20 AM

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

[mediawiki/extensions/Wikibase@master] REST: Improves language fallback documentation

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

Change #1122566 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Improve documentation for language fallback endpoints

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