{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "orderly/outpack custom schema",
    "version": "0.0.1",

    "type": "object",
    "properties": {
        "artefacts": {
            "comment": "Artefacts are sets of (at least 1) output files that result from running a packet",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "description": {
                        "type": ["null", "string"]
                    },
                    "paths": {
                        "comment": "Will match the set of paths in outpack",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": ["description", "paths"]
            }
        },
        "shared": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "here": {
                        "type": "string"
                    },
                    "there": {
                        "type": "string"
                    }
                },
                "required": ["here", "there"]
            }
        },
        "role": {
            "comment": "Assigns a 'role' (category) to input files. Any file that is not an output is considered an input.",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "path": {
                        "comment": "Will match the set of paths in outpack",
                        "type": "string"
                    },
                    "role": {
                        "enum": ["orderly", "resource", "dependency", "shared"]
                    }
                }
            }
        },
        "description": {
            "type": "object",
            "properties": {
                "display": {
                    "type": ["null", "string"]
                },
                "long": {
                    "type": ["null", "string"]
                },
                "custom": {
                    "type": ["null", "object"]
                }
            },
            "required": ["display", "long", "custom"],
            "additionalProperties": false
        },

        "session": {
            "description": "Information about the session in which the packet was run",
            "type": "object",
            "properties": {
                "platform": {
                    "type": "object",
                    "properties": {
                        "version": {
                            "type": "string"
                        },
                        "os": {
                            "type": "string"
                        },
                        "system": {
                            "type": "string"
                        }
                    },
                    "required": ["version", "os", "system"]
                },
                "packages": {
                    "comment": "Records metadata on the packages that were loaded during the session",  
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "package": {
                                "type": "string"
                            },
                            "version": {
                                "type": "string"
                            },
                            "attached": {
                                "type": "boolean"
                            }
                        },
                        "required": ["package", "version", "attached"]
                    }
                }
            },
            "required": ["platform", "packages"]
        }
    },
    "additionalProperties": false,
    "required": ["artefacts", "shared", "role", "description", "session"]
}
