Skip to content

Commit

Permalink
Allow custom actions to output any data
Browse files Browse the repository at this point in the history
Including top-level arrays and other data types.
  • Loading branch information
Iwasaki Yudai committed May 4, 2016
1 parent be4cad8 commit b81f2a9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions server/resources/resource_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,8 @@ func ActionResource(context middleware.Context, dataStore db.DB, identityService
return err
}

if rawResponse, ok := context["response"]; ok {
if _, ok := rawResponse.(map[string]interface{}); ok {
return nil
}
return fmt.Errorf("extension returned invalid JSON: %v", rawResponse)
if _, ok := context["response"]; ok {
return nil
}

return fmt.Errorf("no response")
Expand Down

0 comments on commit b81f2a9

Please sign in to comment.