Skip to content

Commit

Permalink
Make serialized workflow compatible with schema (serverlessworkflow#224)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
  • Loading branch information
fjtirado authored and ricardozanini committed Jul 4, 2023
1 parent f87a94b commit df6725d
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand Down

0 comments on commit df6725d

Please sign in to comment.