Unify and manage your data

Structural validation messages for materialized hierarchy

Learn more about structural validation violation messages for materialized hierarchies.

Hierarchy read APIs can return a validationViolations array for an object that violates the structural rules configured for its hierarchy type. Each array item describes a violation of a parent, child, or child-cardinality rule.

For information about configuring these rules, see Configure tenant business settings for hierarchy.

Message templates

The following table lists each validation message template with the reason and condition that produce it.

ReasonConditionMessage template
Entity type cannot be a childThe entity type has canBeChild: false.entity type {entityType} is not allowed to act as a child under hierarchy type {hierarchyTypeUri}
Entity type cannot be a parentThe entity type has canBeParent: false.entity type {entityType} is not allowed to act as a parent under hierarchy type {hierarchyTypeUri}
Child type is not allowedA parent has one or more children of a type whose cardinality is 0.parent has {count} children of type {childType}, when it's not allowed to have any
Too many children for an at-most-one ruleA parent has more than one child of a type whose cardinality is 1-.parent has multiple children of type {childType}, when it's allowed to have only 1
Too many children for an exactly-one ruleA parent has more than one child of a type whose cardinality is 1.parent has multiple children of type {childType}, when it's allowed to have only 1
Missing child for an exactly-one ruleA parent has no children of a type whose cardinality is 1.parent has no children of type {childType}, when exactly 1 is required
Missing child for an at-least-one ruleA parent has no children of a type whose cardinality is 1+.parent has no children of type {childType}, when at least 1 is required

Message placeholders

The following placeholders in the message templates are replaced with values from the violation.

PlaceholderDescription
{entityType}Entity type that isn't permitted to be a parent or child.
{hierarchyTypeUri} URI of the hierarchy type associated with the violated rule.
{count}Number of children found for a parent-child type pairing that isn't allowed.
{childType}Entity type of the children involved in the cardinality violation.