| { |
| "type": "object", |
| "$schema": "http://json-schema.org/draft-07/schema#", |
| "definitions": { |
| "relative-id-clause": { |
| "type": "string", |
| "minLength": 1, |
| "maxLength": 101 |
| }, |
| "path-clause": { |
| "type": "string", |
| "pattern": "^/.+$", |
| "minLength": 1, |
| "maxLength": 1024 |
| }, |
| "uri-clause": { |
| "type": "string", |
| "pattern": "^[0-9a-z+\\-\\.]+://.+$", |
| "minLength": 1, |
| "maxLength": 4096 |
| }, |
| "child-name-clause": { |
| "type": "string", |
| "pattern": "^[0-9a-z_\\-\\.]+$", |
| "minLength": 1, |
| "maxLength": 100 |
| } |
| }, |
| "properties": { |
| "program": { |
| "$id": "/properties/program", |
| "type": "object", |
| "title": "Program information", |
| "description": "Information required to run the program", |
| "required": [ |
| "binary" |
| ], |
| "properties": { |
| "binary": { |
| "$id": "/properties/program/properties/binary", |
| "type": "string", |
| "title": "Program binary", |
| "description": "The entry point for an executable", |
| "examples": [ |
| "bin/app" |
| ] |
| }, |
| "args": { |
| "$id": "/properties/program/properties/args", |
| "type": "array", |
| "title": "Program arguments", |
| "description": "The arguments to provide to an executable", |
| "items": { |
| "type": "string" |
| }, |
| "minItems": 1, |
| "examples": [ |
| "--verbose" |
| ] |
| }, |
| "env": { |
| "$id": "/properties/program/properties/env", |
| "type": "object", |
| "title": "Environment variables", |
| "description": "Environment variables to provide to an executable", |
| "items": { |
| "type": "string" |
| }, |
| "minItems": 1, |
| "examples": [ |
| { |
| "VERBOSITY": "1" |
| } |
| ] |
| } |
| } |
| }, |
| "use": { |
| "$id": "/properties/use", |
| "type": "array", |
| "title": "Used capabilities", |
| "description": "Capabilities that will be installed in this component's namespace", |
| "uniqueItems": true, |
| "items": { |
| "$id": "/properties/use/items", |
| "type": "object", |
| "oneOf": [ |
| { |
| "required": [ "service" ] |
| }, |
| { |
| "required": [ "directory" ] |
| } |
| ], |
| "properties": { |
| "service": { |
| "$id": "/properties/use/items/properties/service", |
| "title": "Used service source path", |
| "description": "The path under which a service is offered to this component", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.logger.Log" |
| ] |
| }, |
| "directory": { |
| "$id": "/properties/use/items/properties/directory", |
| "title": "Used directory source path", |
| "description": "The path under which a directory is offered to this component", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/data/assets/widgets" |
| ] |
| }, |
| "as": { |
| "$id": "/properties/use/items/properties/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\".", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.logger.Log" |
| ] |
| } |
| } |
| } |
| }, |
| "expose": { |
| "$id": "/properties/expose", |
| "type": "array", |
| "title": "Capabilities exposed", |
| "description": "Capabilities exposed by this component to its containing realm", |
| "uniqueItems": true, |
| "items": { |
| "$id": "/properties/expose/items", |
| "type": "object", |
| "required": [ |
| "from" |
| ], |
| "oneOf": [ |
| { |
| "required": [ "service" ] |
| }, |
| { |
| "required": [ "directory" ] |
| } |
| ], |
| "properties": { |
| "service": { |
| "$id": "/properties/expose/items/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\").", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.ui.Scenic" |
| ] |
| }, |
| "directory": { |
| "$id": "/properties/expose/items/properties/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\").", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/data/assets/widgets" |
| ] |
| }, |
| "from": { |
| "$id": "/properties/expose/items/properties/from", |
| "title": "Exposed capability source component", |
| "pattern": "^(self|#[0-9a-z_\\-\\.]+)$", |
| "description": "The component which has the capability to expose. Either \"self\" or \"#$CHILD\".", |
| "$ref": "#/definitions/relative-id-clause", |
| "examples": [ |
| "self", |
| "#scenic" |
| ] |
| }, |
| "as": { |
| "$id": "/properties/expose/items/properties/as", |
| "title": "Exposed capability target path", |
| "description": "The path under which the capability will be exposed. Defaults to \"service\"/\"directory\"", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.logger.Log" |
| ] |
| } |
| } |
| } |
| }, |
| "offer": { |
| "$id": "/properties/offer", |
| "type": "array", |
| "title": "Offered capabilitys", |
| "description": "Capabilities offered by this component to its children", |
| "uniqueItems": true, |
| "items": { |
| "$id": "/properties/offer/items", |
| "type": "object", |
| "required": [ |
| "from", |
| "targets" |
| ], |
| "oneOf": [ |
| { |
| "required": [ "service" ] |
| }, |
| { |
| "required": [ "directory" ] |
| } |
| ], |
| "properties": { |
| "service": { |
| "$id": "/properties/offer/items/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\").", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.ui.Scenic" |
| ] |
| }, |
| "directory": { |
| "$id": "/properties/offer/items/properties/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\").", |
| "$ref": "#/definitions/path-clause", |
| "examples": [ |
| "/svc/fuchsia.ui.Scenic" |
| ] |
| }, |
| "from": { |
| "$id": "/properties/offer/items/properties/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_\\-\\.]+)$", |
| "$ref": "#/definitions/relative-id-clause", |
| "examples": [ |
| "realm", |
| "self", |
| "#scenic" |
| ] |
| }, |
| "targets": { |
| "$id": "/properties/offer/items/properties/targets", |
| "type": "array", |
| "title": "Offered capability targets", |
| "description": "The components the capability is being offered to", |
| "uniqueItems": true, |
| "minItems": 1, |
| "items": { |
| "$id": "/properties/offer/items/properties/targets/items", |
| "type": "object", |
| "required": [ |
| "to" |
| ], |
| "properties": { |
| "to": { |
| "$id": "/properties/offer/items/properties/targets/items/properties/to", |
| "title": "Offered capability target component", |
| "description": "The child component to which the capability is being offered, with the syntax \"#$CHILD\".", |
| "pattern": "^#[a-zA-Z0-9_-]+$", |
| "$ref": "#/definitions/relative-id-clause", |
| "examples": [ |
| "#scenic" |
| ] |
| }, |
| "as": { |
| "$id": "/properties/offer/items/properties/targets/items/properties/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\").", |
| "$ref": "#/definitions/relative-id-clause", |
| "examples": [ |
| "/data/assets/widgets", |
| "/svc/fuchsia.ui.Scenic" |
| ] |
| } |
| } |
| } |
| } |
| } |
| } |
| }, |
| "children": { |
| "$id": "/properties/children", |
| "type": "array", |
| "title": "Child components", |
| "description": "The children of this component, including name and launch information", |
| "uniqueItems": true, |
| "items": { |
| "$id": "/properties/children/items", |
| "type": "object", |
| "required": [ |
| "name", |
| "uri" |
| ], |
| "properties": { |
| "name": { |
| "$id": "/properties/children/items/properties/name", |
| "title": "Child component name", |
| "description": "The parent's local name for the child", |
| "$ref": "#/definitions/child-name-clause", |
| "examples": [ |
| "echo2_server", |
| "System-logger" |
| ] |
| }, |
| "uri": { |
| "$id": "/properties/children/items/properties/uri", |
| "title": "Child component URI", |
| "description": "The URI that identifies the child component.", |
| "$ref": "#/definitions/uri-clause", |
| "examples": [ |
| "fuchsia-pkg://fuchsia.com/echo_server_cpp#meta/echo_server.cml" |
| ] |
| } |
| } |
| } |
| }, |
| "facets": { |
| "$id": "/properties/facets", |
| "type": "object", |
| "title": "Facets", |
| "description": "Freeform dictionary containing third-party metadata" |
| } |
| } |
| } |