{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "JSON schema for elm.json configuration files",
    "definitions": {
        "exactDependency": {
            "description": "Dependencies are specified by [author name]/[package name]: [exact version].",
            "type": "object",
            "additionalProperties": {
                "type": "string"
            }
        },
        "rangeDependency": {
            "description": "Dependencies are specified by [author name]/[package name]: [exact version or range]. Range versions look like: [1.0.0 <= v < 2.0.0].",
            "type": "object",
            "additionalProperties": {
                "type": "string"
            }
        },
        "packageSpecificProperties": {
            "type": "object",
            "properties": {
                "name": {
                    "description": "The name of your package.",
                    "type": "string",
                    "minLength": 1
                },
                "license": {
                    "description": "An OSI approved license for your package.",
                    "type": "string",
                    "enum": [
                        "AFL-1.1",
                        "AFL-1.2",
                        "AFL-2.0",
                        "AFL-2.1",
                        "AFL-3.0",
                        "APL-1.0",
                        "Apache-1.1",
                        "Apache-2.0",
                        "APSL-1.0",
                        "APSL-1.1",
                        "APSL-1.2",
                        "APSL-2.0",
                        "Artistic-1.0",
                        "Artistic-1.0-Perl",
                        "Artistic-1.0-cl8",
                        "Artistic-2.0",
                        "AAL",
                        "BSL-1.0",
                        "BSD-2-Clause",
                        "BSD-3-Clause",
                        "0BSD",
                        "CECILL-2.1",
                        "CNRI-Python",
                        "CDDL-1.0",
                        "CPAL-1.0",
                        "CPL-1.0",
                        "CATOSL-1.1",
                        "CUA-OPL-1.0",
                        "EPL-1.0",
                        "ECL-1.0",
                        "ECL-2.0",
                        "EFL-1.0",
                        "EFL-2.0",
                        "Entessa",
                        "EUDatagrid",
                        "EUPL-1.1",
                        "Fair",
                        "Frameworx-1.0",
                        "AGPL-3.0",
                        "GPL-2.0",
                        "GPL-3.0",
                        "LGPL-2.1",
                        "LGPL-3.0",
                        "LGPL-2.0",
                        "HPND",
                        "IPL-1.0",
                        "Intel",
                        "IPA",
                        "ISC",
                        "LPPL-1.3c",
                        "LiLiQ-P-1.1",
                        "LiLiQ-Rplus-1.1",
                        "LiLiQ-R-1.1",
                        "LPL-1.02",
                        "LPL-1.0",
                        "MS-PL",
                        "MS-RL",
                        "MirOS",
                        "MIT",
                        "Motosoto",
                        "MPL-1.0",
                        "MPL-1.1",
                        "MPL-2.0",
                        "MPL-2.0-no-copyleft-exception",
                        "Multics",
                        "NASA-1.3",
                        "Naumen",
                        "NGPL",
                        "Nokia",
                        "NPOSL-3.0",
                        "NTP",
                        "OCLC-2.0",
                        "OGTSL",
                        "OSL-1.0",
                        "OSL-2.0",
                        "OSL-2.1",
                        "OSL-3.0",
                        "OSET-PL-2.1",
                        "PHP-3.0",
                        "PostgreSQL",
                        "Python-2.0",
                        "QPL-1.0",
                        "RPSL-1.0",
                        "RPL-1.1",
                        "RPL-1.5",
                        "RSCPL",
                        "OFL-1.1",
                        "SimPL-2.0",
                        "Sleepycat",
                        "SISSL",
                        "SPL-1.0",
                        "Watcom-1.0",
                        "UPL-1.0",
                        "NCSA",
                        "VSL-1.0",
                        "W3C",
                        "Xnet",
                        "Zlib",
                        "ZPL-2.0"
                    ]
                },
                "summary": {
                    "description": "A helpful summary of your package, less than 80 characters",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 79
                },
                "version": {
                    "description": "Your package's version in semantic versioning format.",
                    "type": "string",
                    "pattern": "\\d+\\.\\d+\\.\\d+"
                },
                "elm-version": {
                    "description": "The version of elm your package is targeting",
                    "type": "string"
                },
                "exposed-modules": {
                    "description": "All modules that your project will make available to end users.",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "dependencies": {
                    "description": "A list of elm dependencies that your package needs for in production.",
                    "$ref": "#/definitions/rangeDependency"
                },
                "test-dependencies": {
                    "description": "A list of elm dependencies that your package uses only for testing.",
                    "$ref": "#/definitions/rangeDependency"
                }
            },
            "required": [
                "name",
                "license",
                "summary",
                "version",
                "elm-version",
                "exposed-modules",
                "dependencies",
                "test-dependencies"
            ]
        },
        "applicationSpecificProperties": {
            "type": "object",
            "properties": {
                "source-directories": {
                    "description": "A list of directories that will be used to build your project.",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "elm-version": {
                    "description": "The version of elm your project is targeting",
                    "type": "string",
                    "pattern": "\\d+\\.\\d+\\.\\d+",
                    "enum": [
                        "0.19.0"
                    ]
                },
                "dependencies": {
                    "description": "A list of elm dependencies that your project needs for in production.",
                    "type": "object",
                    "properties": {
                        "direct": {
                            "$ref": "#/definitions/exactDependency"
                        },
                        "indirect": {
                            "$ref": "#/definitions/exactDependency"
                        }
                    },
                    "required": [
                        "direct",
                        "indirect"
                    ]
                },
                "test-dependencies": {
                    "description": "A list of elm dependencies that your project uses only for testing.",
                    "type": "object",
                    "properties": {
                        "direct": {
                            "$ref": "#/definitions/exactDependency"
                        },
                        "indirect": {
                            "$ref": "#/definitions/exactDependency"
                        }
                    },
                    "required": [
                        "direct",
                        "indirect"
                    ]
                }
            },
            "required": [
                "source-directories",
                "elm-version",
                "dependencies",
                "test-dependencies"
            ]
        }
    },
    "properties": {
        "type": {
            "description": "Specifies if your project will be a package or an application",
            "type": "string",
            "enum": [
                "application",
                "package"
            ]
        }
    },
    "if": {
        "properties": {
            "type": {
                "enum": [
                    "package"
                ]
            }
        }
    },
    "then": {
        "$ref": "#/definitions/packageSpecificProperties"
    },
    "else": {
        "if": {
            "properties": {
                "type": {
                    "enum": [
                        "application"
                    ]
                }
            }
        },
        "then": {
            "$ref": "#/definitions/applicationSpecificProperties"
        },
        "else": {}
    },
    "required": [
        "type"
    ]
}