{ "$schema":                "https://json-schema.org/draft/2020-12/schema",
  "$id":                    "https://schemas.mpai.community/MAS/V1.1/data/AIMDescription.json",
  "title":                  "AIM Description V1.1",
  "type":                   "object",
  "required":               [ "Header", "Identifier", "Ports" ],
  "additionalProperties":   false,
  "properties":             {

    "Header":               { "type": "string", "const": "MAS-AID-V1.1", "description": "AIM Description Header." },

    "Identifier":           { "type": "object", "required": [ "ImplementerID", "ImplementationID", "AIM" ], "additionalProperties": false, "$anchor": "identifier", "properties": {
      "ImplementerID":      { "type": "string", "description": "Identifier assigned by IIDRA to the Implementer." },
      "ImplementationID":   { "type": "string", "description": "Identifier assigned by the Implementer to the Implementation, unique in the Implementer name space." },
      "AIM":                { "type": "string", "pattern": "^[A-Z0-9]{3,4}-[A-Z0-9]{3}-V\\d+\\.\\d+$", "description": "The AIM as defined by the Standard: its canonical acronym." },
      "Profile":            { "type": "string", "description": "Profile of the AIM as defined by the Standard, if present." } } },

    "APIProfile":           { "type": "string", "enum": [ "Basic", "Secure" ], "description": "AIF API Profile selected by the Implementer." },
    "Description":          { "type": "string", "description": "Free-text description of the AIM." },

    "Types":                { "type": "array", "description": "Channel data type shorthands.", "items": { "type": "object", "required": [ "Name", "Type" ], "additionalProperties": false, "properties": {
      "Name":               { "type": "string" },
      "Type":               { "type": "string" } } } },

    "Ports":                { "type": "array", "description": "The Ports through which the AIM communicates.", "items": { "type": "object", "required": [ "Name", "Direction", "RecordType", "Protocol" ], "additionalProperties": false, "properties": {
      "Name":               { "type": "string" },
      "Direction":          { "type": "string", "enum": [ "OutputInput", "InputOutput" ] },
      "RecordType":         { "type": "string" },
      "Protocol":           { "type": "string" },
      "Bout":               { "type": "boolean", "description": "Whether the Port may be given as a Bout (AIF-BOU-V3.0): an output Port by the SCI, an input Port by an RCA that holds an Instance Credential of the SCI (API 2.1)." } } } },

    "Documentation":        { "type": "array", "items": { "type": "object", "required": [ "Type", "URI" ], "additionalProperties": false, "properties": {
      "Type":               { "type": "string", "enum": [ "Specification", "Manual", "Tutorial", "Video" ] },
      "URI":                { "type": "string", "format": "uri" } } } },

    "DataXMData":           { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":        { "type": "string", "maxLength": 2048, "description": "Descriptive Metadata." } } }
