oemetadata icon indicating copy to clipboard operation
oemetadata copied to clipboard

Json schema does not specify any mandatory fields

Open MGlauer opened this issue 5 years ago • 10 comments

I noticed that the json-schema does not specify any field as required despite json schema supporting such information. This is already inconsistent with how OMI and other tools implement this specification - e.g. id is often required. There are also probably some mandatory fields in resources as discussed in OMI

This is probably something that should be changed to make tools more consistent.

MGlauer avatar Aug 27 '20 13:08 MGlauer

@christian-rli This issue is still there. Are there plans to fix this?

MGlauer avatar Dec 21 '20 14:12 MGlauer

This will be considered in the next minor version.

Ludee avatar Jan 18 '21 14:01 Ludee

Is this done in the open PR? https://github.com/OpenEnergyPlatform/oemetadata/pull/43

Ludee avatar Nov 17 '21 09:11 Ludee

@Ludee @wingechr @christian-rli I think the issue is not solved with #43. We should determine which fields are considered required e.g. by omi and then mark them accordingly in schema.json.

jh-RLI avatar Nov 18 '21 11:11 jh-RLI

@Ludee Do we want to add this to v1.5.1? If so, we would need to work out a definition of which fields are mandatory.

jh-RLI avatar Feb 15 '22 10:02 jh-RLI

Yes, that would be great. I would go with a bare minimum:

  • name
  • title
  • description
  • contributors

Ludee avatar Feb 15 '22 11:02 Ludee

This issue will be solved by the new badge system developed by @steull All fields from the iron badge must be mandatory! Please link and document here.

Ludee avatar Nov 17 '22 08:11 Ludee

We can add the mandatory fields from the bages via the required keyword to the json schema https://json-schema.org/understanding-json-schema/reference/object.html#required-properties

jh-RLI avatar Nov 17 '22 10:11 jh-RLI

Here is an overview of all mandatory fields:

name resources - name resources - schema - fields - name resources - schema - fields - type resources - schema - primaryKey resources - schema - foreignKeys - fields resources - schema - foreignKeys - reference - resource resources - schema - foreignKeys - reference - fields

steull avatar Nov 18 '22 14:11 steull

@Ludee I got no time to include this in the v1.5.2 release as this might trigger more updates in other repos we can do another v1.5.3 release next week if needed.

jh-RLI avatar Nov 18 '22 15:11 jh-RLI