Skip to content

Commit

Permalink
solve the issue for mutually exclusive tags validation for PUT API (o…
Browse files Browse the repository at this point in the history
…pen-metadata#11428)

* solve the issue for mutually exclusive tags validation for PUT API

* checkstyle

---------

Co-authored-by: Himank Mehta <[email protected]>
  • Loading branch information
07Himank and Himank Mehta authored May 8, 2023
1 parent 2c9ba53 commit 9d61d63
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1453,14 +1453,15 @@ protected void updateTags(String fqn, String fieldName, List<TagLabel> origTags,
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<TagLabel> addedTags = new ArrayList<>();
List<TagLabel> deletedTags = new ArrayList<>();
recordListChange(fieldName, origTags, updatedTags, addedTags, deletedTags, tagLabelMatch);
Expand Down

0 comments on commit 9d61d63

Please sign in to comment.