Page MenuHomePhabricator

🥸️ Provide data of all item's aliases
Closed, ResolvedPublic8 Estimated Story Points

Description

GET /entities/items/{item_id}/aliases

The respective successful responses should present the relevant data in a structure being a subset of the response of GET /entities/items/{item_id}

Cases to consider:

  • if {item_id} is a redirect, the API should generate a 308 response redirecting to a respective path on the redirect target
  • if {item_id} does not exist, the API should generate a 404 response { "code": "item-not-found", "message": "Could not find an item with the ID: {item_id}" }
  • if {item_id} is not a valid item ID, the API should generate a 400 response { "code": "invalid-item-id", "message": "Not a valid item ID: {item_id}"}

Related Objects

Event Timeline

Silvan_WMDE set the point value for this task to 8.Jan 25 2023, 10:55 AM

Task breakdown notes:

  • add the GET /entities/items/{item_id}/aliases route to our OpenAPI definition T330892
  • Create AliasesInLanguage and Aliases read models. T330895
  • implement ItemAliasesRetriever using a TermBuffer (TermBufferAliasesRetriever) T330896
    • create a ItemAliasesRetriever interface with a getAliases( ItemId $itemId ): ?Aliases; method
  • use case (GetItemAliases) happy path. T330907
    • create and return response using the data from the ItemAliasesRetriever, and revision metadata
  • create a AliasesSerializer (we don't need a dedicated presenter) T330901
  • route handler (happy path only) T330902
    • same middlewares as GetItemRouteHandler
    • calls json_encode on the serializer result
    • e2e tests
  • validate request and error if item id is invalid (just uses the existing ItemIdValidator but still create a dedicated use case validator) T330898
    • use case + route handler
    • e2e tests
  • return appropriate response if the item is a redirect or does not exist. T330908
    • use case + route handler
    • e2e tests
  • spec tests T330894
  • Use Aliases in ItemData read model. T330909
    • use AliasesSerializer in ItemDataSerializer once done
Muhammad_Yasser_Jazirahly_WMDE renamed this task from Provide data of all item's aliases to 🥸️ Provide data of all item's aliases.Mar 1 2023, 2:41 PM