{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://www.smartdeveloperhub.org/harvesters/it/local-data#",
    "type": "object",
    "properties": {
        "collector": {
            "$ref": "#/definitions/collector"
        },
        "contributors": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/contributor"
            },
            "_uniqueItems": true
        },
        "commits": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/commit"
            },
            "_uniqueItems": true
        },
        "projects": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/project"
            },
            "_uniqueItems": true
        },
        "projectComponents": {
            "type": "object",
            "patternProperties": {
                "^[a-fA-F0-9]+$": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/component"
                    },
                    "_uniqueItems": true
                }
            }
        },
        "projectVersions": {
            "type": "object",
            "patternProperties": {
                "^[a-fA-F0-9]+$": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/version"
                    },
                    "_uniqueItems": true
                }
            }
        },
        "projectIssues": {
            "type": "object",
            "patternProperties": {
                "^[a-fA-F0-9]+$": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/issue"
                    },
                    "_uniqueItems": true
                }
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "collector",
        "contributors",
        "commits",
        "projects",
        "projectComponents",
        "projectVersions",
        "projectIssues"
    ],
    "definitions": {
        "collector": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "version"
            ]
        },
        "contributor": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "emails": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "format": "email"
                    },
                    "minItems": 1,
                    "_uniqueItems": true
                }
            },
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "emails"
            ]
        },
        "commit": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "repository": {
                    "type": "string",
                    "minLength": 1
                },
                "branch": {
                    "type": "string",
                    "minLength": 1
                },
                "hash": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "id",
                "repository",
                "branch",
                "hash"
            ]
        },
        "project": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "versions": {
                    "$ref": "#/definitions/stringArray"
                },
                "components": {
                    "$ref": "#/definitions/stringArray"
                },
                "topIssues": {
                    "$ref": "#/definitions/stringArray"
                },
                "issues": {
                    "$ref": "#/definitions/stringArray"
                }
            },
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "versions",
                "components",
                "topIssues",
                "issues"
            ]
        },
        "component": {
            "type": "object",
            "properties": {
                "projectId": {
                    "type": "string",
                    "minLength": 1
                },
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "projectId",
                "id",
                "name"
            ]
        },
        "version": {
            "type": "object",
            "properties": {
                "projectId": {
                    "type": "string",
                    "minLength": 1
                },
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "projectId",
                "id",
                "name"
            ]
        },
        "issue": {
            "type": "object",
            "properties": {
                "projectId": {
                    "type": "string",
                    "minLength": 1
                },
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "description": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "BUG",
                        "IMPROVEMENT",
                        "TASK"
                    ]
                },
                "status": {
                    "enum": [
                        "OPEN",
                        "IN_PROGRESS",
                        "CLOSED"
                    ]
                },
                "severity": {
                    "enum": [
                        "BLOCKER",
                        "CRITICAL",
                        "SEVERE",
                        "LOW",
                        "TRIVIAL"
                    ]
                },
                "priority": {
                    "enum": [
                        "VERY_HIGH",
                        "HIGH",
                        "MEDIUM",
                        "LOW"
                    ]
                },
                "creationDate": {
                    "type": "string",
                    "format": "date-time"
                },
                "opened": {
                    "type": "string",
                    "format": "date-time"
                },
                "closed": {
                    "type": "string",
                    "format": "date-time"
                },
                "dueTo": {
                    "type": "string",
                    "format": "date-time"
                },
                "estimatedTime": {
                    "type": "string",
                    "format": "duration"
                },
                "reporter": {
                    "type": "string",
                    "minLength": 1
                },
                "assignee": {
                    "type": "string",
                    "minLength": 1
                },
                "versions": {
                    "$ref": "#/definitions/stringArray"
                },
                "components": {
                    "$ref": "#/definitions/stringArray"
                },
                "tags": {
                    "$ref": "#/definitions/stringArray"
                },
                "commits": {
                    "$ref": "#/definitions/stringArray"
                },
                "childIssues": {
                    "$ref": "#/definitions/stringArray"
                },
                "blockedIssues": {
                    "$ref": "#/definitions/stringArray"
                },
                "changes": {
                    "$ref": "#/definitions/changeLog"
                }
            },
            "additionalProperties": false,
            "required": [
                "projectId",
                "status",
                "severity",
                "priority",
                "creationDate",
                "opened",
                "reporter",
                "assignee",
                "id",
                "name"
            ]
        },
        "changeLog": {
            "type": "object",
            "properties": {
                "entries": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/changeLogEntry"
                    },
                    "_uniqueItems": true
                }
            },
            "additionalProperties": false,
            "required": [
                "entries"
            ]
        },
        "changeLogEntry": {
            "type": "object",
            "properties": {
                "author": {
                    "type": "string",
                    "minLength": 1
                },
                "timeStamp": {
                    "type": "string",
                    "format": "date-time"
                },
                "items": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "oneOf": [
                            {
                                "$ref": "#/definitions/valueAdded"
                            },
                            {
                                "$ref": "#/definitions/valueDeleted"
                            },
                            {
                                "$ref": "#/definitions/valueModified"
                            }
                        ]
                    },
                    "_uniqueItems": true
                }
            },
            "additionalProperties": false,
            "required": [
                "author",
                "timeStamp",
                "items"
            ]
        },
        "valueAdded": {
            "type": "object",
            "properties": {
                "property": {
                    "type": "string",
                    "minLength": 1
                },
                "newValue": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "property",
                "newValue"
            ]
        },
        "valueDeleted": {
            "type": "object",
            "properties": {
                "property": {
                    "type": "string",
                    "minLength": 1
                },
                "oldValue": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "property",
                "oldValue"
            ]
        },
        "valueModified": {
            "type": "object",
            "properties": {
                "property": {
                    "type": "string",
                    "minLength": 1
                },
                "oldValue": {
                    "type": "string",
                    "minLength": 1
                },
                "newValue": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "additionalProperties": false,
            "required": [
                "property",
                "oldValue",
                "newValue"
            ]
        },
        "stringArray": {
            "type": "array",
            "items": {
                "type": "string",
                "minLength": 1
            },
            "_uniqueItems": true
        }
    }
}