Repository: washingtonpost/ans-schema
Pull request #119 (2017-04-03 15:37:11)

Make ANS 0.5.8 non-breaking with respect to 0.5.7
Pushes new table format to `table_02` and leaves `corrections.text` in place. This is a partial repeal of #114 and #107

See: http://confluence.washpost.com/display/ETT/ANS+Future+Planning

This PR moves the new Gregor-inspired table format to a type called `table_02` and leaves the original `table` element intact for backwards compatibility.  Both types will need to be supported by Arc applications.

Example: 
```
{
  "type": "story",
  "version": "0.5.8",
  "content_elements": [
    {
      "_id": "0987654321",
      "type": "table",
      "header": [
        { "_id": "a", "type": "text",  "content": "Header Y = 1" },
        { "_id": "b", "type": "text",  "content": "Header Y = 1" }
      ],
      "rows": [
        [
          { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" },
          { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
        ],
        [ { "_id": "3", "type": "text",  "content": "X = 2, Y = 1" },
          { "_id": "4", "type": "text",  "content": "X = 2, Y = 2" }
        ]
      ]
    },
    {
      "type": "table_02",
      "_id": "0987654321",
      "subtype": "special_table",
      "channels": [ "all" ],
      "additional_properties": {
        "goodbye": "birdie"
      },

      "header": {
        "type": "table_row_02",
        "_id": "A",
        "subtype": "special_row",
        "channels": [ "web" ],
        "additional_properties": {
          "x": "y"
        },

        "cells": [
          {
            "type": "table_cell_02",
            "content_elements": [
              { "_id": "a", "type": "text",  "content": "Header Y = 1" }
            ]
          },
          {
            "type": "table_cell_02",
            "content_elements": [
              { "_id": "b", "type": "text",  "content": "Header Y = 1" }
            ]
          }
        ]
      },

      "rows": [
        {
          "type": "table_row_02",
          "_id": "B",
          "subtype": "special_row",
          "channels": [ "web" ],
          "additional_properties": {
            "x": "y"
          },

          "cells": [
            {
              "type": "table_cell_02",
              "_id": "B1",

              "subtype": "special_cell",
              "channels": [ "phone" ],
              "additional_properties": {
                "hi": "mom"
              },

              "content_elements": [
                { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
              ]

            },
            {
              "type": "table_cell_02",
              "content_elements": [
                { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
              ]
            }
          ]
        },

        {
          "_id": "C",
          "type": "table_row_02",
          "cells": [
            {
              "type": "table_cell_02",
              "content_elements": [
                { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
              ]
            },
            {
              "type": "table_cell_02",
              "content_elements": [
                { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
              ]
            }
          ]
        }

      ]

    }
  ]
}

```

Additionally, it reverts the `corrections` element to continue using the `.text` property as does 0.5.7:

```
{
  "type": "story",
  "version": "0.5.8",
  "corrections": [
    {
      "type": "correction",
      "correction_type": "clarification",
      "text": "What I said before was not exactly true."
    },
    {
      "type": "correction",
      "correction_type": "correction",
      "text": "What I said before was false and not true."
    }
  ]
}
```





