Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can Pubsub Schema refer to previously declared schema

Hi,

If we have Department schema as below and Employee has Department.
So can we use and refer to Department schema which is already created when we create Employee schema or we need to repeat whole Department schema text again while defining Employee schema ?

{
"type" : "record",
"name" : "Department",
"fields" : [
{
"name" : "name",
"type" : ["string","null"]
},
{
"name" : "desc",
"type" : "string"
}
]
}
{
"type" : "record",
"name" : "Employee",
"fields" : [
{
"name" : "experience",
"type" : ["int","null"]
},
{
"name" : "age",
"type" : "int"
},
{
"name" : "department",
"type" : "Department"
}
]

}

 

3 10 1,139
10 REPLIES 10