Skip to content

Commit

Permalink
Merge pull request #334 from dandi/rf-anyurl
Browse files Browse the repository at this point in the history
[DATALAD RUNCMD] Swap order of str and AnyUrl to be from specific to generic
  • Loading branch information
satra authored Jan 21, 2021
2 parents 21b7c84 + 98b0719 commit fe3b74e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dandi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def schema_extra(schema: Dict[str, Any]) -> None:
class PropertyValue(DandiBaseModel):
maxValue: float = Field(None, nskey="schema")
minValue: float = Field(None, nskey="schema")
unitCode: Union[str, AnyUrl] = Field(None, nskey="schema")
unitCode: Union[AnyUrl, str] = Field(None, nskey="schema")
unitText: str = Field(None, nskey="schema")
value: Union[str, bool, int, float, List[Union[str, bool, int, float]]] = Field(
None, nskey="schema"
Expand Down Expand Up @@ -305,7 +305,7 @@ class Resource(DandiBaseModel):
identifier: Identifier = Field(None, nskey="schema")
name: str = Field(None, nskey="schema")
url: str = Field(None, nskey="schema")
repository: Union[str, AnyUrl] = Field(
repository: Union[AnyUrl, str] = Field(
None,
description="An identifier of a repository in which the resource is housed",
nskey="dandi",
Expand Down Expand Up @@ -524,7 +524,7 @@ class CommonModel(DandiBaseModel):
description="The subject matter of the content, such as disorders, brain anatomy.",
nskey="schema",
)
studyTarget: Optional[List[Union[str, AnyUrl]]] = Field(
studyTarget: Optional[List[Union[AnyUrl, str]]] = Field(
None, description="What the study is related to", nskey="dandi"
)
license: List[LicenseType] = Field(description="License of item.", nskey="schema")
Expand Down Expand Up @@ -602,7 +602,7 @@ def check_data(cls, values):

# On publish
version: str = Field(readOnly=True, nskey="schema")
doi: Optional[Union[str, AnyUrl]] = Field(
doi: Optional[Union[AnyUrl, str]] = Field(
None, title="DOI", readOnly=True, nskey="dandi"
)

Expand Down Expand Up @@ -635,7 +635,7 @@ class AssetMeta(CommonModel):
)

contentSize: str = Field(nskey="schema")
encodingFormat: Union[str, AnyUrl] = Field(
encodingFormat: Union[AnyUrl, str] = Field(
title="File Encoding Format", nskey="schema"
)
digest: Digest = Field(nskey="dandi")
Expand Down

0 comments on commit fe3b74e

Please sign in to comment.