{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/folio/json-schema/folio-internal-contact-schema.json",
  "title": "InternalContact",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-contacts-api-openapi.yml#/components/schemas/InternalContact",
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "owner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        }
      },
      "readOnly": true,
      "description": "License that owns the contact"
    },
    "user": {
      "type": "string",
      "format": "uuid"
    },
    "role": {
      "description": "The contact's role in relation to the license",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/RefData"
        }
      ]
    }
  },
  "$defs": {
    "RefData": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "readOnly": true
        },
        "label": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "owner": {
          "$ref": "#/$defs/RefDataCategory"
        }
      }
    },
    "RefDataCategory": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "readOnly": true
        },
        "internal": {
          "type": "boolean"
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RefData"
          }
        }
      }
    }
  }
}