Page MenuHomePhabricator

Reader gets page description
Closed, ResolvedPublic1 Estimated Story Points

Description

"As a Reader, I want to get a short page description, so that I can know the basic information about the subject of the page."

This is a user story for a unified page description API. It's modeled here as a separate entity rather than a property of the Page object, per the REST API design principles.

The interface should be the same whether the description comes from Wikidata or from a local page property.

This should fetch the description from either the 'shortdesc' page prop, if this wiki uses local descriptions, or from Wikidata, if it uses Wikidata descriptions.

See T259622 for configuration options.


GET /page/{title}/description

Returns the description of the page.

Notable request headers: None

Request body: empty

Status:
200 – return the description
403 - user isn't authorized to read the description
404 – page does not exist (never created or deleted)

Notable response headers: none

Body: JSON

  • description: The description of the page, string, plain text (no wikitext or HTML markup)

Event Timeline

eprodromou updated the task description. (Show Details)
Pchelolo set the point value for this task to 1.Sep 9 2020, 3:42 PM

What about language variants? I think we will support language variants via accept-language header.

Change 627378 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/services/mobileapps@master] WIP: Add REST api for short descriptions

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

Change 627378 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Add REST endpoints for short page descriptions.

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

Change 630671 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[operations/deployment-charts@master] Update mobileapps to 2020-09-28-145812-production

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

Change 630671 merged by jenkins-bot:
[operations/deployment-charts@master] Update mobileapps to 2020-09-28-145812-production

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

Pchelolo subscribed.

Done:

enwiki:

curl https://api.wikimedia.org/core/v1/wikipedia/en/page/San_Francisco/description
{"description":"Consolidated city-county in California, US"}

For lang-variants support see T259625#6502392

Looks good here. The enwp description matches what's on the Wikipedia page, and the frwp description matches what's in Wikidata.

https://api.wikimedia.org/core/v1/wikipedia/fr/page/San_Francisco/description

Added to API Portal reference docs. Feedback and direct edits welcome!

No response, closing.