Skip to content

Commit e172766

Browse files
committed
feat: add otherIdentifiers to Dandiset model
1 parent cabfa3d commit e172766

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

dandischema/models.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
PUBLISHED_VERSION_URL_PATTERN = (
101101
rf"^{DANDI_INSTANCE_URL_PATTERN}/dandiset/{VERSION_PATTERN}$"
102102
)
103+
DANDISET_IDENTIFIER_PATTERN = rf"^{ID_PATTERN}:\d{{6}}$"
103104
MD5_PATTERN = r"[0-9a-f]{32}"
104105
SHA256_PATTERN = r"[0-9a-f]{64}"
105106

@@ -1674,9 +1675,24 @@ def contributor_musthave_contact(
16741675
identifier: DANDI = Field(
16751676
title="Dandiset identifier",
16761677
description="A Dandiset identifier that can be resolved by identifiers.org.",
1677-
pattern=rf"^{ID_PATTERN}:\d{{6}}$",
1678+
pattern=DANDISET_IDENTIFIER_PATTERN,
16781679
json_schema_extra={"readOnly": True, "nskey": "schema"},
16791680
)
1681+
1682+
otherIdentifiers: Annotated[
1683+
list[Annotated[str, StringConstraints(pattern=DANDISET_IDENTIFIER_PATTERN)]],
1684+
Field(
1685+
default_factory=list,
1686+
title="Other Dandiset identifiers",
1687+
description="Other Dandiset identifiers as the Dandiset "
1688+
"resides in different DANDI instances.",
1689+
json_schema_extra={
1690+
"readOnly": True,
1691+
"nskey": "schema",
1692+
},
1693+
),
1694+
]
1695+
16801696
name: str = Field(
16811697
title="Dandiset title",
16821698
description="A title associated with the Dandiset.",

0 commit comments

Comments
 (0)