{ "$schema":                    "https://json-schema.org/draft/2020-12/schema",
  "$id":                        "https://schemas.mpai.community/AIH1/V1.1/data/Register.json",
  "title":                      "Register V1.1",
  "description":                "Schema for user registration.",
  "type":                       "object",
  "additionalProperties":       false,
  "required":                   [ "Header", "RegisterID", "RegisterTime", "RegisterData" ],
  "properties":                 {

    "Header":                   { "type": "string", "const": "AIH-REG-V1.1" },
    "MInstanceID":              { "type": "string" },
    "UEnvironmentID":           { "type": "string" },
    "RegisterID":               { "type": "string", "description": "Unique registration identifier." },
    "RegisterTime":             { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/Time.json" },

    "RegisterData":             { "type": "array", "items": { "oneOf": [

                                { "type": "object", "required": [ "Request" ], "additionalProperties": false, "properties": {
      "Request":                { "type": "object", "required": [ "UserProfile", "RequestedServices" ],
                                  "additionalProperties": false, "properties": {
        "UserProfile":          { "$ref": "https://schemas.mpai.community/AIH1/V1.1/data/UserProfile.json" },
        "RequestedServices":    { "type": "array", "minItems": 1, "items": { "type": "object",
                                  "required": [ "Service" ], "additionalProperties": false, "properties": {
          "Service":            { "$ref": "https://schemas.mpai.community/AIH1/V1.1/data/ProcessTypes.json" } } } } } } } },

                                { "type": "object", "required": [ "Response" ], "additionalProperties": false, "properties": {
      "Response":               { "type": "object", "description": "Response details.",
                                  "required": [ "Success" ], "additionalProperties": false, "properties": {
        "Success":              { "type": "boolean" },
        "Tokens":               { "$ref": "https://schemas.mpai.community/AIH1/V1.1/data/Tokens.json" } } } } } ] } },

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

