Исправление генерирования ID для интерфейсов

This commit is contained in:
Ymnuk 2023-08-31 09:37:37 +03:00
parent ffab9e832e
commit 913fc3b80a
1 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,9 @@ func prepareInterfaces(project *structs.Project) *structs.Project {
continue
}
for j := range project.Interfaces[i].Fields {
if project.Interfaces[i].Fields[j].ID == uuid.Nil {
project.Interfaces[i].Fields[j].ID = uuid.NewV4()
}
project.Interfaces[i].Fields[j].Name = strings.Trim(project.Interfaces[i].Fields[j].Name, " ")
if project.Interfaces[i].Fields[j].Name == "" {
log.Fatalf("Field in interface %s should be set", project.Interfaces[i].Name)