{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "A haxelib project",
	"type": "object",
	"properties": {
		"name": { "$ref": "#/definitions/projectName" },
		"url": {
			"description": "Project's website",
			"type": "string",
			"format": "uri"
		},
		"description": {
			"description": "Short description of the project",
			"type": "string"
		},
		"license": {
			"description": "Open source license under which the project is licensed",
			"enum": ["GPL", "LGPL", "BSD", "Public", "MIT", "Apache"]
		},
		"version": { "$ref": "#/definitions/semver" },
		"classPath": {
			"description": "Folder in the package which contains the source files for this project",
			"type": "string"
		},
		"main": {
			"description": "A class to run on `haxelib run libraryname` command.\nRelative to library root. E.g. to run `tools/Main.hx` the value should be `tools.Main`.\nDefault value since Haxe 4: Run",
			"type": "string"
		},
		"contributors": {
			"description": "List of project contributors that are allowed to upload to haxelib",
			"type": "array",
			"items": { "$ref": "#/definitions/userName" },
			"minItems": 1,
			"uniqueItems": true
		},
		"tags": {
			"description": "List of tags for easier finding the project on haxelib",
			"type": "array",
			"items": { "$ref": "#/definitions/haxelibTag" },
			"uniqueItems": true
		},
		"dependencies": {
			"type": "object",
			"description": "Project's dependencies",
			"patternProperties": {
				"^[A-Za-z0-9_.-]{3,}$": { "$ref": "#/definitions/dependencyVersion" }
			},
			"additionalProperties": false
		},
		"releasenote": {
			"description": "Short description of changes made in this version",
			"type": "string"
		}
	},
	"additionalProperties": false,
	"required": ["name", "license", "releasenote", "contributors", "version"],
	"definitions": {
		"userName": {
			"description": "The name of a user",
			"type": "string",
			"minLength": 3,
			"pattern": "^[A-Za-z0-9_.-]{3,}$"
		},
		"projectName": {
			"description": "The name of a haxelib project",
			"type": "string",
			"minLength": 3,
			"pattern": "^[A-Za-z0-9_.-]{3,}$",
			"not": {
				"anyOf": [
					{"enum": ["haxe", "all"]},
					{"pattern": "\\.(zip|hxml)$"}
				]
			}
		},
		"haxelibTag": {
			"description": "A keyword or term associated with a haxelib project",
			"type": "string",
			"minLength": 2,
			"pattern": "^[A-Za-z0-9_.-]{2,}$"
		},
		"semver": {
			"type": "string",
			"description": "Project's version",
			"pattern": "^(\\d|[1-9]\\d*)\\.(\\d|[1-9]\\d*)\\.(\\d|[1-9]\\d*)(-(alpha|beta|rc)(\\.(\\d|[1-9]\\d*))?)?$"
		},
		"dependencyVersion": {
			"oneOf": [
				{ "$ref": "#/definitions/semver" },
				{
					"type": "string",
					"maxLength": 0
				}
			]
		}
	}
}
