From df6725d7622e1be367709464f39867f5079d7959 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Thu, 25 May 2023 23:36:37 +0200 Subject: [PATCH] Make serialized workflow compatible with schema (#224) Signed-off-by: Francisco Javier Tirado Sarti --- .../api/serializers/WorkflowSerializer.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java b/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java index 67e6af86..7fd83c76 100644 --- a/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java +++ b/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java @@ -110,9 +110,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeObject(eventDefinition); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("events"); - gen.writeEndArray(); } if (workflow.getFunctions() != null && !workflow.getFunctions().getFunctionDefs().isEmpty()) { @@ -121,9 +118,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeObject(function); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("functions"); - gen.writeEndArray(); } if (workflow.getRetries() != null && !workflow.getRetries().getRetryDefs().isEmpty()) { @@ -132,9 +126,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeObject(retry); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("retries"); - gen.writeEndArray(); } if (workflow.getErrors() != null && !workflow.getErrors().getErrorDefs().isEmpty()) { @@ -143,9 +134,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeObject(error); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("errors"); - gen.writeEndArray(); } if (workflow.getSecrets() != null && !workflow.getSecrets().getSecretDefs().isEmpty()) { @@ -154,9 +142,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeString(secretDef); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("secrets"); - gen.writeEndArray(); } if (workflow.getConstants() != null && !workflow.getConstants().getConstantsDef().isEmpty()) { @@ -177,9 +162,6 @@ public void serialize(Workflow workflow, JsonGenerator gen, SerializerProvider p gen.writeObject(state); } gen.writeEndArray(); - } else { - gen.writeArrayFieldStart("states"); - gen.writeEndArray(); } if (workflow.getExtensions() != null && !workflow.getExtensions().isEmpty()) {