Skip to content

Facing issue to generate Schema for case class having a java construct in it. #856

Description

@chandan-kumar-ai
test("Sample case class testing") {
    case class TestRecord(intField: Int, stringField: String, instant: Instant, doubleArray:  Array[java.lang.Double])
    val schema = AvroSchema[TestRecord]
    println(schema.toString(true))
  }

if change java.lang.Double to Double it works

Otherwise This generate error could not find implicit value for parameter schemaFor: com.sksamuel.avro4s.SchemaFor[TestRecord]
    val schema = AvroSchema[TestRecord]

if I add

implicit lazy val schemaFor: SchemaFor[TestRecord] = SchemaFor[TestRecord]

This ends with

java.lang.StackOverflowError

using avro4s 4.x version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions