SaveEntityMessage is missing in JSON schema when using Sitecore Content Hub 4.0.3 - 4.0.8


Description

When using triggers tied to actions of type Azure Service Bus and API call, a JSON message payload containing the changes that are made on the entity is prepared, and it gets pushed to the target endpoints respectively. For the affected versions referenced in this article, the schema of JSON serialized SaveEntityMessage payload has been altered, leading the integrations which are used to consume the former JSON schema to fail. The payload misses the wrapper JSON object saveEntityMessage, which was an immediate child to the root of the payload JSON.

The breaking change affects clients who use the Sitecore Content Hub 4.0.3 - 4.0.8 versions. The issue was fixed in Sitecore Content Hub 4.0.9.

Examples of the JSON payload

Example 1: Payload for any version of Sitecore Content Hub except for the affected versions

{
  "saveEntityMessage": {
    "EventType": "EntityCreated",
    "TimeStamp": "2021-08-11T11:25:30.776Z",
    "IsNew": true,
    "TargetDefinition": "M.Asset",
    "TargetId": 37622,
    "TargetIdentifier": "buP_hoTOJ0axEsthpS3f5A",
    "CreatedOn": "2021-08-11T11:25:30.7749908Z",
    "UserId": 6,
    "Version": 1,
    "ChangeSet": {
      "PropertyChanges": [
        {
          "Culture": "(Default)",
          "Property": "FileName",
          "Type": "System.String",
          "OriginalValue": null,
          "NewValue": "_S2.jpg"
        }
      ],
      "Cultures": [
        "(Default)"
      ],
      "RelationChanges": [
        {
          "Relation": "FinalLifeCycleStatusToAsset",
          "Role": 1,
          "Cardinality": 0,
          "NewValues": [
            542
          ],
          "RemovedValues": [],
          "inherits_security_original": null,
          "inherits_security": true
        }
      ],
      "inherits_security_original": null,
      "inherits_security": true,
      "is_root_taxonomy_item_original": null,
      "is_root_taxonomy_item": false,
      "is_path_root_original": null,
      "is_path_root": false,
      "is_system_owned_original": null,
      "is_system_owned": false
    }
  },
  "context": {}
}


Example 2: Payload for the affected versions

{
    "EventType": "EntityCreated",
    "TimeStamp": "2021-08-11T10:19:39.343Z",
    "IsNew": true,
    "TargetDefinition": "M.Asset",
    "TargetId": 30691,
    "TargetIdentifier": "aekwEDXbikav_N3e-ASNbA",
    "CreatedOn": "2021-08-11T10:19:39.342443Z",
    "UserId": 30417,
    "Version": 1,
    "ChangeSet":
    {
        "PropertyChanges":
        [
            {
                "Culture": "(Default)",
                "Property": "FileName",
                "Type": "System.String",
                "OriginalValue": null,
                "NewValue": "_S1-out.jpg"
            }
        ],
        "Cultures":
        [
            "(Default)"
        ],
        "RelationChanges":
        [
            {
                "Relation": "FinalLifeCycleStatusToAsset",
                "Role": 1,
                "Cardinality": 0,
                "NewValues":
                [
                    542
                ],
                "RemovedValues":
                [],
                "inherits_security_original": null,
                "inherits_security": true
            }
        ],
        "inherits_security_original": null,
        "inherits_security": true,
        "is_root_taxonomy_item_original": null,
        "is_root_taxonomy_item": false,
        "is_path_root_original": null,
        "is_path_root": false,
        "is_system_owned_original": null,
        "is_system_owned": false
    },
    "context":
    {}
}

Solution

To resolve the issue, consider the following options: