Closed mfleader closed 3 months ago
Obviously there is a bug in the existing code. My question is whether this is the correct approach. An any schema defers input validation to after the schema validation steps. I'm going to investigate this.
The original error appears to be happening on the line
f.Set(v.Convert(f.Type()))
inside of the anonymous function in unserializeToStruct in ObjectSchema. To hit the problem case, create a breakpoint within the loop in that function to stop when key == "outputSchema"
For some reason, it's expecting a map with the value of interface{}
, but instead is getting *schema.StepOutputSchema
. It is getting the expected value from the field of the default value.
I experimented with changing the struct Workflow
field OutputSchema
's data type to map[string]*schema.StepOutputSchema
. When I did that, the data validation passed. But the error is now in Prepare in executor.go:
outputSchemaData, err := schema.DescribeStepOutput().Unserialize(workflow.OutputSchema[outputID])
Unexpected error: unable to decode workflow output schema success (Validation failed: Must be a map, *schema.StepOutputSchema given)
So this is worth investigating further.
So this is worth investigating further.
Matt and I did that, and I think we have everything worked out (we'll know when he updates the PR...).
He took your suggestion and changed the OutputSchema
type in the Workflow
struct to match the schema, and then we noted that the failure that you pointed out is due to a double-unserialization. With that fixed, things look like they are working again.
So this is worth investigating further.
Matt and I did that, and I think we have everything worked out (we'll know when he updates the PR...).
He took your suggestion and changed the
OutputSchema
type in theWorkflow
struct to match the schema, and then we noted that the failure that you pointed out is due to a double-unserialization. With that fixed, things look like they are working again.
Oh I figured it out on my own
Changes introduced with this PR
outputSchema
outputSchema
package workflow
's public scope, nowworkflow.GetSchema()
outputSchema
in a workflowoutputSchema
in a workflowReproducible Example
Writing an
outputSchema
in a workflow, as seen below, results in the subsequent unexpected error.workflow.yaml
By contributing to this repository, I agree to the contribution guidelines.