sbt-avro4s
sbt-avro4s copied to clipboard
Multiple .avsc files
Is there a way to get multiple .avsc files parsed?
Lets say inner.avsc defines schema for a record and outer.avsc defines another record with one of the fields as inner
. So schema parser has to parse inner first before outer.
[info] -------------------------------------------------------------- [info] [sbt-avro4s] Found 10 schemas org.apache.avro.SchemaParseException: Undefined name: "inner" at org.apache.avro.Schema.parse(Schema.java:1228) at org.apache.avro.Schema.parse(Schema.java:1340) at org.apache.avro.Schema.parse(Schema.java:1269) at org.apache.avro.Schema$Parser.parse(Schema.java:1032) at org.apache.avro.Schema$Parser.parse(Schema.java:997) at com.sksamuel.avro4s.ModuleGenerator$.apply(ModuleGenerator.scala:17)
A hacky way to do this is to name the avsc files in the order in which they are required to be parsed. Its flaky and difficult to maintain. Is there an easier way to achieve this?