With more than one item in the external link field now (UCSC, IGVF), we might consider generalizing the external link type to include more information for the UI to display.
The item could look more similar to:
class ExternalLinkItem(BaseModel):
label: str = Field(..., description="Human-readable label for the link")
url: HttpUrl = Field(..., description="Absolute URL for the external resource")
source: Optional[str] = Field(None, description="Optional source/system for this link (e.g., IGVF, GEO)")
icon: Optional[str] = Field(None, description="Optional icon key for UI")
type: Optional[str] = Field(None, description="Optional tag to group/filter links")
@field_validator("label")
@classmethod
def _strip_label(cls, v: str) -> str:
v = v.strip()
if not v:
raise ValueError("label cannot be empty")
return v
This would allow the interface to write less dedicated code for each individual external link, increasing maintainability and reducing duplication.
With more than one item in the external link field now (UCSC, IGVF), we might consider generalizing the external link type to include more information for the UI to display.
The item could look more similar to:
This would allow the interface to write less dedicated code for each individual external link, increasing maintainability and reducing duplication.