{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "failed_license_scan": {
            "additionalProperties": false,
            "description": "Failed automated software copyright license scan",
            "properties": {
                "_release": {
                    "description": "Unique release id in form of \"ecosystem:package:version\"",
                    "type": "string"
                },
                "details": {
                    "additionalProperties": true,
                    "type": "object"
                },
                "schema": {
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "description": "Name of the schema",
                            "pattern": "^[a-zA-Z0-9_]+$",
                            "type": "string"
                        },
                        "url": {
                            "_format": "uri",
                            "description": "Full URL of the schema",
                            "type": "string"
                        },
                        "version": {
                            "description": "Version of the schema",
                            "pattern": "^[0-9]+-[0-9]+-[0-9]+$",
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "version"
                    ],
                    "type": "object"
                },
                "status": {
                    "enum": [
                        "error"
                    ],
                    "type": "string"
                },
                "summary": {
                    "additionalProperties": true,
                    "type": "object"
                }
            },
            "required": [
                "status",
                "summary",
                "details"
            ],
            "type": "object"
        },
        "file_details": {
            "additionalProperties": false,
            "properties": {
                "path": {
                    "type": "string"
                },
                "result": {
                    "items": {
                        "additionalProperties": true,
                        "type": "object"
                    },
                    "type": "array"
                }
            },
            "required": [
                "path"
            ],
            "type": "object"
        },
        "license_count": {
            "additionalProperties": false,
            "description": "Detected license with occurrence count",
            "properties": {
                "count": {
                    "description": "Combined count of detected variants",
                    "type": "number"
                },
                "license_name": {
                    "description": "Common name of the detected license",
                    "type": "string"
                }
            },
            "required": [
                "count",
                "license_name"
            ],
            "type": "object"
        },
        "license_details_pre_3_0": {
            "additionalProperties": false,
            "properties": {
                "count": {
                    "description": "Number of occurrences of this variant",
                    "type": "number"
                },
                "license_name": {
                    "description": "Common name of the detected license",
                    "type": "string"
                },
                "variant_id": {
                    "description": "Specific license variant detected",
                    "type": "string"
                }
            },
            "required": [
                "count",
                "license_name",
                "variant_id"
            ],
            "type": "object"
        },
        "license_scan_details": {
            "additionalProperties": true,
            "properties": {
                "files": {
                    "items": {
                        "$ref": "#/definitions/file_details"
                    },
                    "type": "array"
                },
                "license_stats": {
                    "items": {
                        "$ref": "#/definitions/license_details_pre_3_0"
                    },
                    "type": "array"
                },
                "oslc_stats": {
                    "$ref": "#/definitions/oslc_stats"
                }
            },
            "type": "object"
        },
        "license_scan_summary": {
            "additionalProperties": false,
            "properties": {
                "all_files": {
                    "description": "Total number of files analysed",
                    "type": "number"
                },
                "distinct_licenses": {
                    "items": {
                        "$ref": "#/definitions/license_count"
                    },
                    "type": "array"
                },
                "license_files": {
                    "type": "number"
                },
                "licensed_files": {
                    "type": "number"
                },
                "source_files": {
                    "type": "number"
                },
                "sure_licenses": {
                    "description": "Licenses detected with high match confidence",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                }
            },
            "required": [
                "distinct_licenses",
                "sure_licenses"
            ],
            "type": "object"
        },
        "oslc_stats": {
            "additionalProperties": true,
            "properties": {},
            "type": "object"
        },
        "successful_license_scan": {
            "additionalProperties": false,
            "description": "Successful automated software copyright license scan",
            "properties": {
                "_release": {
                    "description": "Unique release id in form of \"ecosystem:package:version\"",
                    "type": "string"
                },
                "details": {
                    "$ref": "#/definitions/license_scan_details"
                },
                "schema": {
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "description": "Name of the schema",
                            "pattern": "^[a-zA-Z0-9_]+$",
                            "type": "string"
                        },
                        "url": {
                            "_format": "uri",
                            "description": "Full URL of the schema",
                            "type": "string"
                        },
                        "version": {
                            "description": "Version of the schema",
                            "pattern": "^[0-9]+-[0-9]+-[0-9]+$",
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "version"
                    ],
                    "type": "object"
                },
                "status": {
                    "enum": [
                        "success"
                    ],
                    "type": "string"
                },
                "summary": {
                    "$ref": "#/definitions/license_scan_summary"
                }
            },
            "required": [
                "status",
                "summary",
                "details"
            ],
            "type": "object"
        }
    },
    "oneOf": [
        {
            "$ref": "#/definitions/failed_license_scan"
        },
        {
            "$ref": "#/definitions/successful_license_scan"
        },
        {
            "additionalProperties": false,
            "description": "Successful automated software copyright license scan",
            "properties": {},
            "type": "object"
        }
    ],
    "title": "source_licenses-v2-0-0"
}