Skip to content

Commit 38062db

Browse files
committed
Switch Invocation Response Body to interface{}
1 parent 1843560 commit 38062db

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/event/service.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Invocation struct {
1414
Id string `json:"id"`
1515
Body interface{} `json:"body"`
1616
Timeout time.Time `json:"timeout"`
17-
Response *string `json:"response"`
17+
Response interface{} `json:"response"`
1818
Error *RuntimeError `json:"error"`
1919
ErrorType *string `json:"errorType"`
2020
}
@@ -89,7 +89,12 @@ func (s Service) SendResponse(id string, body []byte) error {
8989
return errors.New("invocation timeout")
9090
}
9191

92-
b := string(body)
92+
var b interface{}
93+
err := json.Unmarshal([]byte(body), &b)
94+
if err != nil {
95+
return err
96+
}
97+
9398
inv.Body = b
9499
return nil
95100
}

0 commit comments

Comments
 (0)