{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "description": "This schema defines the metadata for a single document as specified by the dms-exchange-specification.",
    "properties": {
        "comments": {
            "description": "Comments added to a document",
            "items": {
                "additionalProperties": false,
                "properties": {
                    "commentBy": {
                        "_format": "email",
                        "description": "User who has added a comment.",
                        "type": "string"
                    },
                    "commentTime": {
                        "_format": "date-time",
                        "description": "Timestamp when the comment was added.",
                        "type": "string"
                    },
                    "content": {
                        "description": "Text of the comment.",
                        "type": "string"
                    }
                },
                "required": [
                    "commentBy",
                    "commentTime",
                    "content"
                ],
                "type": "object"
            },
            "minItems": 0,
            "type": "array"
        },
        "context": {
            "additionalProperties": false,
            "description": "Information taken from the document content and are inherent to it.",
            "properties": {
                "documentTime": {
                    "_format": "date-time",
                    "description": "Date of the document.",
                    "type": "string"
                },
                "dueDateTime": {
                    "_format": "date-time",
                    "description": "A due date the document might have.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "createdBy": {
            "_format": "email",
            "description": "User who has triggered the export.",
            "type": "string"
        },
        "createdTime": {
            "_format": "date-time",
            "description": "Timestamp when the container was created/exported.",
            "type": "string"
        },
        "directory": {
            "description": "If the dms works hierarchically, this field contains the directory. It is written in *nix-style, starting from the root downwards, using slashes.",
            "type": "string"
        },
        "documentFiles": {
            "description": "Groups the document-files in the given order that form a document.",
            "items": {
                "additionalProperties": false,
                "properties": {
                    "filename": {
                        "description": "Name of the indexed document-file inside the container.",
                        "type": "string"
                    },
                    "revisions": {
                        "description": "Revisions of a document-file.",
                        "items": {
                            "additionalProperties": false,
                            "properties": {
                                "addedBy": {
                                    "_format": "email",
                                    "description": "User who has added or changed the revision.",
                                    "type": "string"
                                },
                                "addedTime": {
                                    "_format": "date-time",
                                    "description": "Timestamp when the revision of the document-file has been added or changed.",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "addedTime"
                            ],
                            "type": "object"
                        },
                        "type": "array"
                    },
                    "rotation": {
                        "default": 0,
                        "description": "Degree the document-file has to rotate clockwise to have a correct orientation.",
                        "enum": [
                            0,
                            90,
                            180,
                            270
                        ]
                    }
                },
                "required": [
                    "filename",
                    "revisions"
                ],
                "type": "object"
            },
            "minItems": 1,
            "type": "array"
        },
        "idSystem": {
            "description": "An id the system has provided for the document",
            "type": "string"
        },
        "idUser": {
            "description": "An id the user can define uniquely for the document",
            "type": "string"
        },
        "labels": {
            "description": "Tagging keywords",
            "items": {
                "type": "string"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "location": {
            "description": "Physical location of the scanned documents, if available",
            "type": "string"
        },
        "note": {
            "description": "Free text field for document-notes, made by the users",
            "type": "string"
        },
        "optionIndexed": {
            "default": true,
            "description": "Should the document be shown in the index (if using a search), or only when the user navigates to the document explicitly.",
            "type": "boolean"
        },
        "optionOcr": {
            "default": true,
            "description": "Should the document be analyzed or not.",
            "type": "boolean"
        },
        "project": {
            "description": "A project the document has been associated with.",
            "type": "string"
        },
        "source": {
            "additionalProperties": false,
            "description": "Information about the system that has created the export.",
            "properties": {
                "email": {
                    "_format": "email",
                    "description": "Email to contact the vendor of the system that has created the export.",
                    "type": "string"
                },
                "name": {
                    "description": "Name of the system that has created the export.",
                    "type": "string"
                },
                "url": {
                    "_format": "uri",
                    "description": "Website from the vendor of the system that has created the export.",
                    "type": "string"
                },
                "version": {
                    "description": "Version of the system that has created the export.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "version": {
            "description": "Valid version for this schema.",
            "enum": [
                "1.0.0"
            ]
        }
    },
    "required": [
        "version",
        "createdTime",
        "documentFiles"
    ],
    "title": "dms-exchange-specification (dxs) metadata description",
    "type": "object"
}