{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "dependencies_counts": {
            "type": "object",
            "description": "Counts of various types of dependencies",
            "properties": {
                "runtime": {
                    "type": "integer"
                }
            },
            "additionalProperties": false
        },
        "dependency_object": {
            "type": "object",
            "description": "Dependency Object",
            "properties": {
                "ecosystem": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "version": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "declaration": {
                    "type": "string"
                },
                "resolved_at": {
                    "type": "string"
                }
            },
            "required": [
                "ecosystem",
                "name",
                "version",
                "declaration",
                "resolved_at"
            ],
            "additionalProperties": false
        },
        "dependency_snapshot_detail": {
            "type": "object",
            "description": "Details of Dependency Snapshot run on a component",
            "properties": {
                "runtime": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/dependency_object"
                    }
                }
            },
            "additionalProperties": false
        },
        "dependency_snapshot_summary": {
            "type": "object",
            "description": "Summary of Dependency Snapshot run on a component",
            "properties": {
                "errors": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "dependency_counts": {
                    "$ref": "#/definitions/dependencies_counts"
                }
            },
            "required": [
                "errors",
                "dependency_counts"
            ],
            "additionalProperties": false
        }
    },
    "type": "object",
    "description": "Result of Dependency Snapshot worker",
    "properties": {
        "schema": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the schema",
                    "pattern": "^[a-zA-Z0-9_]+$"
                },
                "version": {
                    "type": "string",
                    "description": "Version of the schema",
                    "pattern": "^[0-9]+-[0-9]+-[0-9]+$"
                },
                "url": {
                    "type": "string",
                    "description": "Full URL of the schema",
                    "format": "uri"
                }
            },
            "required": [
                "name",
                "version"
            ],
            "additionalProperties": false
        },
        "_release": {
            "type": "string",
            "description": "Unique release id in form of \"ecosystem:package:version\""
        },
        "status": {
            "type": "string",
            "enum": [
                "success",
                "error"
            ]
        },
        "details": {
            "$ref": "#/definitions/dependency_snapshot_detail"
        },
        "summary": {
            "$ref": "#/definitions/dependency_snapshot_summary"
        }
    },
    "required": [
        "status",
        "details",
        "summary"
    ],
    "additionalProperties": false,
    "title": "dependency_snapshot-v1-0-0"
}