Skip to content

v0.7.4: Fix methods with no response value

Compare
Choose a tag to compare
@VojtechVitek VojtechVitek released this 14 Nov 21:23
· 89 commits to master since this release

Methods with no response value now render empty JSON object {}.

# RIDL

service ExampleService
  - Ping()
@ func (s *exampleServiceServer) servePingJSON(ctx context.Context, w http.ResponseWriter, r *http.Request) {

    w.Header().Set("Content-Type", "application/json")
    w.WriteHeader(http.StatusOK)
+   w.Write([]byte("{}"))
 }

Fixes webrpc/webrpc#74
Fixes webrpc/webrpc#104
Fixes webrpc/webrpc#105