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

deprecate for enum value not adding obsolete to generated c# models #10513

Closed
zagforward opened this issue Sep 7, 2022 · 2 comments · Fixed by #10520
Closed

deprecate for enum value not adding obsolete to generated c# models #10513

zagforward opened this issue Sep 7, 2022 · 2 comments · Fixed by #10520
Assignees
Labels

Comments

@zagforward
Copy link

zagforward commented Sep 7, 2022

What version of protobuf and what language are you using?
Version: v3.21.5
Language: C#
OS: Windows 10

What did you do?
I have a protobuf schema, which has an enum, some of the enum values are no longer required and I want to deprecate them, I added deprecate = true with the values but it doesn't add the [Obsolete] attribute in the generated c# model
here is the code example

enum Months{
JANUARY = 0 [deprecated = true];
FEBRUARY = 1 [deprecated = true];
MARCH = 2 [deprecated = true];
APRIL = 3 [deprecated = true];
MAY = 4;
JUNE = 5 [deprecated = true];
JULY = 6 [deprecated = true];
AUGUST = 7;
SEPTEMBER = 8 [deprecated = true];
OCTOBER = 9;
NOVEMBER = 10;
DECEMBER = 11;
}

@zagforward zagforward added the untriaged auto added to all issues by default when created. label Sep 7, 2022
@jskeet jskeet self-assigned this Sep 7, 2022
@jskeet jskeet added bug c# and removed untriaged auto added to all issues by default when created. labels Sep 7, 2022
@jskeet
Copy link
Contributor

jskeet commented Sep 7, 2022

Thanks, I'll pick this up - I don't expect it to be too hard to implement.

@zagforward
Copy link
Author

Thank you @jskeet for quickly responding and fixing

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

Successfully merging a pull request may close this issue.

2 participants