blob: ece25c072a9eb2cef6f9cc8cf5b86f30ccc62e45 [file] [log] [blame]
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"path-clause": {
"type": "string",
"pattern": "^(/[^/]+)+$",
"minLength": 1,
"maxLength": 1024
},
"url-clause": {
"type": "string",
"pattern": "^[0-9a-z+\\-\\.]+://.+$",
"minLength": 1,
"maxLength": 4096
},
"startup-clause": {
"type": "string",
"pattern": "^(lazy|eager)$"
},
"durability-clause": {
"type": "string",
"pattern": "^(persistent|transient)$"
},
"name-clause": {
"type": "string",
"pattern": "^[0-9a-z_\\-\\.]+$",
"minLength": 1,
"maxLength": 100
},
"expose-source-clause": {
"title": "Exposed capability source component",
"type": "object",
"oneOf": [
{
"required": [ "myself" ]
},
{
"required": [ "child" ]
}
],
"properties": {
"myself": {
"type": "object",
"title": "Component itself"
},
"child": {
"type": "object",
"title": "Component's child",
"required": [ "name" ],
"properties": {
"name": {
"title": "Child name",
"allOf": [{ "$ref": "#/definitions/name-clause" }]
}
}
}
}
},
"offer-source-clause": {
"title": "Offered capability source component",
"type": "object",
"oneOf": [
{
"required": [ "realm" ]
},
{
"required": [ "myself" ]
},
{
"required": [ "child" ]
}
],
"properties": {
"realm": {
"type": "object",
"title": "Component's containing realm (parent component)"
},
"myself": {
"type": "object",
"title": "Component itself"
},
"child": {
"type": "object",
"title": "Component's child",
"required": [ "name" ],
"properties": {
"name": {
"title": "Child name",
"allOf": [{ "$ref": "#/definitions/name-clause" }]
}
}
}
}
},
"offer-targets-clause": {
"title": "Offered capability targets",
"type": "array",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "object",
"required": [
"target_path",
"dest"
],
"properties": {
"target_path": {
"title": "Offered capability target path",
"type": "string",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"dest": {
"title": "Offered capability target component",
"type": "object",
"oneOf": [
{
"required": [ "child" ]
},
{
"required": [ "collection" ]
}
],
"properties": {
"child": {
"type": "object",
"title": "Offered target component's child",
"required": [ "name" ],
"properties": {
"name": {
"title": "Child name",
"allOf": [{ "$ref": "#/definitions/name-clause" }]
}
}
},
"collection": {
"type": "object",
"title": "Offered target component's collection",
"required": [ "name" ],
"properties": {
"name": {
"title": "Collection name",
"allOf": [{ "$ref": "#/definitions/name-clause" }]
}
}
}
}
}
}
}
}
},
"properties": {
"program": {
"type": "object",
"title": "Program information"
},
"uses": {
"type": "array",
"title": "Used capabilities",
"uniqueItems": true,
"items": {
"type": "object",
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"type": "object",
"title": "Used service capability",
"required": [
"source_path",
"target_path"
],
"properties": {
"source_path": {
"title": "Used service source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"target_path": {
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"title": "Used service target path"
}
}
},
"directory": {
"type": "object",
"title": "Used service capability",
"required": [
"source_path",
"target_path"
],
"properties": {
"source_path": {
"title": "Used service source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"target_path": {
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"title": "Used service target path"
}
}
}
}
}
},
"exposes": {
"type": "array",
"title": "Exposed capabilities",
"uniqueItems": true,
"items": {
"type": "object",
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"type": "object",
"title": "Exposed service capability",
"required": [
"source",
"source_path",
"target_path"
],
"properties": {
"source": {
"title": "Exposed service source component",
"allOf": [{ "$ref": "#/definitions/expose-source-clause" }]
},
"source_path": {
"title": "Exposed service source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"target_path": {
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"title": "Exposed service target path"
}
}
},
"directory": {
"type": "object",
"title": "Exposed directory capability",
"required": [
"source",
"source_path",
"target_path"
],
"properties": {
"source": {
"title": "Exposed directory source component",
"allOf": [{ "$ref": "#/definitions/expose-source-clause" }]
},
"source_path": {
"title": "Exposed directory source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"target_path": {
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"title": "Exposed directory target path"
}
}
}
}
}
},
"offers": {
"type": "array",
"title": "Offered capabilities",
"uniqueItems": true,
"items": {
"type": "object",
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"required": [
"source",
"source_path",
"targets"
],
"properties": {
"source": {
"title": "Offered service source component",
"allOf": [{ "$ref": "#/definitions/offer-source-clause" }]
},
"source_path": {
"title": "Offered service source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"targets": {
"title": "Offered service targets",
"allOf": [{ "$ref": "#/definitions/offer-targets-clause" }]
}
}
},
"directory": {
"required": [
"source",
"source_path",
"targets"
],
"properties": {
"source": {
"title": "Offered directory source component",
"allOf": [{ "$ref": "#/definitions/offer-source-clause" }]
},
"source_path": {
"title": "Offered directory source path",
"allOf": [{ "$ref": "#/definitions/path-clause" }]
},
"targets": {
"title": "Offered directory targets",
"allOf": [{ "$ref": "#/definitions/offer-targets-clause" }]
}
}
}
}
}
},
"children": {
"type": "array",
"title": "Child components",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"url",
"startup"
],
"properties": {
"name": {
"allOf": [{ "$ref": "#/definitions/name-clause" }],
"title": "Child component name"
},
"url": {
"allOf": [{ "$ref": "#/definitions/url-clause" }],
"title": "Child component URI"
},
"startup": {
"allOf": [{ "$ref": "#/definitions/startup-clause" }],
"title": "Startup mode"
}
}
}
},
"collections": {
"type": "array",
"title": "Collections",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"durability"
],
"properties": {
"name": {
"allOf": [{ "$ref": "#/definitions/name-clause" }],
"title": "Collection name"
},
"durability": {
"allOf": [{ "$ref": "#/definitions/durability-clause" }],
"title": "Durability"
}
}
}
},
"facets": {
"type": "object",
"title": "Facets",
"description": "Freeform dictionary containing third-party metadata"
}
}
}