diff --git a/dandischema/models.py b/dandischema/models.py index 20af619..e8ac37c 100644 --- a/dandischema/models.py +++ b/dandischema/models.py @@ -604,7 +604,7 @@ class PropertyValue(DandiBaseModel): maxValue: Optional[float] = Field(None, json_schema_extra={"nskey": "schema"}) minValue: Optional[float] = Field(None, json_schema_extra={"nskey": "schema"}) unitText: Optional[str] = Field(None, json_schema_extra={"nskey": "schema"}) - value: Union[Any, List[Any]] = Field( + value: Any = Field( None, validate_default=True, json_schema_extra={"nskey": "schema"}, @@ -626,7 +626,7 @@ class PropertyValue(DandiBaseModel): @field_validator("value") @classmethod - def ensure_value(cls, val: Union[Any, List[Any]]) -> Union[Any, List[Any]]: + def ensure_value(cls, val: Any) -> Any: if not val: raise ValueError( "The value field of a PropertyValue cannot be None or empty." @@ -1262,7 +1262,7 @@ class PublishActivity(Activity): class Locus(DandiBaseModel): - identifier: Union[Identifier, List[Identifier]] = Field( + identifier: Identifier = Field( description="Identifier for genotyping locus.", json_schema_extra={"nskey": "schema"}, ) @@ -1274,7 +1274,7 @@ class Locus(DandiBaseModel): class Allele(DandiBaseModel): - identifier: Union[Identifier, List[Identifier]] = Field( + identifier: Identifier = Field( description="Identifier for genotyping allele.", json_schema_extra={"nskey": "schema"}, ) @@ -1373,7 +1373,7 @@ class Participant(DandiBaseModel): "available. (e.g. from OBI)", json_schema_extra={"nskey": "dandi"}, ) - genotype: Optional[Union[List[GenotypeInfo], Identifier]] = Field( + genotype: Optional[Union[GenotypeInfo, Identifier]] = Field( None, description="Genotype descriptor of participant or subject if available", json_schema_extra={"nskey": "dandi"},