Page MenuHomePhabricator

๐Ÿ ๏ธ Provide an initial way of reading property data using Wikibase REST API
Closed, ResolvedPublic8 Estimated Story Points

Description

As a developer I want to fetch the data of a property, so I can use elements I need in my application

GET /entities/properties/{property_id}

Can be seen as a counterpart of GET /entities/items/{item_id}

The structure of data in response will be similar to item data structure with additional top-level data-type field carrying the data on the property's data type. There will be no sitelinks field and the Action API's claims field will be renamed to statements.

Note:

  • authentication and authorization - same treatment as existing for GET item data endpoint.
  • sitelinks do not exist on properties
  • redirects do not exist for properties

To not include in this story (will be done later on)

  • handling conditional HTTP headers
  • _fields parameter to define what property data elements to include in the API response

Error cases to consider:

error type HTTP Response codeResponse content
Property with the given ID does not exist404"code": "property-not-found",
"message": "Could not find a property with the ID: '{property_id}'"
ID provided is not a valid property ID400 "code": "invalid-property-id",
"message": "Not a valid property ID: '{property_id}'"

Any authentication/authorization errors -- rely on the behaviour of the Mediawiki REST API "framework".

Related Objects

Event Timeline

WMDE-leszek renamed this task from Provide an initial way of read property data using Wikibase REST API to Provide an initial way of reading property data using Wikibase REST API.May 30 2023, 9:52 AM
WMDE-leszek set the point value for this task to 8.

Notes from task breakdown:

  • add property endpoint to the openapi definition - @Jakob_WMDE creates task
  • property data serializer - @Muhammad_Yasser_Jazirahly_WMDE creates task
    • if picked up first (before the sub task below), make a separate patch containing only the PropertyData read model
  • property data retriever - @WMDE_Norman creates task
    • if picked up first (before the sub task above), make a separate patch containing only the PropertyData read model
  • happy path: respond with property data (labels, descriptions, aliases, data-type, statements) - @Ollie.Shotton_WMDE creates task
  • add revision id and modification timestamp in etag and last-modified headers - @Silvan_WMDE creates task
  • respond 400 if the property id is invalid - @Jakob_WMDE creates task
  • respond 404 if the property does not exist - @Muhammad_Yasser_Jazirahly_WMDE creates task
  • middlewares (authentication, user agent, content type, unexpected error handling) - @WMDE_Norman creates task
  • write spec tests - @Ollie.Shotton_WMDE creates task
  • mark as production ready - @Silvan_WMDE creates task
Jakob_WMDE renamed this task from Provide an initial way of reading property data using Wikibase REST API to ๐Ÿ ๏ธ Provide an initial way of reading property data using Wikibase REST API.May 31 2023, 10:33 AM