{
  "otc": "0.2.0",
  "id": "okham.core.type.application",
  "version": "0.1.0",
  "name": "Application",
  "description": "Identifies an application, its namespace and the versioned capabilities it offers.",
  "status": "draft",
  "fields": [
    {
      "name": "id",
      "type": "string",
      "required": true,
      "description": "id for this application."
    },
    {
      "name": "version",
      "type": "string",
      "required": true,
      "description": "version for this application."
    },
    {
      "name": "name",
      "type": "string",
      "required": true,
      "description": "name for this application."
    },
    {
      "name": "summary",
      "type": "string",
      "required": false,
      "description": "summary for this application."
    },
    {
      "name": "namespace",
      "type": "string",
      "required": true,
      "description": "namespace for this application."
    },
    {
      "name": "goals",
      "type": "array",
      "required": false,
      "description": "goals for this application."
    },
    {
      "name": "actors",
      "type": "array",
      "required": false,
      "description": "actors for this application."
    },
    {
      "name": "notes",
      "type": "array",
      "required": false,
      "description": "notes for this application."
    },
    {
      "name": "typeRef",
      "type": "string",
      "required": true,
      "description": "Core type for this instance."
    },
    {
      "name": "typeVersion",
      "type": "string",
      "required": true,
      "description": "Exact version of the Core type."
    },
    {
      "name": "nonGoals",
      "type": "array",
      "required": false,
      "description": "nonGoals for this application."
    },
    {
      "name": "capabilities",
      "type": "array",
      "required": false,
      "description": "Versioned capabilities offered by the application."
    },
    {
      "name": "members",
      "type": "array",
      "required": false,
      "description": "Other versioned applications or packages included in the application."
    }
  ],
  "metadata": {
    "normative": {
      "typeRef": "okham.standards.type.normative.profile",
      "standard": "BCP14",
      "requirements": []
    },
    "replacesFormat": "OAP"
  },
  "schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Application",
    "description": "Identifies an application, its namespace and the versioned capabilities it offers.",
    "type": "object",
    "required": [
      "typeRef",
      "typeVersion",
      "id",
      "version",
      "name",
      "namespace"
    ],
    "properties": {
      "id": {
        "type": "string"
      },
      "version": {
        "type": "string",
        "pattern": "^\\d+\\.\\d+\\.\\d+$"
      },
      "name": {
        "type": "string"
      },
      "summary": {
        "type": "string"
      },
      "namespace": {
        "type": "string"
      },
      "goals": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "actors": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "description": {
              "type": "string"
            }
          },
          "additionalProperties": true
        }
      },
      "notes": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "typeRef": {
        "type": "string",
        "const": "okham.core.type.application",
        "description": "Core type for this instance."
      },
      "typeVersion": {
        "type": "string",
        "const": "0.1.0",
        "description": "Exact version of the Core type."
      },
      "nonGoals": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "capabilities": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "id",
            "version"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "uniqueItems": true,
        "description": "Versioned capabilities offered by the application."
      },
      "members": {
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "object",
          "required": [
            "id",
            "version"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "description": "Other versioned applications or packages included in the application."
      }
    },
    "additionalProperties": true
  }
}
