Accept config files without mappings as long as mappings are loaded in general
Change-Id: Ib16454b83c981aa0b93e46ee1bee15599deda027
diff --git a/config/config.go b/config/config.go
index e029c63..b44259b 100644
--- a/config/config.go
+++ b/config/config.go
@@ -64,8 +64,8 @@
}
// Try to unmarshal as new format first (object with optional sdk/server and lists)
- if err := yaml.Unmarshal(data, &globalConfig); err == nil && len(globalConfig.Lists) > 0 {
- // Successfully parsed as new format with lists field
+ if err := yaml.Unmarshal(data, &globalConfig); err == nil {
+ // Successfully parsed as new format - accept it regardless of whether it has lists
for _, list := range globalConfig.Lists {
if seenIDs[list.ID] {
return nil, fmt.Errorf("duplicate mapping list ID found: %s", list.ID)