diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..e54e7e5
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,9 @@
+{
+    "name": "drupal/jsonapi",
+    "description": "Provides a JSON API standards-compliant API for accessing and manipulating Drupal content and configuration entities.",
+    "type": "drupal-module",
+    "license": "GPL-2.0+",
+    "require-dev": {
+        "justinrainbow/json-schema": "^4.1"
+    }
+}
diff --git a/jsonapi.info.yml b/jsonapi.info.yml
index 36bb15c..cd3b601 100644
--- a/jsonapi.info.yml
+++ b/jsonapi.info.yml
@@ -1,6 +1,6 @@
 name: JSON API
 type: module
-description: Provides a JSON API format for the REST resources.
+description: Provides a JSON API standards-compliant API for accessing and manipulating Drupal content and configuration entities.
 core: 8.x
 package: Web services
 dependencies:
diff --git a/schema.json b/schema.json
new file mode 100644
index 0000000..dfbe0af
--- /dev/null
+++ b/schema.json
@@ -0,0 +1,375 @@
+{
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "title": "JSON API Schema",
+  "description": "This is a schema for responses in the JSON API format. For more, see http://jsonapi.org",
+  "oneOf": [
+    {
+      "$ref": "#/definitions/success"
+    },
+    {
+      "$ref": "#/definitions/failure"
+    },
+    {
+      "$ref": "#/definitions/info"
+    }
+  ],
+  
+  "definitions": {
+    "success": {
+      "type": "object",
+      "required": [
+        "data"
+      ],
+      "properties": {
+        "data": {
+          "$ref": "#/definitions/data"
+        },
+        "included": {
+          "description": "To reduce the number of HTTP requests, servers **MAY** allow responses that include related resources along with the requested primary resources. Such responses are called \"compound documents\".",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/resource"
+          },
+          "uniqueItems": true
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        },
+        "links": {
+          "description": "Link members related to the primary data.",
+          "allOf": [
+            {
+              "$ref": "#/definitions/links"
+            },
+            {
+              "$ref": "#/definitions/pagination"
+            }
+          ]
+        },
+        "jsonapi": {
+          "$ref": "#/definitions/jsonapi"
+        }
+      },
+      "additionalProperties": false
+    },
+    "failure": {
+      "type": "object",
+      "required": [
+        "errors"
+      ],
+      "properties": {
+        "errors": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/error"
+          },
+          "uniqueItems": true
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        },
+        "jsonapi": {
+          "$ref": "#/definitions/jsonapi"
+        }
+      },
+      "additionalProperties": false
+    },
+    "info": {
+      "type": "object",
+      "required": [
+        "meta"
+      ],
+      "properties": {
+        "meta": {
+          "$ref": "#/definitions/meta"
+        },
+        "links": {
+          "$ref": "#/definitions/links"
+        },
+        "jsonapi": {
+          "$ref": "#/definitions/jsonapi"
+        }
+      },
+      "additionalProperties": false
+    },
+    
+    "meta": {
+      "description": "Non-standard meta-information that can not be represented as an attribute or relationship.",
+      "type": "object",
+      "additionalProperties": true
+    },
+    "data": {
+      "description": "The document's \"primary data\" is a representation of the resource or collection of resources targeted by a request.",
+      "oneOf": [
+        {
+          "$ref": "#/definitions/resource"
+        },
+        {
+          "description": "An array of resource objects, an array of resource identifier objects, or an empty array ([]), for requests that target resource collections.",
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/resource"
+          },
+          "uniqueItems": true
+        },
+        {
+          "description": "null if the request is one that might correspond to a single resource, but doesn't currently.",
+          "type": "null"
+        }
+      ]
+    },
+    "resource": {
+      "description": "\"Resource objects\" appear in a JSON API document to represent resources.",
+      "type": "object",
+      "required": [
+        "type",
+        "id"
+      ],
+      "properties": {
+        "type": {
+          "type": "string"
+        },
+        "id": {
+          "type": "string"
+        },
+        "attributes": {
+          "$ref": "#/definitions/attributes"
+        },
+        "relationships": {
+          "$ref": "#/definitions/relationships"
+        },
+        "links": {
+          "$ref": "#/definitions/links"
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        }
+      },
+      "additionalProperties": false
+    },
+    
+    "links": {
+      "description": "A resource object **MAY** contain references to other resource objects (\"relationships\"). Relationships may be to-one or to-many. Relationships can be specified by including a member in a resource's links object.",
+      "type": "object",
+      "properties": {
+        "self": {
+          "description": "A `self` member, whose value is a URL for the relationship itself (a \"relationship URL\"). This URL allows the client to directly manipulate the relationship. For example, it would allow a client to remove an `author` from an `article` without deleting the people resource itself.",
+          "type": "string",
+          "format": "uri"
+        },
+        "related": {
+          "$ref": "#/definitions/link"
+        }
+      },
+      "additionalProperties": true
+    },
+    "link": {
+      "description": "A link **MUST** be represented as either: a string containing the link's URL or a link object.",
+      "oneOf": [
+        {
+          "description": "A string containing the link's URL.",
+          "type": "string",
+          "format": "uri"
+        },
+        {
+          "type": "object",
+          "required": [
+            "href"
+          ],
+          "properties": {
+            "href": {
+              "description": "A string containing the link's URL.",
+              "type": "string",
+              "format": "uri"
+            },
+            "meta": {
+              "$ref": "#/definitions/meta"
+            }
+          }
+        }
+      ]
+    },
+
+    "attributes": {
+      "description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.",
+      "type": "object",
+      "patternProperties": {
+        "^(?!relationships$|links$)\\w[-\\w_]*$": {
+          "description": "Attributes may contain any valid JSON value."
+        }
+      },
+      "additionalProperties": false
+    },
+
+    "relationships": {
+      "description": "Members of the relationships object (\"relationships\") represent references from the resource object in which it's defined to other resource objects.",
+      "type": "object",
+      "patternProperties": {
+        "^\\w[-\\w_]*$": {
+          "properties": {
+            "links": {
+              "$ref": "#/definitions/links"
+            },
+            "data": {
+              "description": "Member, whose value represents \"resource linkage\".",
+              "oneOf": [
+                {
+                  "$ref": "#/definitions/relationshipToOne"
+                },
+                {
+                  "$ref": "#/definitions/relationshipToMany"
+                }
+              ]
+            },
+            "meta": {
+              "$ref": "#/definitions/meta"
+            }
+          },
+          "anyOf": [
+            {"required": ["data"]},
+            {"required": ["meta"]},
+            {"required": ["links"]}
+          ],
+          "additionalProperties": false
+        }
+      },
+      "additionalProperties": false
+    },
+    "relationshipToOne": {
+      "description": "References to other resource objects in a to-one (\"relationship\"). Relationships can be specified by including a member in a resource's links object.",
+      "anyOf": [
+        {
+          "$ref": "#/definitions/empty"
+        },
+        {
+          "$ref": "#/definitions/linkage"
+        }
+      ]
+    },
+    "relationshipToMany": {
+      "description": "An array of objects each containing \"type\" and \"id\" members for to-many relationships.",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/linkage"
+      },
+      "uniqueItems": true
+    },
+    "empty": {
+      "description": "Describes an empty to-one relationship.",
+      "type": "null"
+    },
+    "linkage": {
+      "description": "The \"type\" and \"id\" to non-empty members.",
+      "type": "object",
+      "required": [
+        "type",
+        "id"
+      ],
+      "properties": {
+        "type": {
+          "type": "string"
+        },
+        "id": {
+          "type": "string"
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        }
+      },
+      "additionalProperties": false
+    },
+    "pagination": {
+      "type": "object",
+      "properties": {
+        "first": {
+          "description": "The first page of data",
+          "oneOf": [
+            { "type": "string", "format": "uri" },
+            { "type": "null" }
+          ]
+        },
+        "last": {
+          "description": "The last page of data",
+          "oneOf": [
+            { "type": "string", "format": "uri" },
+            { "type": "null" }
+          ]
+        },
+        "prev": {
+          "description": "The previous page of data",
+          "oneOf": [
+            { "type": "string", "format": "uri" },
+            { "type": "null" }
+          ]
+        },
+        "next": {
+          "description": "The next page of data",
+          "oneOf": [
+            { "type": "string", "format": "uri" },
+            { "type": "null" }
+          ]
+        }
+      }
+    },
+    
+    "jsonapi": {
+      "description": "An object describing the server's implementation",
+      "type": "object",
+      "properties": {
+        "version": {
+          "type": "string"
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        }
+      },
+      "additionalProperties": false
+    },
+    
+    "error": {
+      "type": "object",
+      "properties": {
+        "id": {
+          "description": "A unique identifier for this particular occurrence of the problem.",
+          "type": "string"
+        },
+        "links": {
+          "$ref": "#/definitions/links"
+        },
+        "status": {
+          "description": "The HTTP status code applicable to this problem, expressed as a string value.",
+          "type": "string"
+        },
+        "code": {
+          "description": "An application-specific error code, expressed as a string value.",
+          "type": "string"
+        },
+        "title": {
+          "description": "A short, human-readable summary of the problem. It **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of localization.",
+          "type": "string"
+        },
+        "detail": {
+          "description": "A human-readable explanation specific to this occurrence of the problem.",
+          "type": "string"
+        },
+        "source": {
+          "type": "object",
+          "properties": {
+            "pointer": {
+              "description": "A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. \"/data\" for a primary data object, or \"/data/attributes/title\" for a specific attribute].",
+              "type": "string"
+            },
+            "parameter": {
+              "description": "A string indicating which query parameter caused the error.",
+              "type": "string"
+            }
+          }
+        },
+        "meta": {
+          "$ref": "#/definitions/meta"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}
diff --git a/src/Controller/RequestHandler.php b/src/Controller/RequestHandler.php
index 7aec2b0..fe265b9 100644
--- a/src/Controller/RequestHandler.php
+++ b/src/Controller/RequestHandler.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\jsonapi\Controller;
 
+use Drupal\Component\Serialization\Json;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Render\RenderContext;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -165,6 +166,8 @@ class RequestHandler implements ContainerAwareInterface, ContainerInjectionInter
     $response->addCacheableDependency($this->container->get('config.factory')
       ->get('jsonapi.resource_info'));
 
+    assert('$this->validateResponse($response)', 'A JSON API response failed validation (see /admin/reports/dblog for details). Please report this in the issue queue on drupal.org');
+
     return $response;
   }
 
@@ -289,4 +292,39 @@ class RequestHandler implements ContainerAwareInterface, ContainerInjectionInter
     return $resource;
   }
 
