{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-content-fragment-references-schema.json",
  "title": "ContentFragmentReferences",
  "description": "A representation of a Content Fragment.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-aem-content-fragments-delivery-openapi.yml#/components/schemas/ContentFragmentReferences",
  "type": "object",
  "properties": {
    "referencesTree": {
      "description": "The recursive hierarchical tree representing the references of a Content Fragment.\nThe elements of the tree will contain only the `fieldName` where the reference is found, the `identifier`\nof the reference and the complete `referencesTree` of the reference, if that is the case.\nThe first level will contain the fields of the Content Fragment.\nThe `referencesTree` will always be present, but can be empty in the following cases:\n  - the referenced Content Fragment doesn't contain any child references\n  - the only references the fragment has are of type `asset`, `page` or `tag`.\n",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReferencesTreeItem"
      }
    },
    "references": {
      "description": "Provides the details of the references found in the `referencesTree` as a flat list.\nEach reference can be be accessed by its `identifier` from the `referencesTree`.\nThe level of hydration will depend on the `references` request parameter.\n",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/BaseReference"
      }
    },
    "modelReferences": {
      "description": "Provides the details of the models used in the response as a flat list.\nEach model can be be accessed by its `identifier` found in each content fragment.\n",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ContentFragmentModelReference"
      }
    }
  },
  "required": [
    "referencesTree",
    "references",
    "modelReferences"
  ],
  "$defs": {
    "Base64URLId": {
      "type": "string",
      "minLength": 1,
      "description": "The `base64url` encoded representation of the resource path.\n\nThis should be encoded using base64url (URL-safe base64), without padding (no `=` at the end), and using `-`\nand `_` instead of `+` and `/`.\n",
      "pattern": "^[A-Za-z0-9_-]+$"
    },
    "BaseReference": {
      "type": "object",
      "description": "An information about referenced assets.",
      "properties": {
        "type": {
          "description": "Type of referenced object",
          "type": "string",
          "enum": [
            "content-fragment",
            "asset",
            "page",
            "tag"
          ]
        }
      },
      "required": [
        "type"
      ]
    },
    "ContentFragmentModelPath": {
      "type": "string",
      "minLength": 1,
      "description": "A valid path to a Content Fragment Model resource.",
      "pattern": "^\\/conf(\\/.*)?$"
    },
    "ContentFragmentModelReference": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Base64URLId"
        },
        "path": {
          "$ref": "#/$defs/ContentFragmentModelPath",
          "description": "The path where this model is currently stored.X"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "description": "The title of the Content Fragment Model."
        },
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "type": {
                "$ref": "#/$defs/DataType"
              }
            }
          }
        }
      },
      "required": [
        "id",
        "path",
        "title"
      ]
    },
    "DataType": {
      "type": "string",
      "description": "Type of data stored in the field.",
      "enum": [
        "text",
        "long-text",
        "number",
        "float-number",
        "date-time",
        "date",
        "time",
        "boolean",
        "enumeration",
        "tag",
        "content-fragment",
        "content-reference",
        "json"
      ]
    },
    "ReferencesTreeItem": {
      "type": "object",
      "properties": {
        "fieldName": {
          "description": "Name of the field that contains the reference.",
          "type": "string"
        },
        "identifier": {
          "description": "Identifier of the reference resource. Can be a UUID (Content Fragments), URN (Assets) or Path (Tag, Page, Experience Fragment).",
          "type": "string"
        },
        "referencesTree": {
          "description": "List of child references for the current resource.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReferencesTreeItem"
          }
        }
      }
    }
  }
}