Hi, I am trying to generate an ADT from this schema using ScalaADT
protocol Foo {
record Bar {
string a;
}
record Baz {
string b;
}
}
but what I get is
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
final case class Bar(a: String)
final case class Baz(b: String)
I would have expected this
/** MACHINE-GENERATED FROM AVRO SCHEMA. DO NOT EDIT DIRECTLY */
sealed trait Foo
final case class Bar(a: String) extends Foo
final case class Baz(b: String) extends Foo
Inside the build.sbt file I have inserted
avroScalaSpecificCustomTypes in Compile := {
avrohugger.format.Standard.defaultTypes.copy(
protocol = avrohugger.types.ScalaADT)
}
sourceGenerators in Compile += (avroScalaGenerate in Compile).taskValue
Did I omit something?
Is the behavior I have described to you actually what one should expect?
I apologize if it is a known problem and if it is just my misunderstanding, and I hope not to waste your time unnecessarily.
Thank you
And I'm having the first issue:
new MemberData(, , , , , , , , , , )
Do you know why it's generating those ,
?
It's not compilable code
new MemberData()
instead
I've got my build.sbt file setup as:
import Dependencies._
import sbt._
ThisBuild / scalaVersion := "2.13.2"
ThisBuild / version := "0.0.1"
lazy val root = (project in file("."))
.settings(
name := "ziostreams",
libraryDependencies ++= Seq(
zio, zioKafka, zioStreams, avro
)
).settings(
// watchSources ++= ((avroSourceDirectory in Compile).value ** "*.avdl").get
// ,
sourceGenerators in Compile += (avroScalaGenerate in Compile).taskValue
)
And the plugin.sbt file set to use 2.0.0-RC4
When I do a sbt compile I'm getting error not found value avroScalaSourceDirectory and avroScalaGenerate (other line is uncommented)