blob: cbd6bc54d9806899553b2d38a6050c7873f65a62 [file] [log] [blame]
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"capability-clause": {
"type": "string",
"pattern": "^(service|directory)$"
},
"path-clause": {
"type": "string",
"pattern": "^/.+$",
"minLength": 1,
"maxLength": 1024
},
"uri-clause": {
"type": "string",
"pattern": "^[0-9a-z+\\-\\.]+://.+$",
"minLength": 1,
"maxLength": 4096
},
"name-clause": {
"type": "string",
"pattern": "^[0-9a-z_\\-\\.]+$",
"minLength": 1,
"maxLength": 100
},
"has-valid-child": {
"oneOf": [
{ "properties": { "relation": { "not": { "pattern": "child" } } } },
{ "required": [ "child_name" ] }
]
}
},
"properties": {
"program": {
"$id": "/properties/program",
"type": "object",
"title": "Program information"
},
"uses": {
"$id": "/properties/uses",
"type": "array",
"title": "Used capabilities",
"uniqueItems": true,
"items": {
"$id": "/properties/uses/items/",
"type": "object",
"required": [
"type",
"source_path",
"target_path"
],
"properties": {
"type": {
"$id": "/properties/uses/items/properties/type",
"title": "Used capability type",
"$ref": "#/definitions/capability-clause"
},
"source_path": {
"$id": "/properties/uses/items/properties/source_path",
"$ref": "#/definitions/path-clause",
"title": "Used capability source path"
},
"target_path": {
"$id": "/properties/uses/items/properties/target_path",
"$ref": "#/definitions/path-clause",
"title": "Used capability target path"
}
}
}
},
"exposes": {
"$id": "/properties/exposes",
"type": "array",
"title": "Exposed capabilities",
"uniqueItems": true,
"items": {
"$id": "/properties/exposes/items/",
"type": "object",
"required": [
"type",
"source_path",
"source",
"target_path"
],
"properties": {
"type": {
"$id": "/properties/exposes/items/properties/type",
"title": "Exposed capability type",
"$ref": "#/definitions/capability-clause"
},
"source_path": {
"$id": "/properties/exposes/items/properties/source_path",
"$ref": "#/definitions/path-clause",
"title": "Exposed capability source path"
},
"source": {
"$id": "/properties/exposes/items/properties/source",
"type": "object",
"title": "Exposed capability source component",
"required": [
"relation"
],
"$ref": "#/definitions/has-valid-child",
"properties": {
"relation": {
"$id": "/properties/exposes/items/properties/source/properties/relation",
"type": "string",
"title": "Exposed capability source component relation",
"pattern": "^(self|child)$"
},
"child_name": {
"$id": "/properties/exposes/items/properties/source/properties/child_name",
"$ref": "#/definitions/name-clause",
"title": "Exposed capability source component child name"
}
}
},
"target_path": {
"$id": "/properties/exposes/items/properties/target_path",
"$ref": "#/definitions/path-clause",
"title": "Exposed capability target path"
}
}
}
},
"offers": {
"$id": "/properties/offers",
"type": "array",
"title": "Offered capabilities",
"uniqueItems": true,
"items": {
"$id": "/properties/offers/items/",
"type": "object",
"required": [
"type",
"source_path",
"source",
"targets"
],
"properties": {
"type": {
"$id": "/properties/offers/items/properties/type",
"title": "Offered capability type",
"$ref": "#/definitions/capability-clause"
},
"source_path": {
"$id": "/properties/exposes/items/properties/source_path",
"$ref": "#/definitions/path-clause",
"title": "Offered capability source path"
},
"source": {
"$id": "/properties/exposes/items/properties/source",
"type": "object",
"title": "Offered capability source component",
"required": [
"relation"
],
"$ref": "#/definitions/has-valid-child",
"properties": {
"relation": {
"$id": "/properties/offers/items/properties/source/properties/relation",
"type": "string",
"title": "Offered capability source component relation",
"pattern": "^(self|realm|child)$"
},
"child_name": {
"$id": "/properties/offers/items/properties/source/properties/child_name",
"$ref": "#/definitions/name-clause",
"title": "Offered capability source component child name"
}
}
},
"targets": {
"$id": "/properties/offers/items/properties/targets",
"type": "array",
"title": "Offered capability targets",
"uniqueItems": true,
"items": {
"$id": "/properties/offers/items/properties/targets/items",
"type": "object",
"required": [
"target_path",
"child_name"
],
"properties": {
"target_path": {
"$id": "/properties/offers/items/properties/targets/items/target_path",
"$ref": "#/definitions/path-clause",
"title": "Offered capability target path"
},
"child_name": {
"$id": "/properties/offers/items/properties/targets/items/child_name",
"$ref": "#/definitions/name-clause",
"title": "Offered capability target child name"
}
}
}
}
}
}
},
"children": {
"$id": "/properties/children",
"type": "array",
"title": "Child components",
"uniqueItems": true,
"items": {
"$id": "/properties/children/items",
"type": "object",
"required": [
"name",
"uri"
],
"properties": {
"name": {
"$id": "/properties/children/items/properties/name",
"$ref": "#/definitions/name-clause",
"title": "Child component name"
},
"uri": {
"$id": "/properties/children/items/properties/uri",
"$ref": "#/definitions/uri-clause",
"title": "Child component URI"
}
}
}
},
"facets": {
"$id": "/properties/facets",
"type": "object",
"title": "Facets",
"description": "Freeform dictionary containing third-party metadata"
}
}
}