diff --git a/core/src/main/java/io/kestra/core/models/Label.java b/core/src/main/java/io/kestra/core/models/Label.java new file mode 100644 index 00000000000..290c2631da1 --- /dev/null +++ b/core/src/main/java/io/kestra/core/models/Label.java @@ -0,0 +1,3 @@ +package io.kestra.core.models; + +public record Label(String key, String value) {} diff --git a/core/src/main/java/io/kestra/core/models/executions/Execution.java b/core/src/main/java/io/kestra/core/models/executions/Execution.java index f1a933a55ca..caa744509f9 100644 --- a/core/src/main/java/io/kestra/core/models/executions/Execution.java +++ b/core/src/main/java/io/kestra/core/models/executions/Execution.java @@ -5,8 +5,13 @@ import ch.qos.logback.classic.spi.ThrowableProxy; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Streams; +import io.kestra.core.models.Label; +import io.kestra.core.serializers.ListOrMapOfLabelDeserializer; +import io.kestra.core.serializers.ListOrMapOfLabelSerializer; import lombok.Builder; import lombok.Value; import lombok.With; @@ -53,7 +58,9 @@ public class Execution implements DeletedInterface { Map inputs; @With - Map labels; + @JsonSerialize(using = ListOrMapOfLabelSerializer.class) + @JsonDeserialize(using = ListOrMapOfLabelDeserializer.class) + List