{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A document of some sort (PDF, TIFF, HTML) associated with a filing",
    "type": "object",
    "properties": {
        "uid": {
            "description": "Unique id/reference for the filing if it has one",
            "type": "string"
        },
        "file_format": {
            "description": "Format of the document, if known",
            "enum": [
                "xml",
                "pdf",
                "html",
                "doc",
                null
            ]
        },
        "original_source_url": {
            "description": "Persistent URL for the document, if there is one",
            "type": "string"
        },
        "source_url": {
            "description": "Source url of the web page for the filing or if there is not persistent URL the page from which it can be found (e.g. search page)",
            "type": "string",
            "minLength": 11
        },
        "source_location": {
            "type": "string",
            "description": "If the accounts filing has been put on sources.opencorporates.com the path to the filing"
        },
        "language": {
            "description": "Should be represented as two-letter ISO-639 code",
            "type": "string",
            "minLength": 2,
            "maxLength": 2
        },
        "classification": {
            "description": "type of document (at the moment only XBRL is the only option here)",
            "type": "string",
            "enum": [
                "xbrl",
                null
            ]
        },
        "pages": {
            "description": "Number of pages, if known",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "anyOf": [
        {
            "required": [
                "source_location"
            ]
        },
        {
            "required": [
                "source_url"
            ]
        }
    ]
}