julianpeeters / sbt-avrohugger

sbt plugin for generating Scala sources for Apache Avro schemas and protocols.
Apache License 2.0
133 stars 50 forks source link

Having SCHEMA$ field inside generated case class (specific) #101

Closed k7i3 closed 5 months ago

k7i3 commented 5 months ago

Hey! Is there a way to have the SCHEMA$ field not only in the companion object but also within the case class itself? I've tried to experiment with:

Compile / avroScalaSpecificCustomTypes := avrohugger.format.SpecificRecord.defaultTypes.copy( record = avrohugger.types.ScalaCaseClassWithSchema // ScalaCaseClass )

and it looks like that for specific records results are the same with both options 🤷‍♂️

julianpeeters commented 5 months ago

Is there a way to have the SCHEMA$ field not only in the companion object but also within the case class itself?

no, there is not