Browse Source

Actually merge properties.

scossu 2 months ago
parent
commit
825a983db4
2 changed files with 5 additions and 5 deletions
  1. 2 3
      config/model/anything.yml
  2. 3 2
      model_parser.lua

+ 2 - 3
config/model/anything.yml

@@ -5,15 +5,14 @@ abstract: true
 
 
 properties:
 properties:
   "pas:id":
   "pas:id":
-    label: DRS ID
+    label: Primary ID
     type: string
     type: string
     min_cardinality: 1
     min_cardinality: 1
     max_cardinality: 1
     max_cardinality: 1
 
 
   "pas:refId":
   "pas:refId":
-    label: DRS ID
+    label: External system ID
     type: string
     type: string
-    max_cardinality: 1
 
 
   "pas:prefLabel":
   "pas:prefLabel":
     label: Preferred Label
     label: Preferred Label

+ 3 - 2
model_parser.lua

@@ -55,7 +55,9 @@ M.parse_model = function(mod_id)
         for k, v in pairs(src) do
         for k, v in pairs(src) do
             if NO_INHERIT[k] then goto continue end
             if NO_INHERIT[k] then goto continue end
             if type(v) == "table" then
             if type(v) == "table" then
-                merge(v, dest[k] or {})
+                dest[k] = dest[k] or {}
+                assert(type(dest[k]) == "table")
+                merge(v, dest[k])
             else
             else
                 dest[k] = v
                 dest[k] = v
             end
             end
@@ -65,7 +67,6 @@ M.parse_model = function(mod_id)
     local config = {}
     local config = {}
 
 
     for _, src_config in ipairs(hierarchy) do
     for _, src_config in ipairs(hierarchy) do
-        print("Merging:", src_config)
         merge(src_config, config)
         merge(src_config, config)
     end
     end