-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Honor READ_ENUMS_USING_TO_STRING feature when deserializing #397
Comments
I guess originally I was thinking that since databind level enum String is not available, this is not doable. So I think that while allowing return-as-String makes sense, we'd probably should add Protobuf-specific feature instead. New feature should be disabled by default for backwards compatibility. |
Ah yes you are right maybe the meaning are different. I see two ways of resolving this, either we are semantically close to the fact that we want from a port adapter perspective the symbolic name (because we expect the mapping to be done in the proto file) and the I have a preference for the former (standard feature) even if they are not strictly equal to what we want, because they are close enough to not confuse people. The enum are generated so its not we differentiate the toString() from the name() in our case. |
Actually there's another technical reason why I am pretty firmly for adding a new Proto-specific feature: |
Currently the ProtobufParser uses a condition (isStdEnum) to know it we need to deserialize using the index form or string form.
We could honor the READ_ENUMS_USING_TO_STRING feature so we return the string form when this feature is enabled.
The text was updated successfully, but these errors were encountered: