-
Notifications
You must be signed in to change notification settings - Fork 455
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
Casing of "Id" changed to "ID" #817
Comments
Protocol buffers provides a style guide (for better or worse). The Swift support (like some other languages) tries to convert the enum and field names to follow the language conventions. So in generating it attempts to find word breaks (with underscores or via CamelCase) and then transform them. Some "words" (URL, HTTP, HTTPS, ID) we attempt to follow the Apple naming guidelines and always make them all uppercase, again so the names will match what developers are used to with Foundation/etc. There isn't an option to control this. |
I understand that you may want to follow Apple naming guidelines, but I wanted to give my opinion on this one 😇. From what I could see:
A style convention that is not practical, not consistent, adds code and unit tests (and therefore more opportunities for bugs) just because of an arbitrary style decision at some point is not a good convention to me. Note that I could deal with it in my code (and unit tests), so I really just wanted to share my opinion here. |
You may be right. Unfortunately, given that a lot of people are now using this, changing it seems impractical (it would potentially break a lot of code). Maybe if/when we do a version 2, we'll consider changing this behavior at that time. |
I have encountered the issue. The problem is that the name map when using the |
Hi there,
Using
protoc-gen-swift 1.2.0
on Mac, I'm compiling the followingExample.proto
:And I get the following output:
Note that
Example.requestedOfUserID
has a capital "D" at the end.Is this expected behavior? I'd prefer to keep my specified capitalization, and couldn't find an option to do that.
Thanks!
The text was updated successfully, but these errors were encountered: