[
https://issues.apache.org/jira/browse/THRIFT-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13967176#comment-13967176
]
Jens Geyer commented on THRIFT-2429:
------------------------------------
{quote}
If at some point you wish to stop writing or sending a required field, it will
be problematic to change the field to an optional field — old readers will
consider messages without this field to be incomplete and may reject or drop
them unintentionally.
{quote}
Actually it's even worse. Adding a {{required}} field in a later stage is
similarly problematic, because most of the implementations (not all, though)
throw an exception when an required field has not been deserialized. That part
of the {{required}} policy is certainly necessary, but makes it impossible to
receive data from older counterparts, because they will not give you what you
expect.
> Provide option to not write default values, rely on receiver default
> construction instead
> -----------------------------------------------------------------------------------------
>
> Key: THRIFT-2429
> URL: https://issues.apache.org/jira/browse/THRIFT-2429
> Project: Thrift
> Issue Type: Improvement
> Components: C++ - Compiler
> Affects Versions: 0.9.1
> Reporter: Chris Stylianou
> Assignee: Randy Abernethy
> Labels: default, optional, required
>
> Would there be any objections to a patch that does not write default values
> (essentially the same logic as the optional attributes). This obviously
> relies on the receiving application using the same IDL version to ensure the
> defaults used on object construction match the senders.
--
This message was sent by Atlassian JIRA
(v6.2#6252)