Skip to content
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

KeepCase should default to true #1964

Open
Shahab96 opened this issue Jan 19, 2024 · 1 comment
Open

KeepCase should default to true #1964

Shahab96 opened this issue Jan 19, 2024 · 1 comment

Comments

@Shahab96
Copy link

Shahab96 commented Jan 19, 2024

protobuf.js version: latest

Keep case defaults to false. This results in the default being to violate protobuf contracts until explicitly told not to. It is not protobuf.js's job to conform to casing opinions, rather to comply with the proto files provided to it. If a non camel case item exists, it should be respected. Otherwise protobuf.js is simply violating a contract just because it's not camelCase.

I'm happy to make this change if the maintainers allow it.

Edit: Here's a reference to the default

parse.defaults = { keepCase: false };

@alexander-fenster
Copy link
Contributor

I understand where you are coming from. Both decisions (either true or false as a default value for keepCase) has pros and cons. Using camelCase for proto messages in JavaScript is pretty much standard these days, even the official JSON spec suggests camelCase.

Changing the default will be a big breaking change and a lot of code will stop working, so I don't think we should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants