From 00049ef86f20aa8f6134620ed4881cc31de685f1 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Fri, 31 Mar 2023 18:01:22 +0200 Subject: [PATCH] Make serialized workflow compatible with schema 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 6feb22de..cd607ff3 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) { @@ -182,9 +167,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()) {