julianpeeters / avrohugger

Generate Scala case class definitions from Avro schemas
Apache License 2.0
201 stars 120 forks source link

Support deeply nested array types #67

Open timchan-lumoslabs opened 7 years ago

timchan-lumoslabs commented 7 years ago

Given:

{
  "namespace": "com.acme",
  "name":      "a",
  "type":      "record",
  "fields": [
    { "name": "words", "type":  { "type": "array", "items": "string" }}
  ]
}
{
  "namespace": "com.acme",
  "name":      "b",
  "type":      "record",
  "fields": [
    { "name": "as", "type":  { "type": "array", "items": "com.acme.a" }}
  ]
}
{
  "namespace": "com.acme",
  "name":      "c",
  "type":      "record",
  "fields": [
    { "name": "bs",  "type":  { "type": "array", "items": "com.acme.b" }}
  ]
}

I get the following error:

[error]  not enough arguments for method apply: (words: Array[String])com.acme.model.a in object a.
[error] Unspecified value parameter words.
[error]           a()
[error]            ^
julianpeeters commented 7 years ago

Hey Tim, sorry for the hiccup and, as always, thanks for reporting.

I'm unable to reproduce this, however. I tried on linux using sbt-avrohugger 0.15.2, sbtavrohugger.SbtAvrohugger.scavroSettings, and with the file names a.avsc, b.avsc, and c.avsc

Are your details the same?

I'll try on OSX when I get a chance (or perhaps finally set up a TravisCI build).

In the meantime, does the above reveal a fix for you?