mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 03:46:10 +00:00
Patch response should sort the owners field (#17599)
This commit is contained in:
parent
19b5d49dc8
commit
94f0c1144e
@ -84,6 +84,7 @@ import java.time.format.DateTimeParseException;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -1981,6 +1982,12 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
||||
}
|
||||
// populate owner entityRefs with all fields
|
||||
List<EntityReference> refs = validateOwners(owners);
|
||||
if (nullOrEmpty(refs)) {
|
||||
return;
|
||||
}
|
||||
refs.sort(Comparator.comparing(EntityReference::getName));
|
||||
owners.sort(Comparator.comparing(EntityReference::getName));
|
||||
|
||||
for (int i = 0; i < owners.size(); i++) {
|
||||
EntityUtil.copy(refs.get(i), owners.get(i));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user