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

sealed oneof option/annotation instead of special name #578

Open
dsilvasc opened this issue May 14, 2019 · 6 comments
Open

sealed oneof option/annotation instead of special name #578

dsilvasc opened this issue May 14, 2019 · 6 comments

Comments

@dsilvasc
Copy link

Sealed oneofs are only generated when the oneof name is sealed_value. For people with existing schemas (or schemas shared across multi-language teams where others might prefer another name), would it be possible to allow annotating the message or the oneof?

Maybe something like option (scalapb.message).sealed_oneof = true?

@thesamet
Copy link
Contributor

Yes, that should be fairly straightforward. Would you have time to put together a PR? There are initial instructions on getting started here: https://github.com/scalapb/ScalaPB/blob/master/CONTRIBUTING.md and this is an example commit that adds an option: 82bbd69

@dsilvasc
Copy link
Author

Thanks for the pointers -- I'll give it a shot.

@thesamet
Copy link
Contributor

@dsilvasc : 1. is it something that you still need? 2. Will you be able to give it a shot?

@thesamet
Copy link
Contributor

Closing due to inactivity. Please feel free to comment if there's still interest in it and we can re-open.

@wesselvdv
Copy link

Was there ever any attempt for this?

@acruise
Copy link

acruise commented Oct 2, 2024

In cases where I control the proto and am willing to live with backwards compatibility risks, it'd be great to be able to apply sealed oneof globally, or per message, without the sealedFoo and SealedFoo naming convention leaking into the generated Scala. :/

@thesamet thesamet reopened this Oct 2, 2024
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

4 participants