Page MenuHomePhabricator

Curator reads a revision slot online
Open, Needs TriagePublic

Description

"As a Curator, I want to read a revision slot with HTML separate from the JSON, so I can load the HTML as fast as possible."

As with T234377, we want separate endpoints for metadata and HTML so that it loads fast.

GET /revision/{id}/slot/{role}/bare

Gets the metadata about the slot without the HTML attached.

Request body: none

Notable request headers: none

Status codes:

  • 200: the response body is the slot
  • 401: reading this slot requires the user to be authenticated and they are not
  • 403: the user is forbidden to read this slot
  • 404: there is no revision with this ID or that revision has no slot with this role

Notable response headers: none

Response body: JSON object, with the following properties

  • id: id of the slot
  • content_model: content model of the slot
  • html_url: URL of the HTML for the slot (see below)

GET /revision/{id}/slot/{role}/html

Gets HTML for the slot, not embedded in JSON.

Request body: none

Notable request headers: none

Status codes:

  • 200: the response body is the HTML
  • 400: this slot content model or role cannot be rendered as HTML
  • 401: reading this slot requires the user to be authenticated and they are not
  • 403: the user is forbidden to read this slot
  • 404: there is no revision with this id or that revision has no slot with this role

Notable response headers: none

Response body: HTML, rendered representation of the slot