Open nesnoj opened 2 years ago
* Optional keys do not seem to be checked, a warning would be helpful [Missing Parser Warning for Missing Keys #35](https://github.com/OpenEnergyPlatform/omi/issues/35)
Added check for optional fields, which will raise a warning if missing
* If there's an error (more precise: some format problem, e.g. mandatory key is missing) while processing, OMI immediately stops e.g. stating `omi.dialects.base.parser.ParserException: metadata string does not contain an id`. In my opinion it'd be better to parse the entire metadata and give a list of errors/warnings, otherwise one might end up in a trial-and-error odyssey.
Currently, there are four validation steps:
If there is an error in one of this steps, validation will stop an throw an error - I don't see how this can be changed (if JSON cannot be read, you don't get a dict, you cannot go on...). BUT, I think JSONschema bundles its error messages, so at least you will have a single error for all schema violations. So I think you will have to live, with some stages of error and no one error-message for all issues in your metadata file...
* Lacking details where error is located: e.g. if there's a malformed string OMI prints `dateutil.parser._parser.ParserError: String does not contain a date:`. Pardon, which field?
I think JSONschema gives more meaningful error messages...
We use the OMI tool in eGon-data to check the metadata. It is quite helpful but lacks some speaking output:
omi.dialects.base.parser.ParserException: metadata string does not contain an id
. In my opinion it'd be better to parse the entire metadata and give a list of errors/warnings, otherwise one might end up in a trial-and-error odyssey.dateutil.parser._parser.ParserError: String does not contain a date:
. Pardon, which field?