Fix models elements min length#194
Conversation
| description: Optional[str] = None | ||
| ai_context: Optional[OSIAIContext] = None | ||
| datasets: list[OSIDataset] | ||
| datasets: list[OSIDataset] = Field(..., min_length=1) |
There was a problem hiding this comment.
Can we leave datasets empty?
There was a problem hiding this comment.
From the spec, it should be min 1. Any reason to keep it empty?
There was a problem hiding this comment.
Will we reserve some empty datasets? I'm not entirely sure, but if you're sure about this, I think it's fine.
There was a problem hiding this comment.
Per the JSON schema (https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json#L302), datasets has "minItems": 1. A semantic model with no datasets is meaningless. Also, as models are frozen, so we can't do incremental build case as well. I think keep the min of 1 here is more semantic correct as the spec itself doesn't allow empty.
Looking at https://github.com/apache/ossie/blob/main/core-spec/osi-schema.json,
from_columns,to_columns, anddatasetsshould not allow empty list (which is the current behavior) as their min is1based on the spec: