{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/folio/main/json-schema/folio-mapping-profile-schema.json",
  "title": "mappingProfile",
  "description": "Mapping Profile schema",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-mod-data-export-openapi.yml#/components/schemas/mappingProfile",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "description": "Mapping Profile name",
      "type": "string"
    },
    "default": {
      "description": "Is default mapping profile",
      "type": "boolean",
      "default": false,
      "readonly": true
    },
    "description": {
      "description": "Mapping Profile description",
      "type": "string"
    },
    "recordTypes": {
      "description": "Mapping Profile records type",
      "type": "array",
      "items": {
        "type": "string",
        "$ref": "#/$defs/recordTypes"
      }
    },
    "transformations": {
      "description": "List of mapping profile transformations",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "#/$defs/transformations"
      }
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Mapping Profile",
      "type": "object",
      "$ref": "#/$defs/userInfo"
    },
    "outputFormat": {
      "description": "Mapping Profile output format",
      "type": "string",
      "enum": [
        "MARC",
        "LINKED_DATA"
      ]
    },
    "fieldsSuppression": {
      "description": "Fields to suppress",
      "type": "string"
    },
    "suppress999ff": {
      "description": "Supress 999 field rule",
      "type": "boolean",
      "default": false
    },
    "locked": {
      "description": "True if locked, false if unlocked",
      "type": "boolean",
      "default": false
    },
    "lockedBy": {
      "description": "UUID of the user who locked the mapping profile",
      "type": "string",
      "format": "uuid"
    },
    "lockedAt": {
      "description": "Date and time when mapping profile was locked",
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "#/$defs/metadata",
      "readonly": true
    }
  },
  "required": [
    "name",
    "recordTypes"
  ],
  "$defs": {
    "metadata": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    },
    "recordTypes": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Enum of entity (record) types",
      "type": "string",
      "additionalProperties": false,
      "enum": [
        "INSTANCE",
        "HOLDINGS",
        "ITEM",
        "AUTHORITY",
        "SRS",
        "LINKED_DATA"
      ]
    },
    "transformations": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Mapping transformations detail",
      "type": "object",
      "javaType": "org.folio.rest.jaxrs.model.Transformations",
      "additionalProperties": false,
      "properties": {
        "fieldId": {
          "description": "Field identifier",
          "type": "string"
        },
        "path": {
          "description": "JSON path to set mapped value",
          "type": "string"
        },
        "enabled": {
          "description": "Indicates whether field should be mapped",
          "type": "boolean",
          "default": false
        },
        "transformation": {
          "description": "Mapping expression",
          "type": "string"
        },
        "recordType": {
          "description": "Mapping Profile type",
          "type": "string",
          "$ref": "#/$defs/recordTypes"
        },
        "metadataParameters": {
          "description": "Additional parameters used for mapping",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": [
        "fieldId",
        "recordType"
      ]
    },
    "userInfo": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "User information",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "firstName": {
          "description": "User first name",
          "type": "string"
        },
        "lastName": {
          "description": "User last name",
          "type": "string"
        },
        "userName": {
          "description": "User name (nickname)",
          "type": "string"
        }
      }
    }
  }
}