Resolving Conflicts and Merge Inconsistencies
You must resolve any merge conflicts or merge inconsistencies when adding object types to the unified schema.
Resolve Conflicts Between Object Types
When adding types to your unified schema you must make sure that none of the types that you are adding create a conflict with the existing types in your unified schema.
When you add an API schema that has a type name that already exists within your unified schema, Anypoint DataGraph raises an error. You must resolve this error before continuing.
If you don’t care about adding this particular type to the unified schema, you can choose to hide the field.
If you want to add this conflicting type to the unified schema you must either:
-
Hide the type or query method
See Schema Element Visibility in Anypoint DataGraph for more information. -
Rename your type to avoid conflicting names
See Editing Names of Schema Elements for more information. -
Merge your new type with the existing type of the same name
See How Object Type Merges Work in Anypoint DataGraph for more information.
Resolve Merge Inconsistencies
Resolve inconsistencies and other issues across object types and fields before merging. The following is a list provides example issues:
-
You can’t change the visibility of a common field after a merge if visibility is not the same in both types.
If you merge two object types that contain a common field, and the common field is hidden on ObjectType1 but is visible on ObjectType2, you can’t change the visibility of the common field after a merge. Instead, you’ll need to split the object types, change the field settings and merge them again.
-
You can’t merge object types if the target type is not current.
If you try to merge an object type with an object type in the unified schema while another user is updating the unified schema, the merge will fail and DataGraph won’t apply your changes. You’ll need to cancel the merge, update your local version of the unified schema, and redo the merge.
-
You can’t change the visibility of the only remaining field for a type after a merge.
If you merge two object types, each with two unique visible fields—ObjectType1 contains FieldA and FieldB; ObjectType2 contains FieldC and FieldD—and you hide FieldA and then merge the object types, you can’t later change the visibility on FieldB without breaking the merge since FieldB is the only remaining visible field from ObjectType1. Instead, you’ll need to split or undo the merge, change the field settings, and merge them again.
-
Unhiding an object type with a duplicate name will create a conflict.
If there is a hidden object type in your local API schema that has the same name as another object type in the unified schema or in the same schema, unhiding that object type will raise a conflict. You’ll have to rename the object type or merge it with the object type with the same name after unhiding it.
-
Hiding a type that you’ve merged will undo the merge.
If you merge object types in the unified schema, and then hide either of the contributing types, the object types will no longer be merged. You will have to make the hidden object type visible and merge them again.