Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.8
-
None
-
None
Description
If a struct contains optional fields with default values the generated python code serialize differently than Java or C# code.
In Java or C# optional fields are only serialized if a field was set by the client. If not the field is omited during serialization. This is possible because C#/Java maintains for each field a 'isset'-boolean which records if a field was set or not.
However the generated python code does not have such a 'isset'-structure. It writes every field which is not equal None. As the constructor initialize the optional fields with their default value, these fields are written whether they are set or not.
Attachments
Issue Links
- is related to
-
THRIFT-3756 Improve requiredness documentation
- Closed
1.
|
C#: Inconsistency in serialization of optional fields | Closed | Unassigned | |
2.
|
Java: Inconsistency in serialization of optional fields | Open | Unassigned | |
3.
|
Delphi: Inconsistency in serialization of optional fields | Closed | Jens Geyer |