From ea34bb1459bf249d1d68cd879b293a2cfae3d1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milio=20Gonzalez?= Date: Thu, 24 Oct 2024 15:45:58 -0400 Subject: [PATCH] Do not serialize TestApp.hardcoded_path if it has value None. Fixes #319. --- contentctl/objects/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contentctl/objects/config.py b/contentctl/objects/config.py index 9057a4c4..6f5ee070 100644 --- a/contentctl/objects/config.py +++ b/contentctl/objects/config.py @@ -65,7 +65,7 @@ class TestApp(App_Base): hardcoded_path: Optional[Union[FilePath,HttpUrl]] = Field(default=None, description="This may be a relative or absolute link to a file OR an HTTP URL linking to your app.") - @field_serializer('hardcoded_path',when_used='always') + @field_serializer('hardcoded_path',when_used='unless-none') def serialize_path(path: Union[AnyUrl, pathlib.Path])->str: return str(path)