Author: dreiss
Date: Thu Jul 24 12:13:54 2008
New Revision: 679501
URL: http://svn.apache.org/viewvc?rev=679501&view=rev
Log:
THRIFT-85. Include an example of an optional field in tutorial.thrift
Modified:
incubator/thrift/trunk/tutorial/tutorial.thrift
Modified: incubator/thrift/trunk/tutorial/tutorial.thrift
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/tutorial/tutorial.thrift?rev=679501&r1=679500&r2=679501&view=diff
==============================================================================
--- incubator/thrift/trunk/tutorial/tutorial.thrift (original)
+++ incubator/thrift/trunk/tutorial/tutorial.thrift Thu Jul 24 12:13:54 2008
@@ -78,11 +78,16 @@
* Structs are the basic complex data structures. They are comprised of fields
* which each have an integer identifier, a type, a symbolic name, and an
* optional default value.
+ *
+ * Fields can be declared "optional", which ensures they will not be included
+ * in the serialized output if they aren't set. Note that this requires some
+ * manual management in some languages.
*/
struct Work {
1: i32 num1 = 0,
2: i32 num2,
- 3: Operation op
+ 3: Operation op,
+ 4: optional string comment,
}
/**