Conversation
- remove omitempty from *pb.go files - added command to makefile for everytime `make protoc_all` is run - open question: - Do we want to further remove omitempty from other places - https://github.com/tendermint/tendermint/blob/master/rpc/lib/types/types.go#L151 - and other places ref #3882 Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
Codecov Report
@@ Coverage Diff @@
## master #3889 +/- ##
=========================================
- Coverage 66.87% 66.8% -0.08%
=========================================
Files 219 221 +2
Lines 18486 18510 +24
=========================================
+ Hits 12363 12365 +2
- Misses 5197 5222 +25
+ Partials 926 923 -3
|
(I had issue with use of omitempty for all fields in record.) |
|
I'm looking at your most recent commit and I'm not if we're on the same page, so I just want to lay out how we understand the problem. If you have type RequestEcho struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`Doesn't this mean that in the event that the Sorry if I'm wrong, but again just wanting to make sure we're on the same page. Long story short, if keys sometimes appear, sometimes don't it makes it really hard for us. If they don't have a value, you are still free to use JSON's |
|
Yes, I believe we are on the same page. @melekes requested to change to use jsonpb and not remove omitempty from the *pb.go files. So it would be handled by the marshler instead of the script to remove from the pb.go files. This is how I understood #3889 (comment) |
|
🙏 |
|
Just checking in, if I were to build a docker image on this branch would it do what we need? |
af16790 to
61fed2a
Compare
crypto/merkle/result.go
Outdated
| //--------------------------------------------------------------------------- | ||
| // override JSON marshalling so we emit defaults (ie. disable omitempty) | ||
| // note we need Unmarshal functions too because protobuf had the bright idea | ||
| // to marshal int64->string. cool. cool, cool, cool: https://developers.google.com/protocol-buffers/docs/proto3#json |
There was a problem hiding this comment.
I might be misunderstanding something but AFAIK int64, fixed64 and uint64 should be encoded as strings?
#3898 (comment)
There was a problem hiding this comment.
Yep, we should probably remove the "note we need ..."
not sure if it's related. probably not |
|
@blinky3713 you can give the branch a try now, sorry for the delay |
abci/types/result.go
Outdated
| // override JSON marshalling so we emit defaults (ie. disable omitempty) | ||
| // note we need Unmarshal functions too because protobuf had the bright idea | ||
| // to marshal int64->string. cool. cool, cool, cool: https://developers.google.com/protocol-buffers/docs/proto3#json | ||
| // override JSON marshalling so we emit defaults (ie. enable omitempty) |
There was a problem hiding this comment.
"disable omitempty" was correct. sorry for confusion
537971a to
32b3eba
Compare
|
@marbar3778 can you also update the changelog? |
remove omitempty from *pb.go files
added command to makefile for everytime
make protoc_allis runopen question:
ref #3882
Signed-off-by: Marko Baricevic marbar3778@yahoo.com