{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "JSONAPI rc3",
    "description": "A JSONAPI document",
    "type": "object",
    "properties": {
        "data": {
            "anyOf": [
                {
                    "$ref": "#/definitions/resource"
                },
                {
                    "description": "The top-level resource or array of resources",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/resource"
                    }
                }
            ]
        }
    },
    "required": [
        "data"
    ],
    "definitions": {
        "resource": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                }
            },
            "required": [
                "type"
            ]
        }
    }
}