{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Application manifest",
  "description": "Application manifest for an Azure Sphere application",
  "type": "object",
  "properties": {
    "Capabilities": {
      "title": "Capability list",
      "description": "A list of capabilities that this application requires in order to operate",
      "properties": {
        "AllowedConnections": {
          "title": "Allowed network connection array",
          "description": "An array of strings representing DNS hostnames or IP addresses that this application is allowed to connect to, e.g. \"test.azurewebsites.net\" or \"10.123.123.1\"",
          "items": {
            "title": "Network connection endpoint",
            "description": "A string representing a single DNS hostname or IP address that this application is allowed to connect to, e.g. \"test.azurewebsites.net\" or \"10.123.123.1\"",
            "type": "string"
          },
          "type": "array"
        },
        "Canbus": {
          "title": "array of CAN objects",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Interface": {
                "title": "CAN interface name",
                "type": "string"
              },
              "CanIDList": {
                "title": "list of CAN IDs allowed for transmission",
                "type": "array",
                "items": {
                  "title": "ID",
                  "type": "number"
                }
              }
            }
          }
        },
        "CanbusNetworkConfig": {
          "title": "CAN Network configuration capability",
          "description": "A true/false Boolean representing whether this application is allowed to configure the CAN bus",
          "type": "boolean"
        },
        "DeviceAuthentication": {
          "title": "Azure Sphere tenant to use for device authentication",
          "description": "The 128-bit unique ID of the Azure Sphere tenant to be used for device authentication for this application, in UUID format",
          "type": "string",
          "pattern": "^({)?(?<uuid>[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12})((?(1)}))$"
        },
        "Gpio": {
          "title": "Allowed GPIO interface list",
          "description": "An array of strings, each starting with '$', that represent GPIO hardware definition mappings (e.g \"$SAMPLE_RGBLED_RED\") that this application depends on, or (if not using hardware definitions) an array of integers representing GPIO indexes (e.g. 23, corresponding to GPIO23) that this application is allowed to use",
          "items": {
            "title": "GPIO index",
            "description": "A string starting with '$' that represents a GPIO hardware definition mapping (e.g \"$SAMPLE_RGBLED_RED\") that this application depends on, or (if not using hardware definitions) an integer representing the GPIO index (e.g. 23, corresponding to GPIO23) that this application is allowed to use",
            "type": [
              "string",
              "number"
            ]
          },
          "type": "array"
        },
        "Uart": {
          "title": "Allowed UART interface list",
          "description": "An array of strings, each starting with '$', that represent UART hardware definition mappings (e.g \"$SAMPLE_ISU0_UART\") that this application depends on, or (if not using hardware definitions) an array of strings representing UARTs (e.g. \"ISU0\") that this application is allowed to use",
          "items": {
            "title": "UART index",
            "description": "A string starting with '$' that represents a UART hardware definition mapping (e.g \"$SAMPLE_ISU0_UART\") that this application depends on, or (if not using hardware definitions) a string representing the UART (e.g. \"ISU0\") that this application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "Pwm": {
          "title": "Allowed PWM interface list",
          "description": "BETA - An array of strings, each starting with '$' that represent PWM hardware definition mappings (e.g \"$SAMPLE_LED_PWM_CONTROLLER\") that this application depends on, or (if not using hardware definitions) an array of strings representing PWM controllers (e.g. \"PWM-CONTROLLER-2\") that this application is allowed to use",
          "items": {
            "title": "PWM index",
            "description": "A string starting with '$' that represents a PWM hardware definition mapping (e.g \"$SAMPLE_LED_PWM_CONTROLLER\") that this application depends on, or (if not using hardware definitions) a string representing the PWM controller (e.g. \"PWM-CONTROLLER-2\") that this application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "Adc": {
          "title": "Allowed ADC interface list",
          "description": "BETA - An array of strings, each starting with '$' that represent ADC hardware definition mappings (e.g \"$SAMPLE_POTENTIOMETER_ADC_CONTROLLER\") that this application depends on, or (if not using hardware definitions) an array of strings representing ADC controllers (e.g. \"ADC-CONTROLLER-0\") that this application is allowed to use",
          "items": {
            "title": "ADC index",
            "description": "A string starting with '$' that represents an ADC hardware definition mapping (e.g \"$SAMPLE_POTENTIOMETER_ADC_CONTROLLER\") that this application depends on, or (if not using hardware definitions) a string representing the ADC controller (e.g. \"ADC-CONTROLLER-0\") that this application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "I2sSubordinate": {
          "title": "Allowed I2S subordinate interface list",
          "description": "An array of strings representing I2S subordinates (e.g. \"I2S0\") that this real-time application is allowed to use",
          "items": {
            "title": "I2S subordinate index",
            "description": "A string representing the I2S subordinate (e.g. \"I2S0\") that this real-time application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "WifiConfig": {
          "title": "Wifi configuration capability",
          "description": "A true/false Boolean representing whether this application is allowed to configure WiFi networking",
          "type": "boolean"
        },
        "MutableStorage": {
          "title": "Mutable storage capability",
          "description": "An object specifying the mutable storage requirements of the application",
          "type": "object",
          "properties": {
            "SizeKB": {
              "title": "Size of mutable storage required",
              "description": "An integer specifying the amount of mutable storage space reserved for the application, in KibiBytes",
              "type": "number"
            }
          }
        },
        "SystemTime": {
          "title": "System time capability",
          "description": "BETA - A true/false Boolean representing whether this application can configure the system time",
          "type": "boolean"
        },
        "SystemEventNotifications": {
          "title": "System event notifications capability",
          "description": "BETA - A true/false Boolean representing whether this application can read system event notifications",
          "type": "boolean"
        },
        "SoftwareUpdateDeferral": {
          "title": "Software update deferral capability",
          "description": "BETA - A true/false Boolean representing whether this application can defer software updates"
        },
        "NetworkConfig": {
          "title": "Network configuration capability",
          "description": "BETA - A true/false Boolean representing whether this application can configure networking",
          "type": "boolean"
        },
        "TimeSyncConfig": {
          "title": "Time-sync configuration capability",
          "description": "BETA - A true/false Boolean representing whether this application can configure the time-sync service",
          "type": "boolean"
        },
        "SntpService": {
          "title": "SNTP service capability",
          "description": "BETA - A true/false Boolean representing whether this application can configure the SNTP service",
          "type": "boolean"
        },
        "DhcpService": {
          "title": "DHCP service capability",
          "description": "BETA - A true/false Boolean representing whether this application can configure the DHCP service",
          "type": "boolean"
        },
        "AllowedTcpServerPorts": {
          "title": "Allowed TCP server ports",
          "description": "BETA - An array of integers representing the TCP port numbers on which this application is allowed to open a TCP server socket",
          "type": "array",
          "items": {
            "title": "TCP server port number",
            "description": "An integer representing a TCP port number on which this application is allowed to open a TCP server socket",
            "type": "number"
          }
        },
        "AllowedUdpServerPorts": {
          "title": "Allowed UDP server ports",
          "description": "BETA - An array of integers representing the UDP port numbers on which this application is allowed to open a UDP server socket",
          "type": "array",
          "items": {
            "title": "TCP server port number",
            "description": "An integer representing a UDP port number on which this application is allowed to open a UDP server socket",
            "type": "number"
          }
        },
        "HardwareAddressConfig": {
          "title": "Network interface hardware address configuration capability",
          "description": "A true/false Boolean representing whether this application is allowed to configure the network hardware address",
          "type": "boolean"
        },
        "I2cMaster": {
          "title": "Allowed I2C Master interface list",
          "description": "An array of strings, each starting with '$', that represent I2C Master hardware definition mappings (e.g \"$SAMPLE_ISU0_I2C\") that this application depends on, or (if not using hardware definitions) an array of strings representing I2C Master interfaces (e.g. \"ISU0\") that this application is allowed to use",
          "items": {
            "title": "I2C Master interface index",
            "description": "A string starting with '$' that represents an I2C Master hardware definition mapping (e.g \"$SAMPLE_ISU0_I2C\") that this application depends on, or (if not using hardware definitions) a string representing the I2C Master interface (e.g. \"ISU0\")  that this application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "SpiMaster": {
          "title": "Allowed SPI Master interface list",
          "description": "An array of strings, each starting with '$', that represent SPI Master hardware definition mappings (e.g \"$SAMPLE_ISU0_SPI\") that this application depends on, or (if not using hardware definitions) an array of strings representing SPI Master interfaces (e.g. \"ISU0\") that this application is allowed to use",
          "items": {
            "title": "SPI Master interface index",
            "description": "A string starting with '$' that represents an SPI Master hardware definition mapping (e.g \"$SAMPLE_ISU0_SPI\") that this application depends on, or (if not using hardware definitions) a string representing the SPI Master interface (e.g. \"ISU0\")  that this application is allowed to use",
            "type": "string"
          },
          "type": "array"
        },
        "PowerControls": {
          "title": "Allowed PowerControls states",
          "description": "An array of strings that represent granular capabilities to control the device power state. ForcePowerDown and ForceReboot are the only supported values.",
          "items": {
            "title": "PowerControls values",
            "type": "string"
          },
          "type": "array"
        },
        "AllowedApplicationConnections": {
          "title": "Allowed application connections list",
          "description": "BETA - An array of unique IDs, that represent the applications that this application is allowed to connect with",
          "items": {
            "title": "Allowed application connection",
            "description": "The 128-bit unique ID of the component (i.e. application), in UUID format, of an application that you are allowed to connect with",
            "type": "string",
            "pattern": "^({)?(?<uuid>[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12})((?(1)}))$"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "CmdArgs": {
      "title": "Command line argument array",
      "description": "An array of strings representing command-line arguments passed to the application's entry point executable",
      "items": {
        "title": "Command line argument",
        "description": "A string representing a single command-line argument passed to the application's entry point executable",
        "type": "string"
      },
      "type": "array"
    },
    "EntryPoint": {
      "title": "Entry point",
      "description": "A string representing the relative path to the application's entry point executable, e.g. /bin/app",
      "type": "string"
    },
    "SchemaVersion": {
      "title": "Schema version",
      "description": "An integer representing the version of the schema used for this application manifest (must be '1')",
      "type": "number"
    },
    "TargetApplicationRuntimeVersion": {
      "title": "Target application runtime version",
      "description": "An integer representing the application runtime version targeted by this project. When building using Visual Studio, this field is automatically populated based on the project properties.",
      "type": "number"
    },
    "TargetBetaApis": {
      "title": "Target beta APIs",
      "description": "A string representing the beta APIs targeted by this project. When building using Visual Studio, this field is automatically populated based on the project properties.",
      "type": "string"
    },
    "ComponentId": {
      "description": "The 128-bit unique ID of the component (i.e. application), in UUID format",
      "title": "Component ID",
      "type": "string",
      "pattern": "^({)?(?<uuid>[0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12})((?(1)}))$"
    },
    "Name": {
      "description": "Application name",
      "title": "Name",
      "type": "string",
      "pattern": "[ -~]{1,31}"
    },
    "ApplicationType": {
      "description": "Application type. This field is optional; if not provided it assumes 'Default'. If present, it must be one of 'Default', 'Debugger' or 'RealTimeCapable'.",
      "title": "Application type",
      "type": "string",
      "pattern": "^(Default|Debugger|RealTimeCapable)$"
    }
  },
  "required": [
    "SchemaVersion",
    "Capabilities",
    "EntryPoint",
    "Name",
    "ComponentId"
  ]
}