Skip to content

Commit a5ec999

Browse files
validate compose_spec
1 parent 6df0170 commit a5ec999

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,10 @@ def from_service_inspect(
540540
def as_label_data(self) -> str:
541541
# compose_spec needs to be json encoded before encoding it to json
542542
# and storing it in the label
543-
return self.model_copy(
544-
update={"compose_spec": json.dumps(self.compose_spec)}, deep=True
543+
return self.model_validate(
544+
self.model_copy(
545+
update={"compose_spec": json.dumps(self.compose_spec)}, deep=True
546+
)
545547
).model_dump_json()
546548

547549
model_config = ConfigDict(extra="allow", populate_by_name=True)

0 commit comments

Comments
 (0)