+  /**
+   * Validates a response against the JSON API specification.
+   *
+   * @param \Drupal\jsonapi\ResourceResponse $response
+   *   The response to validate.
+   *
+   * @return bool
+   *   FALSE if the response failed validation, otherwise TRUE.
+   */
+  protected static function validateResponse(ResourceResponse $response) {
+    if (!class_exists("\\JsonSchema\\Validator")) {
+      return TRUE;
+    }
+    $response_data = json_decode($response->getContent());
+    if (empty($response_data)) {
+      return TRUE;
+    }
+
+    $validator = new \JsonSchema\Validator;
+    $schema_path = DRUPAL_ROOT . '/' . drupal_get_path('module', 'jsonapi') . '/schema.json';
+
+    $validator->check($response_data, (object)['$ref' => 'file://' . $schema_path]);
+
+    if (!$validator->isValid()) {
+      \Drupal::logger('jsonapi')->debug('Response failed validation: @data', [
+        '@data' => Json::encode($response_data),
+      ]);
+      \Drupal::logger('jsonapi')->debug('Validation errors: @errors', [
+        '@errors' => Json::encode($validator->getErrors()),
+      ]);
+    }
+
+    return $validator->isValid();
+  }
+
 }
diff --git a/tests/src/Functional/JsonApiFunctionalMultilingualTest.php b/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
index 3e27e4f..998f414 100644
--- a/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
+++ b/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
@@ -8,7 +8,7 @@ use Drupal\language\Entity\ConfigurableLanguage;
 /**
  * @group jsonapi
  */
