makubi / avrohugger-maven-plugin

Maven plugin for generating Scala case classes and ADTs from Apache Avro schemas, datafiles, and protocols
Apache License 2.0
9 stars 9 forks source link

typeOverrides not working #91

Open jeanwisser opened 1 year ago

jeanwisser commented 1 year ago

I am using the following configuration:

<plugin>
                <groupId>at.makubi.maven.plugin</groupId>
                <artifactId>avrohugger-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-scala-sources</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${project.basedir}/avro</sourceDirectory>
                            <typeOverrides>
                                <timestampMillisType>JAVA_TIME_INSTANT</timestampMillisType>
                            </typeOverrides>
                        </configuration>
                    </execution>
                </executions>
</plugin>

with the following avro schema:

protocol metrics {
  record Metric {
    string metricName;
    @logicalType("timestamp-millis")
    long executionTimestamp;
  }
}

The build and case class generation works fine but I am seeing that the executionTimestamp parameter is Long and not java.time.Instant as I would expect. Is there something wrong with my configuration ?