Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Use and require default value 0 for enums in Protobuf #285

Merged
merged 4 commits into from
Jan 29, 2021

Conversation

serras
Copy link
Collaborator

@serras serras commented Jan 27, 2021

Fixes #282

@akshaymankar @jschaul is this enough to remove the workaround from your code?

@serras serras requested a review from kutyel as a code owner January 27, 2021 15:32
@serras serras self-assigned this Jan 27, 2021
kutyel
kutyel previously approved these changes Jan 28, 2021
Copy link
Member

@kutyel kutyel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@serras serras force-pushed the default-value-protobuf-enum branch from 6c1f264 to c0a6f68 Compare January 28, 2021 13:22
@serras serras marked this pull request as ready for review January 28, 2021 13:23
@serras
Copy link
Collaborator Author

serras commented Jan 28, 2021

Now it's really ready, I forgot to change the Template Haskell so it was still generating TOption. Now it handles enums correctly.

akshaymankar added a commit to wireapp/wire-server that referenced this pull request Jan 28, 2021
@akshaymankar
Copy link
Contributor

This works as expected! Thanks for the fix 😄

@serras serras merged commit 1d5e3ee into master Jan 29, 2021
@serras serras deleted the default-value-protobuf-enum branch January 29, 2021 07:35
@serras
Copy link
Collaborator Author

serras commented Jan 29, 2021

mu-protobuf version 0.4.2.0, which includes this fix, has been released to Hackage

@akshaymankar
Copy link
Contributor

@serras The change in core/schema/src/Mu/Schema/Examples.hs is required for mu-protobuf to be able to compile, can you please release that to hackage too?

@serras
Copy link
Collaborator Author

serras commented Feb 2, 2021

Done! mu-schema-0.3.1.2 has been released.

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

Successfully merging this pull request may close these issues.

Protobuf: Enums have default values they shouldn't be required to be Maybe
3 participants