1
0
Fork 0
composer/res/composer-repository-schema....

105 lines
3.8 KiB
JSON
Raw Normal View History

2016-09-30 15:02:18 +00:00
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A representation of packages metadata.",
"type": "object",
"oneOf": [
{ "required": [ "packages" ] },
{ "required": [ "providers" ] },
{ "required": [ "provider-includes", "providers-url" ] }
],
"properties": {
"packages": {
"type": ["object", "array"],
"description": "A hashmap of package names in the form of <vendor>/<name>.",
"additionalProperties": { "$ref": "#/definitions/versions" }
},
"providers-url": {
"type": "string",
"description": "Endpoint to retrieve provider data from, e.g. '/p/%package%$%hash%.json'."
},
"provider-includes": {
"type": "object",
"description": "A hashmap of provider listings.",
"additionalProperties": { "$ref": "#/definitions/provider" }
},
"providers": {
"type": "object",
"description": "A hashmap of package names in the form of <vendor>/<name>.",
"additionalProperties": { "$ref": "#/definitions/provider" }
},
"notify-batch": {
"type": "string",
"description": "Endpoint to call after multiple packages have been installed, e.g. '/downloads/'."
},
"search": {
"type": "string",
"description": "Endpoint that provides search capabilities, e.g. '/search.json?q=%query%&type=%type%'."
},
"warning": {
"type": "string",
"description": "A message that will be output by Composer as a warning when this source is consulted."
}
},
"definitions": {
"versions": {
"type": "object",
"description": "A hashmap of versions and their metadata.",
"additionalProperties": { "$ref": "#/definitions/version" }
},
"version": {
"type": "object",
"oneOf": [
{ "$ref": "#/definitions/package" },
{ "$ref": "#/definitions/metapackage" }
2016-09-30 15:02:18 +00:00
]
},
"package-base": {
2016-09-30 15:02:18 +00:00
"properties": {
"name": { "type": "string" },
"type": { "type": "string" },
"version": { "type": "string" },
"version_normalized": {
"type": "string",
"description": "Normalized version, optional but can save computational time on client side."
},
"autoload": { "type": "object" },
"require": { "type": "object" },
"replace": { "type": "object" },
"conflict": { "type": "object" },
"provide": { "type": "object" },
2016-09-30 15:02:18 +00:00
"time": { "type": "string" }
},
"additionalProperties": true
},
"package": {
"allOf": [
{ "$ref": "#/definitions/package-base" },
{ "oneOf": [
{ "required": [ "name", "version", "source" ] },
{ "required": [ "name", "version", "dist" ] }
] }
]
},
"metapackage": {
"allOf": [
{ "$ref": "#/definitions/package-base" },
{
"properties": {
"type": { "type": "string", "enum": [ "metapackage" ] }
},
"required": [ "name", "version", "type" ]
}
]
2016-09-30 15:02:18 +00:00
},
"provider": {
"type": "object",
"properties": {
"sha256": {
"type": "string",
"description": "Hash value that can be used to validate the resource."
}
}
}
}
}