-class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalBaseTest {
+class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
 
   public static $modules = [
     'basic_auth',
diff --git a/tests/src/Functional/JsonApiFunctionalTest.php b/tests/src/Functional/JsonApiFunctionalTest.php
index 2555d57..02e8517 100644
--- a/tests/src/Functional/JsonApiFunctionalTest.php
+++ b/tests/src/Functional/JsonApiFunctionalTest.php
@@ -9,7 +9,7 @@ use Drupal\jsonapi\Routing\Param\OffsetPage;
 /**
  * @group jsonapi
  */
-class JsonApiFunctionalTest extends JsonApiFunctionalBaseTest {
+class JsonApiFunctionalTest extends JsonApiFunctionalTestBase {
 
   /**
    * Test the GET method.
diff --git a/tests/src/Functional/JsonApiFunctionalBaseTest.php b/tests/src/Functional/JsonApiFunctionalTestBase.php
similarity index 98%
rename from tests/src/Functional/JsonApiFunctionalBaseTest.php
rename to tests/src/Functional/JsonApiFunctionalTestBase.php
index 21664ab..18a0acd 100644
--- a/tests/src/Functional/JsonApiFunctionalBaseTest.php
+++ b/tests/src/Functional/JsonApiFunctionalTestBase.php
@@ -18,9 +18,9 @@ use GuzzleHttp\Exception\ClientException;
 use GuzzleHttp\Exception\ServerException;
 
 /**
- * @group jsonapi
+ * Provides helper methods for the JSON API module's functional tests.
  */
-abstract class JsonApiFunctionalBaseTest extends BrowserTestBase {
+abstract class JsonApiFunctionalTestBase extends BrowserTestBase {
 
   use EntityReferenceTestTrait;
   use ImageFieldCreationTrait;
diff --git a/tests/src/Kernel/Controller/RequestHandlerTest.php b/tests/src/Kernel/Controller/RequestHandlerTest.php
new file mode 100644
index 0000000..e346b59
--- /dev/null
+++ b/tests/src/Kernel/Controller/RequestHandlerTest.php
@@ -0,0 +1,76 @@
+<?php
+
+namespace Drupal\Tests\jsonapi\Kernel\Controller;
+
+use Drupal\jsonapi\ResourceResponse;
+use Drupal\Tests\jsonapi\Kernel\JsonapiKernelTestBase;
+
+/**
+ * @coversDefaultClass \Drupal\jsonapi\Controller\RequestHandler
+ * @group jsonapi
+ */
+class RequestHandlerTest extends JsonapiKernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = [
+    'node',
+    'field',
+    'jsonapi',
+    'serialization',
+    'system',
+    'user',
+  ];
+
+  public function testResponseValidation() {
+    // Expose the protected RequestHandler::validateResponse() method.
+    $class = new \ReflectionClass('Drupal\jsonapi\Controller\RequestHandler');
+    $validate_response = $class->getMethod('validateResponse');
+    $validate_response->setAccessible(TRUE);
+
+    // Test validation failure: no "type" in "data".
+    $json = <<<'EOD'
+{
+  "data": {
+    "id": "4f342419-e668-4b76-9f87-7ce20c436169",
+    "attributes": {
+      "nid": "1",
+      "uuid": "4f342419-e668-4b76-9f87-7ce20c436169"
+    }
+  }
+}
+EOD;
+    $response = new ResourceResponse();
+    $response->setContent($json);
+    if ($validate_response->invoke(NULL, $response)) {
+      $this->assertFalse(TRUE, 'Response validation failed to flag an invalid response.');
+    }
+
+    // Test validation success.
+    $json = <<<'EOD'
+{
+  "data": {
+    "type": "node--article",
+    "id": "4f342419-e668-4b76-9f87-7ce20c436169",
+    "attributes": {
+      "nid": "1",
+      "uuid": "4f342419-e668-4b76-9f87-7ce20c436169"
+    }
+  }
+}
+EOD;
+    $response->setContent($json);
+    if (!$validate_response->invoke(NULL, $response)) {
+      $this->assertFalse(TRUE, 'Response validation flagged a valid response.');
+    }
+
+    // Test validation of an empty response passes.
+    $response = new ResourceResponse();
+    if (!$validate_response->invoke(NULL, $response)) {
+      $this->assertFalse(TRUE, 'Response validation flagged a valid empty response.');
+    }
+  }
+
+
+}
