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

FR: C# allow the reading of repeated custom options #5759

Open
chrisdunelm opened this issue Feb 21, 2019 · 3 comments
Open

FR: C# allow the reading of repeated custom options #5759

chrisdunelm opened this issue Feb 21, 2019 · 3 comments
Assignees

Comments

@chrisdunelm
Copy link
Contributor

What language does this apply to?
C#

Describe the problem you are trying to solve.
Read repeated custom options

Describe the solution you'd like
Methods in the CustomOptions class to allow reading of repeated custom options.

Describe alternatives you've considered
Currently using reflection to achieve this ;)

Additional context

@RoarkeRandall
Copy link

RoarkeRandall commented Jul 23, 2019

I'm trying to pull a repeated EnumValueOption and I'm not sure how to do it. I'm able to do this in go and it appears it's possible in c#.

I see in a few issue discussions it was decided to not support generics and also to not support repeated options. Why was this decided?

#2317

Is there any other way to pull repeated options? I can see in my debugger that the data is all there in the descriptor, but there is no method overload to retrieve it on the CustomOptions class.

@jtattermusch
Copy link
Contributor

Currently it's not possible because proto2 is not fully supported. #5936 should fix that.

@RoarkeRandall
Copy link

RoarkeRandall commented Jul 23, 2019

I keep reading comments that it's a proto2 feature, and not proto3, but that isn't the case. From the docs: https://developers.google.com/protocol-buffers/docs/proto3#options

Custom Options
Protocol Buffers also allows you to define and use your own options. This is an advanced feature which most people don't need. If you do think you need to create your own options, see the Proto2 Language Guide for details. Note that creating custom options uses extensions, which are permitted only for custom options in proto3.

It's good to see a PR exists to add support though!

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

No branches or pull requests

5 participants