summaryrefslogtreecommitdiff
path: root/tests/examplefiles/capnp/pets.capnp
blob: efc5e42617cc25e2454d5194c007b6b7521650be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@0x0123456789abcdef;  # unique file ID

struct Pet {
	name @0 :Text;
	owner @1 :List(Owner);
	birthdate @2 :Date;

	struct Owner {
		name @0 :Text;
		contact @1 :List(Contact);
		
		struct Contact {
			address @0 :Text;
			type @1 :Type;

			enum Type {
				email @0;
				phone @1;
				msgr @2;
			}
		}
	}
}

# a comment

struct Date {
	year @0 :Int16;
	month @1 :UInt8;
	day @2 :UInt8;
}