From 9d61d63ce42879bdc0fa8a998f0864146bf1ca08 Mon Sep 17 00:00:00 2001 From: 07Himank <112613760+07Himank@users.noreply.github.com> Date: Mon, 8 May 2023 15:06:42 +0530 Subject: [PATCH] solve the issue for mutually exclusive tags validation for PUT API (#11428) * solve the issue for mutually exclusive tags validation for PUT API * checkstyle --------- Co-authored-by: Himank Mehta --- .../org/openmetadata/service/jdbi3/EntityRepository.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java index 6d9db7a00eb..22536b29533 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java @@ -1453,14 +1453,15 @@ public abstract class EntityRepository { return; // Nothing to update } - // Remove current entity tags in the database. It will be added back later from the merged tag list. - daoCollection.tagUsageDAO().deleteTagsByTarget(fqn); - if (operation.isPut()) { // PUT operation merges tags in the request with what already exists EntityUtil.mergeTags(updatedTags, origTags); + checkMutuallyExclusive(updatedTags); } + // Remove current entity tags in the database. It will be added back later from the merged tag list. + daoCollection.tagUsageDAO().deleteTagsByTarget(fqn); + List addedTags = new ArrayList<>(); List deletedTags = new ArrayList<>(); recordListChange(fieldName, origTags, updatedTags, addedTags, deletedTags, tagLabelMatch);