Patch:
diff --git a/lib/upvert/0.5.7.js b/lib/upvert/0.5.7.js
index 7a786a8..241c611 100644
--- a/lib/upvert/0.5.7.js
+++ b/lib/upvert/0.5.7.js
@@ -14,23 +14,30 @@ var cleanFieldNames = transform_utils.cleanFieldNames;
 // Corrections underwent breaking changes
 var convertCorrection = function convertCorrection(old_correction) {
   // Corrections move from open to closed. We will leave any of either the new or old properties in place and move the rest to additional_properties
-  var correction = limitFields(['type', '_id', 'subtype', 'channels', 'alignment', 'additional_properties', 'correction_type', 'content', 'text'],
+  var correction = limitFields(['type', '_id', 'subtype', 'channels', 'alignment', 'additional_properties', 'correction_type', 'text'],
                                old_correction);
 
-  if (_.has(correction, 'text') && !_.isNil(correction.text)) {
-    if(_.has(correction, 'content')) {
-      if (!_.has(correction, 'additional_properties') || !_.isObject(correction.additional_properties)) {
-        correction.additional_properties = {};
-      }
-      correction.additional_properties.content = correction.content;
-    }
 
-    correction.content = correction.text;
+  // This was intended to move .corrections.text to .corrections.content.  We are backing that change out to maintain backwards compatibility.
+  //
+  // if (_.has(correction, 'text') && !_.isNil(correction.text)) {
+  //   if(_.has(correction, 'content')) {
+  //     if (!_.has(correction, 'additional_properties') || !_.isObject(correction.additional_properties)) {
+  //       correction.additional_properties = {};
+  //     }
+  //     correction.additional_properties.content = correction.content;
+  //   }
+
+  //   correction.content = correction.text;
+  // }
+
+  if (!_.has(correction, 'text') || !_.isString(correction.text)) {
+    correction.text = "";
   }
 
   correction.type = 'correction';
 
-  delete correction.text;
+  //delete correction.text;
 
   return correction;
 };
@@ -127,33 +134,35 @@ var convertComments = function convertComments(old_comments) {
   return comments;
 };
 
-var convertCell = function convertCell(old_cell) {
-  return {
-    "type": "table_cell",
-    "content_elements": [
-      old_cell
-    ]
-  };
-}
-
-
-var convertTable = function convertTable(old_table) {
-  // Convert header
-  old_table.header = {
-    "type": "table_row",
-    "cells": _.map(old_table.header, convertCell)
-  };
-
-  // Convert rows
-  old_table.rows = _.map(old_table.rows, function(row, i) {
-    return {
-      "type": "table_row",
-      "cells": _.map(row, convertCell)
-    };
-  });
 
-  return old_table;
-}
+
+// var convertCell = function convertCell(old_cell) {
+//   return {
+//     "type": "table_cell",
+//     "content_elements": [
+//       old_cell
+//     ]
+//   };
+// }
+
+
+// var convertTable = function convertTable(old_table) {
+//   // Convert header
+//   old_table.header = {
+//     "type": "table_row",
+//     "cells": _.map(old_table.header, convertCell)
+//   };
+
+//   // Convert rows
+//   old_table.rows = _.map(old_table.rows, function(row, i) {
+//     return {
+//       "type": "table_row",
+//       "cells": _.map(row, convertCell)
+//     };
+//   });
+
+//   return old_table;
+// }
 
 
 // Convert a top-level ANS document and recur at known points
@@ -199,9 +208,10 @@ var convert = function convert(ans) {
     if (_.includes(top_level_types, ans.type)) {
       return convertDocument(ans);
     }
-    else if (ans.type === 'table') {
-      return convertTable(ans);
-    }
+    // Note: instead of changing tables, we are making them table_02
+    // else if (ans.type === 'table') {
+    //   return convertTable(ans);
+    // }
   }
 
   return _.transform(ans, function(result, value, key, object) {
diff --git a/lib/validator.js b/lib/validator.js
index 31d0173..9eb256a 100644
--- a/lib/validator.js
+++ b/lib/validator.js
@@ -189,7 +189,7 @@ AnsValidator.prototype.getAllContentErrors = function getAllContentErrors(ans, v
   }
 
   // Recurse on items in rows, cells
-  if (_.has(ans, 'rows')) {
+  if (_.has(ans, 'rows') && ans.type !== 'table' && ans.type.indexOf("table") === 0) {
     var ver_object = new v.Version(v.parse_version(version));
     if (ver_object.gt(ver057)) {
       errors = _.reduce(ans.rows, function(errors, row, i) {
@@ -200,7 +200,7 @@ AnsValidator.prototype.getAllContentErrors = function getAllContentErrors(ans, v
     }
   }
 
-  if (_.has(ans, 'cells')) {
+  if (_.has(ans, 'cells') && ans.type.indexOf("table_row") === 0) {
     var ver_object = new v.Version(v.parse_version(version));
     if (ver_object.gt(ver057)) {
       errors = _.reduce(ans.cells, function(errors, cell, i) {
diff --git a/package.json b/package.json
index 2efe278..92bdda7 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "ans-schema",
   "description": "The Washington Post's Arc Native Specification",
-  "version": "1.2.16",
+  "version": "1.2.17",
   "homepage": "https://github.com/washingtonpost/ans-schema",
   "repository": {
     "type": "git",
diff --git a/src/main/resources/schema/ans/0.5.8/story_elements/correction.json b/src/main/resources/schema/ans/0.5.8/story_elements/correction.json
index ce0b8e2..2f9c536 100644
--- a/src/main/resources/schema/ans/0.5.8/story_elements/correction.json
+++ b/src/main/resources/schema/ans/0.5.8/story_elements/correction.json
@@ -32,11 +32,11 @@
       "description": "Type of correction. E.g., clarification, retraction.",
       "type": "string"
     },
-    "content": {
+    "text": {
       "description": "The text of the correction.",
       "type": "string"
     }
 
   },
-  "required": [ "type", "content" ]
+  "required": [ "type", "text" ]
 }
diff --git a/src/main/resources/schema/ans/0.5.8/story_elements/quote.json b/src/main/resources/schema/ans/0.5.8/story_elements/quote.json
index b001497..46d3e81 100644
--- a/src/main/resources/schema/ans/0.5.8/story_elements/quote.json
+++ b/src/main/resources/schema/ans/0.5.8/story_elements/quote.json
@@ -1,7 +1,7 @@
 {
   "$schema": "http://json-schema.org/draft-04/schema#",
   "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_elements/quote.json",
-  "description": "A blockquote content element",
+  "description": "A blockquote content element, incompatible with the original blockquote: https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_elements/blockquote.json",
   "type": "object",
   "additionalPropeties": false,
   "properties": {
diff --git a/src/main/resources/schema/ans/0.5.8/story_elements/table.json b/src/main/resources/schema/ans/0.5.8/story_elements/table.json
index e31147f..5788a8f 100644
--- a/src/main/resources/schema/ans/0.5.8/story_elements/table.json
+++ b/src/main/resources/schema/ans/0.5.8/story_elements/table.json
@@ -1,7 +1,7 @@
 {
   "$schema": "http://json-schema.org/draft-04/schema#",
   "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_element/table.json",
-  "description": "A data table content element.",
+  "description": "A data table content element",
   "type": "object",
   "additonalProperties": false,
   "properties": {
@@ -17,23 +17,27 @@
     "channels": {
       "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_channel.json"
     },
-    "alignment": {
-      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_alignment.json"
-    },
     "additional_properties": {
       "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_additional_properties.json"
     },
 
-    "header": {
-      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_row.json"
-    },
 
-    "rows" : {
+    "header": {
       "type": "array",
-      "description": "The non-header rows of the table",
+      "description": "The header row of the table",
       "items": {
-        "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_row.json"
+        "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_elements/text.json"
       }
+	},
+    "rows" : {
+	  "type" : "array",
+      "description": "The data rows of the table",
+      "items": {
+        "type": "array",
+        "items": {
+          "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_elements/text.json"
+        }
+	  }
     }
   },
   "required": [ "type", "rows" ]
diff --git a/src/main/resources/schema/ans/0.5.8/story_elements/table_02.json b/src/main/resources/schema/ans/0.5.8/story_elements/table_02.json
new file mode 100644
index 0000000..34e38d5
--- /dev/null
+++ b/src/main/resources/schema/ans/0.5.8/story_elements/table_02.json
@@ -0,0 +1,41 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_element/table_02.json",
+  "description": "A data table content element, which is incompatible with the original table: https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/story_element/table.json",
+  "type": "object",
+  "additonalProperties": false,
+  "properties": {
+    "type": {
+      "enum": [ "table_02" ]
+    },
+    "_id": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_id.json"
+    },
+    "subtype": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_subtype.json"
+    },
+    "channels": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_channel.json"
+    },
+    "alignment": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_alignment.json"
+    },
+    "additional_properties": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_additional_properties.json"
+    },
+
+    "header": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json"
+    },
+
+    "rows" : {
+      "type": "array",
+      "description": "The non-header rows of the table",
+      "items": {
+        "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json"
+      }
+    }
+  },
+  "required": [ "type", "rows" ]
+
+}
diff --git a/src/main/resources/schema/ans/0.5.8/utils/table_cell_02.json b/src/main/resources/schema/ans/0.5.8/utils/table_cell_02.json
new file mode 100644
index 0000000..d24218e
--- /dev/null
+++ b/src/main/resources/schema/ans/0.5.8/utils/table_cell_02.json
@@ -0,0 +1,28 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_cell_02.json",
+  "description": "A single table cell.",
+  "type": "object",
+
+  "properties": {
+    "type": {
+      "enum": [ "table_cell_02" ]
+    },
+    "_id": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_id.json"
+    },
+    "subtype": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_subtype.json"
+    },
+    "channels": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_channel.json"
+    },
+    "additional_properties": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_additional_properties.json"
+    },
+
+    "content_elements": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_content_elements.json"
+    }
+  }
+}
diff --git a/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json b/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json
new file mode 100644
index 0000000..c4ccc3c
--- /dev/null
+++ b/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json
@@ -0,0 +1,31 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_row_02.json",
+  "description": "A list of table cells, usually for use in a table row.",
+  "type": "object",
+
+  "properties": {
+    "type": {
+      "enum": [ "table_row_02" ]
+    },
+    "_id": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_id.json"
+    },
+    "subtype": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_subtype.json"
+    },
+    "channels": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_channel.json"
+    },
+    "additional_properties": {
+      "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/traits/trait_additional_properties.json"
+    },
+
+    "cells": {
+      "type": "array",
+      "items": {
+        "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.5.8/utils/table_cell_02.json"
+      }
+    }
+  }
+}


