blob: d3cf6e0febac670b8c6fca1d681b5ec9cc593f93 [file] [log] [blame]
{
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"relative-ref-clause": {
"type": "string",
"minLength": 1,
"maxLength": 101
},
"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
}
},
"properties": {
"program": {
"type": "object",
"title": "Program information",
"description": "Information required to run the program",
"required": [
"binary"
],
"properties": {
"binary": {
"type": "string",
"title": "Program binary",
"description": "The entry point for an executable",
"examples": [
"bin/app"
]
},
"args": {
"type": "array",
"title": "Program arguments",
"description": "The arguments to provide to an executable",
"items": {
"type": "string"
},
"minItems": 1,
"examples": [
"--verbose"
]
},
"env": {
"type": "object",
"title": "Environment variables",
"description": "Environment variables to provide to an executable",
"items": {
"type": "string"
},
"minItems": 1,
"examples": [
{
"VERBOSITY": "1"
}
]
}
}
},
"use": {
"type": "array",
"title": "Used capabilities",
"description": "Capabilities that will be installed in this component's namespace",
"uniqueItems": true,
"items": {
"type": "object",
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"title": "Used service source path",
"description": "The path under which a service is offered to this component",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.logger.Log"
]
},
"directory": {
"title": "Used directory source path",
"description": "The path under which a directory is offered to this component",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/data/assets/widgets"
]
},
"as": {
"title": "Used capability target path",
"description": "The path to which the capability will be installed in the component's incoming namespace. Defaults to \"service\"/\"directory\".",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.logger.Log"
]
}
}
}
},
"expose": {
"type": "array",
"title": "Capabilities exposed",
"description": "Capabilities exposed by this component to its containing realm",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"from"
],
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"title": "Exposed service source path",
"description": "The path to the service being exposed. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the service was exposed by the child (if from \"#$CHILD\").",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.ui.Scenic"
]
},
"directory": {
"title": "Exposed directory source path",
"description": "The path to the directory being exposed. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the directory was exposed by the child (if from \"#$CHILD\").",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/data/assets/widgets"
]
},
"from": {
"title": "Exposed capability source component",
"pattern": "^(self|#[0-9a-z_\\-\\.]+)$",
"description": "The component which has the capability to expose. Either \"self\" or \"#$CHILD\".",
"allOf": [{ "$ref": "#/definitions/relative-ref-clause" }],
"examples": [
"self",
"#scenic"
]
},
"as": {
"title": "Exposed capability target path",
"description": "The path under which the capability will be exposed. Defaults to \"service\"/\"directory\"",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.logger.Log"
]
}
}
}
},
"offer": {
"type": "array",
"title": "Offered capabilities",
"description": "Capabilities offered by this component to its children",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"from",
"to"
],
"oneOf": [
{
"required": [ "service" ]
},
{
"required": [ "directory" ]
}
],
"properties": {
"service": {
"title": "Offered service source path",
"description": "The path to the service being offered. This is either a path in this component's namespace (if from \"self\"), or the path by which the service was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.ui.Scenic"
]
},
"directory": {
"title": "Offered directory source path",
"description": "The path to the directory being offered. This is either a path in this component's outgoing namespace (if from \"self\"), or the path by which the directory was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [{ "$ref": "#/definitions/path-clause" }],
"examples": [
"/svc/fuchsia.ui.Scenic"
]
},
"from": {
"title": "Offered capability source component",
"description": "The component which has the capability to offer. Either \"realm\", \"self\" or \"#$CHILD\".",
"pattern": "^(realm|self|#[0-9a-z_\\-\\.]+)$",
"allOf": [{ "$ref": "#/definitions/relative-ref-clause" }],
"examples": [
"realm",
"self",
"#scenic"
]
},
"to": {
"type": "array",
"title": "Offered capability targets",
"description": "The components the capability is being offered to",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "object",
"required": [
"dest"
],
"properties": {
"dest": {
"title": "Offered capability target",
"description": "The child component or collection to which the capability is being offered, with the syntax \"#$CHILD\".",
"pattern": "^#[a-zA-Z0-9_-]+$",
"allOf": [{ "$ref": "#/definitions/relative-ref-clause" }],
"examples": [
"#scenic"
]
},
"as": {
"title": "Offered capability target path",
"description": "The path by which the capability will be offered. The path is either a path in this component's namespace (if from \"self\"), or the path by which the capability was exposed or offered from another component (if from \"realm\" or \"#$CHILD\").",
"allOf": [{ "$ref": "#/definitions/relative-ref-clause" }],
"examples": [
"/data/assets/widgets",
"/svc/fuchsia.ui.Scenic"
]
}
}
}
}
}
}
},
"children": {
"type": "array",
"title": "Child components",
"description": "The children of this component, including name and launch information",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"url"
],
"properties": {
"name": {
"title": "Child component name",
"description": "The parent's local name for the child",
"allOf": [{ "$ref": "#/definitions/name-clause" }],
"examples": [
"echo_server",
"System-logger"
]
},
"url": {
"title": "Child component URI",
"description": "The URI that identifies the child component.",
"allOf": [{ "$ref": "#/definitions/url-clause" }],
"examples": [
"fuchsia-pkg://fuchsia.com/echo_server_cpp#meta/echo_server.cml"
]
},
"startup": {
"title": "Startup mode",
"description": "Conditions that trigger the component to start (defaults to \"lazy\")",
"allOf": [{ "$ref": "#/definitions/startup-clause" }],
"examples": [
"eager",
"lazy"
]
}
}
}
},
"collections": {
"type": "array",
"title": "Collections",
"description": "The collections under this component",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"name",
"durability"
],
"properties": {
"name": {
"title": "Collection name",
"description": "The parent's local name for the collection",
"allOf": [{ "$ref": "#/definitions/name-clause" }],
"examples": [
"modular",
"tests"
]
},
"durability": {
"title": "Durability",
"description": "The durability of components in the collection. Either \"persistent\" (instances in the collection exist until the parent is destroyed) or \"transient\" (instances in the collection exist until the parent is stopped)",
"allOf": [{ "$ref": "#/definitions/durability-clause" }],
"examples": [
"persistent",
"transient"
]
}
}
}
},
"facets": {
"type": "object",
"title": "Facets",
"description": "Freeform dictionary containing third-party metadata"
}
}
}