Hiera does have a validate method in config.rb that is applied to the data structure loaded from `hiera.yaml`. Unfortunately, this validator currently only traps errors arising from missing the `deep_merge` gem.
Hiera assumes that the config file will follow a certain structure and will crash or misbehave in strange ways if this structure is not present. For example, the :backends: and :hierarchy: keys can be set to arrays or single strings. However, the `:datadir` key will misbehave in weird ways if set to anything other than a string: