Giter Site home page Giter Site logo

Comments (1)

henhuy avatar henhuy commented on September 6, 2024 1
* 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:

  • Parse metadata from JSON string
  • Check metadata based on JSONschema
  • Check license
  • Check optional fields (only warnings, no errors)

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...

from omi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.