Skip to content

0.8.0 Release Notes

Gregory Engel edited this page Nov 8, 2018 · 1 revision

ANS 0.8.0

ANS 0.8.0 introduces a new element type and a new features for the distributor trait. Both additions enable support for the new Content Restrictions feature in Arc.

New Element: Restricted

A "restricted" element represents an piece of content (story, image, gallery, video, or collection) that is not visible to a particular reader because of legal reasons. This element indicates to consumers the id and type of the restricted item as well as information about the restriction rule that causes the content to be removed. This information can be used for debugging purposes or for surfacing errors to the user.

{
  "_id": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
  "type": "restricted_content",
  "version": "0.8.0",

  "restricted_content": {
    "type": "reference",
    "referent": {
      "id": "BBBDFEGHIJKLMNOPQRSTUVWXYZ",
      "type": "gallery"
    }
  },

  "reasons": [{
    "restriction_id": "CCCDFEGHIJKLMNOPQRSTUVWXYZ",
    "message": "This content is not available on website baltimore-sun because of restriction 'Tribune-only restriction'."
  }]
}

Schema: https://github.com/washingtonpost/ans-schema/blob/update-version/src/main/resources/schema/ans/0.8.0/restricted_content.json

Distributor Traits

ANS 0.8.0 introduces a new option for document distributor data. Instead of specifying the distributor directly on the document, you can now instead link a distributor by ID.

In Arc, support for configuring distributors that can be referenced this way will be added in an upcoming release.

{
  "type": "story",
  "version": "0.8.0",

  "distributor": {
    "id": "DDDDEFGHIJKLMNOPQRSTUVWXYZ",
    "mode": "reference"
  }
}

The old model of hard-coding distributor values into a document is still supported. (We now refer to that use case as "custom distributor" data.) Note that we use the new mode field to differentiate the new referenced distributor data from the custom mode. For backwards compatibility, this field may be omitted when using custom mode.

{
  "type": "story",
  "version": "0.8.0",

  "distributor": {
    "name": "Arc Publishing",
    "category": "staff",
    "subcategory": "photo team",
    "mode": "custom"
  }
}

Schema: https://github.com/washingtonpost/ans-schema/blob/update-version/src/main/resources/schema/ans/0.8.0/traits/trait_distributor.json