module Lutaml::Model::Serialize::ClassMethods

def apply_child_mappings(hash, child_mappings)

def apply_child_mappings(hash, child_mappings)
  return hash unless child_mappings
  hash.map do |key, value|
    child_mappings.to_h do |attr_name, path|
      attr_value = if path == :key
                     key
                   elsif path == :value
                     value
                   else
                     path = [path] unless path.is_a?(Array)
                     value.dig(*path.map(&:to_s))
                   end
      [attr_name, attr_value]
    end
  end
end