RED-9375: fix component mapping endpoint validation

This commit is contained in:
Kilian Schuettler 2024-06-20 13:42:29 +02:00
parent 5dd27f682b
commit 1a585e9fe3

View File

@ -140,6 +140,10 @@ public class ComponentMappingService {
columnLabels = rows.remove(0); // remove header row
if (Arrays.stream(columnLabels).distinct().count() < columnLabels.length) {
throw new BadRequestException("Column labels may not contain duplicates!");
}
numberOfLines = (int) reader.getLinesRead() - 1; // subtract header row
rows.sort(CSV_SORTER);