Page MenuHomePhabricator

What's the reason for the `excerpt` property in the search/title endpoint?
Open, Needs TriagePublic

Description

The search/title endpoint seems to always return the title in the excerpt property. This is documented in https://www.mediawiki.org/wiki/API:REST_API/Reference#Schema as such but it's not clear what purpose this field has if it is the same as the value of the title field. Is it just there to have something non-null to return, and, in other words, to be able to mark it in the schema as required?

https://en.wikipedia.org/w/rest.php/v1/search/title?q=the%20rebel&limit=3

{
    "pages": [
        {
            "id": 52294167,
            "key": "The_Rebel_(South_Korean_TV_series)",
            "title": "The Rebel (South Korean TV series)",
            "excerpt": "The Rebel (South Korean TV series)",
            "description": "television series",
            "thumbnail": {
                "mimetype": "image/jpeg",
                "size": null,
                "width": 133,
                "height": 200,
                "duration": null,
                "url": "//upload.wikimedia.org/wikipedia/en/thumb/8/85/Poster_for_Thief_Who_Stole_the_People.jpg/133px-Poster_for_Thief_Who_Stole_the_People.jpg"
            }
        },
        {
            "id": 29730098,
            "key": "The_Rebel_Flesh",
            "title": "The Rebel Flesh",
            "excerpt": "The Rebel Flesh",
            "description": "episode of Doctor Who",
            "thumbnail": null
        },
        {
            "id": 5308866,
            "key": "The_Rebel_(TV_series)",
            "title": "The Rebel (TV series)",
            "excerpt": "The Rebel (TV series)",
            "description": "TV series",
            "thumbnail": {
                "mimetype": "image/jpeg",
                "size": null,
                "width": 150,
                "height": 200,
                "duration": null,
                "url": "//upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Nick_Adams_The_Rebel.JPG/150px-Nick_Adams_The_Rebel.JPG"
            }
        }
    ]
}

Event Timeline

Restricted Application added a subscriber: revi. · View Herald TranscriptAug 3 2020, 6:12 PM

Similarly, I'm not sure why null is returned for some fields that could be also omitted. This seems to also add to extra values that need to be transferred to the client and parsed on the client side.

Update: filed T259837 for this.