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

Handling deserializing new Values on enums with UNKNOWN_ENUM_VALUE_(enumName)_(newValue) #105

Open
nbergaoui opened this issue Jun 22, 2022 · 0 comments

Comments

@nbergaoui
Copy link

Hi all ,
We are using the proto version 3.0.0 and your plugin to generate deserialization classes from our protobuf files .
Here is the version used :
org.xolstice.maven.plugins
protobuf-maven-plugin
0.5.0

com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}

Now when we look at our proto file it looks like that :

enum TypeCreneauProto {
UNKNOWN_TYPE_CRENEAU_PROTO = 0;
JOURNEE = 1;
MATINEE = 2;
APRES_MIDI = 3;
DEBUT_MATINEE = 4;
FIN_MATINEE = 5;
DEBUT_APRES_MIDI = 6;
FIN_APRES_MIDI = 7;
AU_PLUS_TOT = 8;
}

When we receive a value 9 , well it is supposed to put the value to the default one ie : UNKNOWN_TYPE_CRENEAU_PROTO , but it still creates a new value non exiting on our enum

UNKNOWN_ENUM_VALUE_TypeCreneauProto_9

this causes us trouble when serialising back to other formats .
Why does it bevave this way ? It looks like a bug as what is annouced it that it get to the default value ( set to 0 on the top of the enum )
The field is optionnal ( no mention for the "optional" tag as we are using proto 3.0.0

Can you please get back to me on this issue ?
Thanks

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

No branches or pull requests

1 participant