You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, a protobuf name like uri becomes URI when generated. PascalFromSnake will convert uri into Uri, which is not compatible, causing populateQueryParameter to fail to do its job.
What's the right way to solve this mismatch?
Should PascalFromSnake be replaced with something that uses Go style casing that keeps acronym case matching (i.e. either uri or URI, never Uri)? That seems impossible to do in the general case, unless you hardcode a dictionary of all words that are considered acronyms. Although I wonder how the protobuf generator does this conversion.
The alternative is to have protobuf generator use pascal casing instead of Go style casing. This seems more friendly towards automatic code generation since it doesn't require hardcoded special cases (an acronym dictionary).
Any thoughts? How is this problem generally solved?
The text was updated successfully, but these errors were encountered:
As far as I can tell, a protobuf name like uri becomes URI when generated.
Sorry, it turns out that's not a general rule. It was happening in an example I saw because the name was overridden via a gogo customname field, i.e., [(gogoproto.customname) = "URI"].
As far as I can tell, a protobuf name like
uri
becomesURI
when generated.PascalFromSnake
will converturi
intoUri
, which is not compatible, causingpopulateQueryParameter
to fail to do its job.What's the right way to solve this mismatch?
Should
PascalFromSnake
be replaced with something that uses Go style casing that keeps acronym case matching (i.e. eitheruri
orURI
, neverUri
)? That seems impossible to do in the general case, unless you hardcode a dictionary of all words that are considered acronyms. Although I wonder how the protobuf generator does this conversion.The alternative is to have protobuf generator use pascal casing instead of Go style casing. This seems more friendly towards automatic code generation since it doesn't require hardcoded special cases (an acronym dictionary).
Any thoughts? How is this problem generally solved?
The text was updated successfully, but these errors were encountered: