Skip to content

Commit

Permalink
Fix metadata schema extends resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Jan 12, 2025
1 parent 2094b5c commit a41ed87
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ private List<MetadataSchemaVersion> resolveExtends(List<MetadataSchemaVersion> s
final Map<UUID, MetadataSchemaVersion> allSchemas = versionRepository
.findAllByState(MetadataSchemaState.LATEST)
.stream()
.collect(Collectors.toMap(MetadataSchemaVersion::getUuid, Function.identity()));
.collect(Collectors.toMap(MetadataSchemaVersion::extractSchemaUuid, Function.identity()));
final Set<UUID> addedSchemaUuids = new HashSet<>();
final List<MetadataSchemaVersion> result = new ArrayList<>();
schemas.forEach(schema -> {
addedSchemaUuids.add(schema.getUuid());
addedSchemaUuids.add(schema.extractSchemaUuid());
result.add(schema);
});
int index = 0;
Expand Down Expand Up @@ -585,7 +585,7 @@ public List<MetadataSchemaVersionDTO> importSchemas(List<MetadataSchemaVersionDT
.map(MetadataSchemaVersion::extractSchemaUuid)
.collect(Collectors.toSet());
// Create new metadata schemas (root object with matching UUID)
final List<MetadataSchema> newSchemas = schemaRepository.saveAllAndFlush(
schemaRepository.saveAllAndFlush(
reqDtos.stream()
.map(MetadataSchemaVersionDTO::getUuid)
.filter(uuid -> !toBePresentUuids.contains(uuid))
Expand Down

1 comment on commit a41ed87

@dennisvang
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MarekSuchanek , could you also link this to an issue, to provide some insight into the problem that is being fixed? Thanks again. :)

Please sign in to comment.