sbt-avro4s icon indicating copy to clipboard operation
sbt-avro4s copied to clipboard

Multiple .avsc files

Open SrikanthTati opened this issue 7 years ago • 1 comments

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)

SrikanthTati avatar May 01 '17 06:05 SrikanthTati

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?

SrikanthTati avatar May 01 '17 10:05 SrikanthTati