{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cesnet/json-schema/cesnet-perun-principal-schema.json",
  "title": "PerunPrincipal",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cesnet-authzresolver-api-openapi.yml#/components/schemas/PerunPrincipal",
  "type": "object",
  "required": [
    "userId",
    "user"
  ],
  "properties": {
    "actor": {
      "type": "string"
    },
    "extSourceName": {
      "type": "string"
    },
    "extSourceType": {
      "type": "string"
    },
    "extSourceLoa": {
      "type": "integer"
    },
    "user": {
      "$ref": "#/$defs/User"
    },
    "authzInitialized": {
      "type": "boolean"
    },
    "additionalInformations": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "userId": {
      "type": "integer"
    },
    "roles": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    }
  },
  "$defs": {
    "Auditable": {
      "description": "represents audit information",
      "allOf": [
        {
          "$ref": "#/$defs/PerunBean"
        }
      ],
      "properties": {
        "createdAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "modifiedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "modifiedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdByUid": {
          "type": [
            "integer",
            "null"
          ]
        },
        "modifiedByUid": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "PerunBean": {
      "description": "identifiable entity in Perun, common ancestor of all entity classes",
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "beanName": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "beanName"
      ]
    },
    "User": {
      "description": "represents user as a physical person",
      "allOf": [
        {
          "$ref": "#/$defs/Auditable"
        }
      ],
      "properties": {
        "firstName": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ]
        },
        "middleName": {
          "type": [
            "string",
            "null"
          ]
        },
        "titleBefore": {
          "type": [
            "string",
            "null"
          ]
        },
        "titleAfter": {
          "type": [
            "string",
            "null"
          ]
        },
        "serviceUser": {
          "type": "boolean"
        },
        "sponsoredUser": {
          "type": "boolean"
        },
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "specificUser": {
          "type": "boolean"
        },
        "majorSpecificType": {
          "type": "string"
        }
      }
    }
  }
}