-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Remove gogoproto yaml annotations (#409) #513
Conversation
Codecov Report
@@ Coverage Diff @@
## master #513 +/- ##
=======================================
Coverage 77.51% 77.51%
=======================================
Files 100 100
Lines 12755 12755
=======================================
Hits 9887 9887
Misses 2276 2276
Partials 592 592
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -118,5 +120,5 @@ message CreditTypeSeq { | |||
string abbreviation = 1; | |||
|
|||
// The sequence number of classes of the credit type | |||
uint64 seq_number = 2; | |||
uint64 seq_number = 2 [ json_name = "seq_number" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious - why do some fields have this addition while others dont?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically this was about multiple word fields, and ensuring yaml encoding used snake-case instead of camel-case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually doing some further digging into edge cases and how this works here, as I'm suspicious there may be some strange change in behavior as previously things might have been json serialized as camel case...
Looks good! @ruhatch is there a reason we're adding |
So digging into it a little more... I'm not actually sure if we need Most of the time when we marshal/unmarshal (at least in the SDK), we're using jsonpb, and serializing using the original proto field name (we do this by setting the Marshaler.OrigName to One side note- we actually don't use the codec marshaler when creating the template JSON in our By explicitly setting
If there's a specific reason for us wanting to fail on parsing camelCase JSON, then I think we should keep the tags. But otherwise I think adding the explicit |
Okay, interesting! I need to check whether the new yaml library (which is only used in one place), will use the correct kind of JSON serialization or not. I'll remove those tags! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
Remove gogoproto yaml annotations.
Closes: #409
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change