Test patch:
diff --git a/tests/fixtures/schema/0.5.8/story-fixture-good.json b/tests/fixtures/schema/0.5.8/story-fixture-good.json
index c186cc5..a4b0e68 100644
--- a/tests/fixtures/schema/0.5.8/story-fixture-good.json
+++ b/tests/fixtures/schema/0.5.8/story-fixture-good.json
@@ -326,7 +326,7 @@
       "_id": "659876643210",
       "type": "correction",
       "correction_type": "clarification",
-      "content": "An earlier version of this article attributed the above quote to David Foster Wallace."
+      "text": "An earlier version of this article attributed the above quote to David Foster Wallace."
     },
 
     {
@@ -409,12 +409,12 @@
     {
       "type": "correction",
       "correction_type": "clarification",
-      "content": "What I said before was not exactly true."
+      "text": "What I said before was not exactly true."
     },
     {
       "type": "correction",
       "correction_type": "correction",
-      "content": "What I said before was false and not true."
+      "text": "What I said before was false and not true."
     }
   ],
 
diff --git a/tests/fixtures/schema/0.5.8/story-fixture-tiny-house.json b/tests/fixtures/schema/0.5.8/story-fixture-tiny-house.json
index a6beac3..8f47cd7 100644
--- a/tests/fixtures/schema/0.5.8/story-fixture-tiny-house.json
+++ b/tests/fixtures/schema/0.5.8/story-fixture-tiny-house.json
@@ -123,7 +123,7 @@
       "content": "But there’s one big drawback: Many municipalities haven’t made room literally or legislatively for tiny residences. It’s a challenge to find a place to park a tiny house if you don’t own land. And they often fall into a legal limbo. “Tiny houses exist in sort of a legal gray area, neither explicitly allowed nor expressly forbidden,” says tiny-home owner Jay Austin of Northeast Washington. Though the District recently banned “camping” in tiny-house-like structures, Austin says he has been told the provision is unenforceable."
     },
     {
-      "type": "table",
+      "type": "table_02",
       "_id": "0987654321",
       "subtype": "special_table",
       "channels": [ "all" ],
@@ -132,7 +132,7 @@
       },
 
       "header": {
-        "type": "table_row",
+        "type": "table_row_02",
         "_id": "A",
         "subtype": "special_row",
         "channels": [ "web" ],
@@ -142,13 +142,13 @@
 
         "cells": [
           {
-            "type": "table_cell",
+            "type": "table_cell_02",
             "content_elements": [
               { "_id": "a", "type": "text",  "content": "Header Y = 1" }
             ]
           },
           {
-            "type": "table_cell",
+            "type": "table_cell_02",
             "content_elements": [
               { "_id": "b", "type": "text",  "content": "Header Y = 1" }
             ]
@@ -158,7 +158,7 @@
 
       "rows": [
         {
-          "type": "table_row",
+          "type": "table_row_02",
           "_id": "B",
           "subtype": "special_row",
           "channels": [ "web" ],
@@ -168,7 +168,7 @@
 
           "cells": [
             {
-              "type": "table_cell",
+              "type": "table_cell_02",
               "_id": "B1",
 
               "subtype": "special_cell",
@@ -183,7 +183,7 @@
 
             },
             {
-              "type": "table_cell",
+              "type": "table_cell_02",
               "content_elements": [
                 { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
               ]
@@ -193,16 +193,16 @@
 
         {
           "_id": "C",
-          "type": "table_row",
+          "type": "table_row_02",
           "cells": [
             {
-              "type": "table_cell",
+              "type": "table_cell_02",
               "content_elements": [
                 { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
               ]
             },
             {
-              "type": "table_cell",
+              "type": "table_cell_02",
               "content_elements": [
                 { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
               ]
diff --git a/tests/fixtures/schema/0.5.8/table-fixture-good.json b/tests/fixtures/schema/0.5.8/table-fixture-good.json
index c8f7111..9f52f40 100644
--- a/tests/fixtures/schema/0.5.8/table-fixture-good.json
+++ b/tests/fixtures/schema/0.5.8/table-fixture-good.json
@@ -1,91 +1,7 @@
 {
-  "type": "table",
   "_id": "0987654321",
-  "subtype": "special_table",
-  "channels":  [ "web" ],
-  "additional_properties": {
-    "goodbye": "birdie"
-  },
-
-  "header": {
-    "type": "table_row",
-    "_id": "A",
-    "subtype": "special_row",
-    "channels": [ "web" ],
-    "additional_properties": {
-      "x": "y"
-    },
-
-    "cells": [
-      {
-        "type": "table_cell",
-        "content_elements": [
-          { "_id": "a", "type": "text",  "content": "Header Y = 1" }
-        ]
-      },
-      {
-        "type": "table_cell",
-        "content_elements": [
-          { "_id": "b", "type": "text",  "content": "Header Y = 1" }
-        ]
-      }
-    ]
-  },
-
-  "rows": [
-    {
-      "type": "table_row",
-      "_id": "B",
-      "subtype": "special_row",
-      "channels": [ "web" ],
-      "additional_properties": {
-        "x": "y"
-      },
-
-      "cells": [
-        {
-          "type": "table_cell",
-          "_id": "B1",
-
-          "subtype": "special_cell",
-          "channels": [ "phone" ],
-          "additional_properties": {
-            "hi": "mom"
-          },
-
-          "content_elements": [
-            { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
-          ]
-
-        },
-        {
-          "type": "table_cell",
-          "content_elements": [
-            { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
-          ]
-        }
-      ]
-    },
-
-    {
-      "_id": "C",
-      "type": "table_row",
-      "cells": [
-        {
-          "type": "table_cell",
-          "content_elements": [
-            { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
-          ]
-        },
-        {
-          "type": "table_cell",
-          "content_elements": [
-            { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
-          ]
-        }
-      ]
-    }
-
-  ]
-
+  "type": "table",
+  "header": [ { "_id": "a", "type": "text",  "content": "Header Y = 1" }, { "_id": "b", "type": "text",  "content": "Header Y = 1" } ],
+  "rows": [ [ { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }, { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" } ],
+            [ { "_id": "3", "type": "text",  "content": "X = 2, Y = 1" }, { "_id": "4", "type": "text",  "content": "X = 2, Y = 2" } ] ]
 }
diff --git a/tests/fixtures/schema/0.5.8/table_02-fixture-good.json b/tests/fixtures/schema/0.5.8/table_02-fixture-good.json
new file mode 100644
index 0000000..75b0c81
--- /dev/null
+++ b/tests/fixtures/schema/0.5.8/table_02-fixture-good.json
@@ -0,0 +1,91 @@
+{
+  "type": "table_02",
+  "_id": "0987654321",
+  "subtype": "special_table",
+  "channels":  [ "web" ],
+  "additional_properties": {
+    "goodbye": "birdie"
+  },
+
+  "header": {
+    "type": "table_row_02",
+    "_id": "A",
+    "subtype": "special_row",
+    "channels": [ "web" ],
+    "additional_properties": {
+      "x": "y"
+    },
+
+    "cells": [
+      {
+        "type": "table_cell_02",
+        "content_elements": [
+          { "_id": "a", "type": "text",  "content": "Header Y = 1" }
+        ]
+      },
+      {
+        "type": "table_cell_02",
+        "content_elements": [
+          { "_id": "b", "type": "text",  "content": "Header Y = 1" }
+        ]
+      }
+    ]
+  },
+
+  "rows": [
+    {
+      "type": "table_row_02",
+      "_id": "B",
+      "subtype": "special_row",
+      "channels": [ "web" ],
+      "additional_properties": {
+        "x": "y"
+      },
+
+      "cells": [
+        {
+          "type": "table_cell_02",
+          "_id": "B1",
+
+          "subtype": "special_cell",
+          "channels": [ "phone" ],
+          "additional_properties": {
+            "hi": "mom"
+          },
+
+          "content_elements": [
+            { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
+          ]
+
+        },
+        {
+          "type": "table_cell_02",
+          "content_elements": [
+            { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
+          ]
+        }
+      ]
+    },
+
+    {
+      "_id": "C",
+      "type": "table_row_02",
+      "cells": [
+        {
+          "type": "table_cell_02",
+          "content_elements": [
+            { "_id": "1", "type": "text",  "content": "X = 1, Y = 1" }
+          ]
+        },
+        {
+          "type": "table_cell_02",
+          "content_elements": [
+            { "_id": "2", "type": "text",  "content": "X = 2, Y = 1" }
+          ]
+        }
+      ]
+    }
+
+  ]
+
+}
diff --git a/tests/schema-tests-05.js b/tests/schema-tests-05.js
index 2f5d20c..9cbb207 100644
--- a/tests/schema-tests-05.js
+++ b/tests/schema-tests-05.js
@@ -430,7 +430,7 @@ var validate = function(version, schemaName, fixture, expected) {
 };
 
 var validateIfFixtureExists = function(version, schemaName, fixture, expected) {
-  if(_.has(fixtures, fixture)) {
+  if(_.has(fixtures, fixture) && _.has(loadedSchemas, version + schemaName)) {
     validate(version, schemaName, fixture, expected);
   }
 };
@@ -746,7 +746,7 @@ describe("Schema: ", function() {
           });
           it("should allow platform pitch event status containing spaces", function() {
             validateIfFixtureExists(version, '/traits/trait_platform_pitch_event.json', 'trait-pitch-event-fixture-space-in-status', true);
-          });          
+          });
           it("should reject publication pitch event status containing numeric characters", function() {
             validateIfFixtureExists(version, '/traits/trait_publication_pitch_event.json', 'trait-pitch-event-fixture-numeric-status', false);
           });
@@ -755,7 +755,7 @@ describe("Schema: ", function() {
           });
           it("should allow publication pitch event status containing spaces", function() {
             validateIfFixtureExists(version, '/traits/trait_publication_pitch_event.json', 'trait-pitch-event-fixture-space-in-status', true);
-          });             
+          });
         });
 
         describe("Workflow (0.5.8+)", function() {
@@ -884,6 +884,15 @@ describe("Schema: ", function() {
             });
           });
 
+          describe("Table 2", function() {
+            it("should validate a table 2 element", function() {
+              validateIfFixtureExists(version, type_prefix + '/table_02.json', 'table_02-fixture-good');
+            });
+
+            it("should not validate a table 1 element", function() {
+              validateIfFixtureExists(version, type_prefix + '/table_02.json', 'table-fixture-good', false);
+            });
+          });
 
           describe("Interstitial Link", function() {
             it("should validate a interstitial link", function () {
diff --git a/tests/transform-tests.js b/tests/transform-tests.js
index 2fe329b..15c3028 100644
--- a/tests/transform-tests.js
+++ b/tests/transform-tests.js
@@ -611,10 +611,10 @@ describe("Transformations: ", function() {
       describe("Corrections", function() {
         it("should preserve corrections", function() {
           var result = transforms.upvert(fixtures['0.5.7']['story-fixture-good'], '0.5.8');
-          result.corrections[0].content.should.eql("This document is a fabrication by the author and is false.");
+          result.corrections[0].text.should.eql("This document is a fabrication by the author and is false.");
           result.corrections[1].additional_properties.foo.should.eql("bar");
-          result.corrections[2].content.should.eql("An earlier version of this document mis-spelled the name of William Jefferson Clinton.");
-          result.corrections[3].content.should.eql("An earlier version of this document mis-spelled the name of George Walker Bush.");
+          result.corrections[2].text.should.eql("");
+          result.corrections[3].text.should.eql("An earlier version of this document mis-spelled the name of George Walker Bush.");
           result.corrections[3].additional_properties.foo.should.eql("bar");
           result.corrections[3].additional_properties.content.should.eql("An earlier version of this document mis-spelled the name of William Jefferson Clinton.");
           result.corrections[3]._id.should.eql("correction_4");