{
"definitions": {
"Student": {
"description": "A simple student struct",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
},
"root": "Student"
}
message Student {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional int64 age = 3 [json_name="age"];
}
{
"definitions": {
"Human": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
},
"Student": {
"parent": {
"type": "reference",
"target": "Human"
},
"type": "struct",
"properties": {
"studentId": {
"type": "string"
}
}
}
},
"root": "Student"
}
message Human {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional int64 age = 3 [json_name="age"];
}
message Student {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional int64 age = 3 [json_name="age"];
optional string studentId = 4 [json_name="studentId"];
}
{
"definitions": {
"Student": {
"description": "A student struct with an assigned faculty",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"faculty": {
"type": "reference",
"target": "Faculty"
}
}
},
"Faculty": {
"type": "struct",
"properties": {
"name": {
"type": "string"
}
}
}
},
"root": "Student"
}
message Student {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional int64 age = 3 [json_name="age"];
optional Faculty faculty = 4 [json_name="faculty"];
}
message Faculty {
optional string name = 1 [json_name="name"];
}
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"properties": {
"type": "map",
"schema": {
"type": "string"
}
}
}
}
},
"root": "Student"
}
message Student {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional int64 age = 3 [json_name="age"];
optional map<string, string> properties = 4 [json_name="properties"];
}
{
"definitions": {
"Human": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"location": {
"type": "reference",
"target": "Location"
}
}
},
"Location": {
"type": "struct",
"base": true,
"properties": {
"type": {
"type": "string"
}
},
"discriminator": "type",
"mapping": {
"Web": "web",
"World": "world"
}
},
"Web": {
"parent": {
"type": "reference",
"target": "Location"
},
"type": "struct",
"properties": {
"url": {
"type": "string"
}
}
},
"World": {
"parent": {
"type": "reference",
"target": "Location"
},
"type": "struct",
"properties": {
"lat": {
"type": "string"
},
"long": {
"type": "string"
}
}
}
},
"root": "Human"
}
message Human {
optional string firstName = 1 [json_name="firstName"];
optional string lastName = 2 [json_name="lastName"];
optional Location location = 3 [json_name="location"];
}
message Location {
optional string type = 1 [json_name="type"];
}
message Web {
optional string type = 1 [json_name="type"];
optional string url = 2 [json_name="url"];
}
message World {
optional string type = 1 [json_name="type"];
optional string lat = 2 [json_name="lat"];
optional string long = 3 [json_name="long"];
}
{
"definitions": {
"Student": {
"type": "object",
"properties": {
"matricleNumber": {
"type": "integer"
}
}
},
"StudentMap": {
"type": "struct",
"parent": {
"type": "reference",
"target": "Map",
"template": {
"T": "Student"
}
}
},
"Map": {
"type": "object",
"properties": {
"totalResults": {
"type": "integer"
},
"entries": {
"type": "array",
"schema": {
"type": "generic",
"name": "T"
}
}
}
}
},
"root": "StudentMap"
}
message Student {
optional int64 matricleNumber = 1 [json_name="matricleNumber"];
}
message StudentMap {
optional int64 totalResults = 1 [json_name="totalResults"];
optional repeated Student entries = 2 [json_name="entries"];
}
message Map {
optional int64 totalResults = 1 [json_name="totalResults"];
optional repeated T entries = 2 [json_name="entries"];
}
{
"import": {
"my_ns": "file:///generic.json"
},
"definitions": {
"Faculty": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"students": {
"type": "array",
"schema": {
"type": "reference",
"target": "my_ns:StudentMap"
}
}
}
}
},
"root": "Faculty"
}
message Faculty {
optional string description = 1 [json_name="description"];
optional repeated StudentMap students = 2 [json_name="students"];
}