Added Java Thrift SetDefaultEnumValue Annotation

Summary:
Synced to internal group post (View Butterfly Rule):
https://fb.workplace.com/groups/120844258624995/?post_id=1393921887983886

Added an annotation named strict behavior here to offer an option to use a default value.

Reviewed By: avalonalex, prakashgayasen

Differential Revision: D61163843

fbshipit-source-id: 00c49ace61ca152902f937a2597dfcc44dbfe3b8
This commit is contained in:
Kaining Mao 2024-08-14 20:21:29 -07:00 committed by Facebook GitHub Bot
parent f5675f425f
commit 6fe9799c88

View File

@ -78,3 +78,10 @@ struct Recursive {}
// behavior is correct to begin with.
@scope.Field
struct FieldUseUnmangledName {}
//In some case, due to client and server's thrift definitions out of sync,
//when thrift runtime deserialize a message it encountered a value not definded in definitions, and it
//returns null which cause some confusions.
//We set an annotation named UseIntrinsicDefault here to offer an option to use a default value when the null is received.
@scope.Enum
struct UseIntrinsicDefault {}