2

我需要从另一个模式中引用这个学生模式:

{
  "type": "record",
  "namespace": "data.add",
  "name": "Student",
  "fields": [
    {
      "name": "Name",
      "type": "string"
    },
    {
      "name": "Age",
      "type": "int"
    }
  ]
}

这是需要引用Student的父地址模式:

{
  "type": "record",
  "namespace": "data.add",
  "name": "Address",
  "fields": [
    {
      "name": "student",
      "type": "Student"
    }
  ]
}

当我使用带有 Avro 插件的 Gradle 构建时,上面会引发错误。两种模式都位于同一个文件夹中。

4

1 回答 1

1

这是成功的:

{
  "type" : "record",
  "namespace" : "data.add",
  "name" : "Address",
  "fields" : [
    {
      "name": "student",
      "type": "data.add.Student"
    }
  ]
}
于 2019-11-27T13:06:42.727 回答