Skip to content

Commit

Permalink
fix grpc-gateway not reading body
Browse files Browse the repository at this point in the history
  • Loading branch information
John Petterson committed Feb 20, 2024
1 parent 12bdff8 commit 8b5292a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 45 deletions.
80 changes: 40 additions & 40 deletions gateway/gen/kvpair.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ func main() {
Mux: []gwruntime.ServeMuxOption{
gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.JSONPb{
MarshalOptions: protojson.MarshalOptions{
Multiline: true,
UseProtoNames: true,
},
UnmarshalOptions: protojson.UnmarshalOptions{
DiscardUnknown: true,
Multiline: true,
UseProtoNames: true,
EmitDefaultValues: true,
},
UnmarshalOptions: protojson.UnmarshalOptions{},
}),
},
}
Expand Down
5 changes: 5 additions & 0 deletions proto/kvpair.proto
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ service KVPair {
rpc SetRoot(SetRootRequest) returns (SetRootResponse) {
option (google.api.http) = {
post : "/v1/root"
body : "*"
};
}

Expand All @@ -153,6 +154,7 @@ service KVPair {
rpc SetLeaf(SetLeafRequest) returns (SetLeafResponse) {
option (google.api.http) = {
post : "/v1/leaves"
body : "*"
};
}

Expand All @@ -164,16 +166,19 @@ service KVPair {
rpc SetNonLeaf(SetNonLeafRequest) returns (SetNonLeafResponse) {
option (google.api.http) = {
post : "/v1/nonleaves"
body : "*"
};
}
rpc PoseidonHash(PoseidonHashRequest) returns (PoseidonHashResponse) {
option (google.api.http) = {
post : "/v1/poseidon"
body : "*"
};
}
rpc DataHashRecord(DataHashRecordRequest) returns (DataHashRecordResponse) {
option (google.api.http) = {
post : "/v1/datahashrecord"
body : "*"
};
}
}

0 comments on commit 8b5292a

Please sign in to comment.