From 19dbf065516860b93153c9d262d1490d1a06f8b7 Mon Sep 17 00:00:00 2001 From: Matteo Saloni Date: Wed, 12 Feb 2025 15:37:17 +0100 Subject: [PATCH] feat: add init_parameters to python run spec --- .../runtime/python/specs/PythonRunSpec.java | 5 +++++ schemas/specs/run/python+run.json | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/specs/PythonRunSpec.java b/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/specs/PythonRunSpec.java index e6b9879a..220a8fec 100644 --- a/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/specs/PythonRunSpec.java +++ b/modules/runtime-python/src/main/java/it/smartcommunitylabdhub/runtime/python/specs/PythonRunSpec.java @@ -1,5 +1,6 @@ package it.smartcommunitylabdhub.runtime.python.specs; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; import it.smartcommunitylabdhub.commons.annotations.common.SpecType; import it.smartcommunitylabdhub.commons.jackson.annotations.JsonSchemaIgnore; @@ -41,6 +42,9 @@ public class PythonRunSpec extends RunBaseSpec { private Map parameters = new HashMap<>(); + @JsonProperty("init_parameters") + private Map initParameters = new HashMap<>(); + public PythonRunSpec(Map data) { configure(data); } @@ -59,6 +63,7 @@ public void configure(Map data) { this.inputs = spec.getInputs(); // this.outputs = spec.getOutputs(); this.parameters = spec.getParameters(); + this.initParameters = spec.getInitParameters(); } public void setTaskJobSpec(PythonJobTaskSpec taskJobSpec) { diff --git a/schemas/specs/run/python+run.json b/schemas/specs/run/python+run.json index 4af05800..98e12369 100644 --- a/schemas/specs/run/python+run.json +++ b/schemas/specs/run/python+run.json @@ -479,6 +479,16 @@ }, "type" : "object", "properties" : { + "init_parameters" : { + "$ref" : "#/$defs/Map_String.Serializable_", + "title" : "fields.initParameters.title", + "description" : "fields.initParameters.description", + "additionalProperties" : { + "$ref" : "#/$defs/Serializable", + "title" : "fields.initParameters.item.title", + "description" : "fields.initParameters.item.description" + } + }, "inputs" : { "$ref" : "#/$defs/Map_String.String_", "title" : "fields.inputs.title",