GET [...]/rest.php/wikibase/v0/suggest/items?language=en&q=...
Request parameters (query parameters)
- q - search term
- language - language code
Response structure in pseudo-JSON
{
"results": [
{
"id": "Q123",
"display-label": {
"language": "<language code of LABEL or ALIAS>",
"value": "<LABEL or ALIAS of the matched Item/Property>"
},
"description": {
"language": "<language code of DESCRIPTION>",
"value": "<DESCRIPTION>"
},
"match": {
"type": <"label" OR "alias">,
"language": "<language code of LABEL or ALIAS>",
"text": "<LABEL or ALIAS that matched the search query>"
}
},
...
]
}Acceptance criteria:
- consider labels and aliases in the search, same as in the other existing RESTful search
- matching item/property when its ID is provided as the query works, same as in the other existing RESTful search
- Basic functionality of language fallback and matched data are implemented
- The only sophisticated functionality to be implemented will be pagination
- Errors to be the same as in simple item search
- URL matching i.e. matching item/property when its URL is provided as the query, same as in SimpleItemSearch
Task breakdown notes:
- OpenAPI schema
- create use case happy path with request and response objects
- use the existing EntitySearchHelper prefix search implementation (works for both Cirrus- and sql-based search)
- including unit tests
- request validation
- create RouteHandler that makes use of the use case + middlewares
- including end-to-end test
- handle ID/URL matches
- do what we did for T391663
- openapi validation test
- mark production ready