openkfw / Oscar

A digital decision support system for humanitarian operations
https://www.oscarplatform.org/
GNU General Public License v3.0
11 stars 1 forks source link

Validate config files in initial-data-load #133

Open bariela opened 2 years ago

bariela commented 2 years ago

Is your feature request related to a problem? Please describe. When loading config files in initial-data-load, we assume, the config is in correct format. If there is a misconfiguration, it is found later in process and does not indicate the real problem in error logs. Also it is better to stop service before attempting to store incorrect data in database.

Describe the solution you'd like After loading yaml files with configuration, run validation (joi?) before next step. If validation fails, log the problems, stop loading data from this file and set exit code to 1. The service should still load data from other config files.

Describe alternatives you've considered none considered yet

Additional context Create validation rules for config files based on documentation, sample config files, mongoDb schemas and other clues in code.