HumanBrainProject / openMINDS

openMINDS comprises a set of metadata models for research products in the field of neuroscience.
MIT License
40 stars 13 forks source link

handling minItems for non-required arrays #20

Closed lzehl closed 3 years ago

lzehl commented 3 years ago

I stumbled upon this issue again in a recent PR.

At one point we defined for required and non-required properties with value "type": "array" that they all would need to set "minItems": 1.

Initial argument for this decision: Setting "minItems": 1 prohibits the validation to go through with an empty array for the required properties as well as the optional properties, because if the values of the optional property are not known, the optional property should rather not be stated in the JSON-LD than stated with an empty array.

My question to @olinux @apdavison @jagru20 @UlrikeS91 @skoehnen @bweyers @Peyman-N: Should we follow this initial decision or should we reconsider this?

Peyman-N commented 3 years ago

Personally I think this is a good practice but if it is causing problem somewhere else I think we can mitigate it. But now I want to know where dose it cause problems?

lzehl commented 3 years ago

@Peyman-N you mean we should follow the initial decision?

For optional properties, both approaches (allowing empty arrays, or prohibiting empty arrays) would work from the technical point of view. @olinux: please correct me if I'm wrong.

Peyman-N commented 3 years ago

Yes, I think the initial decision was the correct one.

UlrikeS91 commented 3 years ago

I would stick to our original decision to add "minItems": 1 to all arrays.

jagru20 commented 3 years ago

This also makes sense to me to stick to it.

UlrikeS91 commented 3 years ago

This is solved. I close it.