-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
bug 🐛Something isn't workingSomething isn't working
Description
Although Action.FunctionRef.Invoke field is set in the JSON while unmarshaling into a struct the field is not set. Seems due to the fact that its of InvokeType.
Expect to unmarshal correclty
set invoke in FuncRef Action and try to unmarshal into a struct
func (f *FunctionRef) UnmarshalJSON(data []byte) error {
funcRef := make(map[string]interface{})
if err := json.Unmarshal(data, &funcRef); err != nil {
f.RefName, err = unmarshalString(data)
if err != nil {
return err
}
return nil
}
f.RefName = requiresNotNilOrEmpty(funcRef["refName"])
if _, found := funcRef["arguments"]; found {
f.Arguments = funcRef["arguments"].(map[string]interface{})
}
f.SelectionSet = requiresNotNilOrEmpty(funcRef["selectionSet"])
// Missing part ?
if _, found := funcRef["invoke"]; found {
if invoke, ok := funcRef["invoke"].(string); ok {
f.Invoke = InvokeType(invoke)
}
}
// End of Missing part
return nil
}
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working