Skip to content

Commit 56ab11e

Browse files
committed
other way of fixing
1 parent ea8d3ce commit 56ab11e

File tree

1 file changed

+9
-4
lines changed
  • services/director-v2/src/simcore_service_director_v2/core

1 file changed

+9
-4
lines changed

services/director-v2/src/simcore_service_director_v2/core/settings.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
NoAuthentication,
1717
)
1818
from pydantic import (
19+
AfterValidator,
1920
AliasChoices,
2021
AnyHttpUrl,
2122
AnyUrl,
@@ -251,10 +252,14 @@ class AppSettings(BaseApplicationSettings, MixinLoggingSettings):
251252
description="resource usage tracker service client's plugin",
252253
)
253254

254-
DIRECTOR_V2_PUBLIC_API_BASE_URL: AnyHttpUrl = Field(
255-
...,
256-
description="Base URL used to access the public api e.g. http://127.0.0.1:6000 for development or https://api.osparc.io",
257-
)
255+
DIRECTOR_V2_PUBLIC_API_BASE_URL: Annotated[
256+
AnyHttpUrl | str,
257+
AfterValidator(lambda v: f"{v}".rstrip("/")),
258+
Field(
259+
...,
260+
description="Base URL used to access the public api e.g. http://127.0.0.1:6000 for development or https://api.osparc.io",
261+
),
262+
]
258263
DIRECTOR_V2_TRACING: TracingSettings | None = Field(
259264
json_schema_extra={"auto_default_from_env": True},
260265
description="settings for opentelemetry tracing",

0 commit comments

Comments
 (0)