summaryrefslogtreecommitdiff
path: root/tutorial/tutorial.thrift
diff options
context:
space:
mode:
authorDavid Reiss <dreiss@apache.org>2008-07-24 19:13:54 +0000
committerDavid Reiss <dreiss@apache.org>2008-07-24 19:13:54 +0000
commit5ff21a4df610cf7a5b35563169dddf1f68325ba4 (patch)
treee6c2ba3b2170acc5ebbf172fb054772ab79c40e0 /tutorial/tutorial.thrift
parent5317b1ecd23bc6ba29905cff6f8e411fbfe287f8 (diff)
downloadthrift-5ff21a4df610cf7a5b35563169dddf1f68325ba4.tar.gz
THRIFT-85. Include an example of an optional field in tutorial.thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@679501 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tutorial/tutorial.thrift')
-rwxr-xr-xtutorial/tutorial.thrift7
1 files changed, 6 insertions, 1 deletions
diff --git a/tutorial/tutorial.thrift b/tutorial/tutorial.thrift
index 6e8393988..bc199e428 100755
--- a/tutorial/tutorial.thrift
+++ b/tutorial/tutorial.thrift
@@ -78,11 +78,16 @@ enum Operation {
* 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,
}
/**