From 2e89940b44d4be1d115aed987b4c610ed7173d66 Mon Sep 17 00:00:00 2001
From: e-minguez <e.minguez@gmail.com>
Date: Tue, 2 Sep 2025 18:03:50 +0200
Subject: [PATCH] fix: Allow icon metadata to be file

Fix #34
---
 pyhelm3/models.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pyhelm3/models.py b/pyhelm3/models.py
index d03fdc6..adb2c88 100644
--- a/pyhelm3/models.py
+++ b/pyhelm3/models.py
@@ -14,6 +14,7 @@
     FilePath,
     AnyUrl as PydanticAnyUrl,
     HttpUrl as PydanticHttpUrl,
+    FileUrl as PydanticFileUrl,
     constr,
     field_validator
 )
@@ -65,6 +66,7 @@ def validate_str_as(validate_type):
 #: Annotated string types for URLs
 AnyUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticAnyUrl))]
 HttpUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticHttpUrl))]
+FileUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticFileUrl))]
 
 
 class ChartDependency(BaseModel):
@@ -173,7 +175,7 @@ class ChartMetadata(BaseModel):
         default_factory = list,
         description = "List of maintainers for the chart."
     )
-    icon: t.Optional[HttpUrl] = Field(
+    icon: t.Optional[HttpUrl | FileUrl] = Field(
         None,
         description = "URL to an SVG or PNG image to be used as an icon."
     )
