Skip to content

Conversation

@erikvanoosten
Copy link
Contributor

@erikvanoosten erikvanoosten commented May 9, 2022

This approach has the advantage of giving each type instance a different name. This is relevant if the consumer of the schema uses code generation. The feature is copied from Avro4s.

For example:

  def main(args: Array[String]): Unit = {
    import vulcan.Codec
    import vulcan.generic._

    case class SomeData(foo: String)
    case class Event[A](data: A)
    implicit val someDataCodec: Codec[SomeData] = Codec.derive
    println(Codec.derive[Event[SomeData]].schema.right.get.toString(true))
  }

Prints: Event.
After applying this pull request it will print: Event__SomeData.

This approach has the advantage of giving each type instance a different name. This is relevant if the consumer of the schema uses code generation. The feature is copied from Avro4s.
@erikvanoosten erikvanoosten changed the title Add type class to derived record name Add type parameters to derived record name May 10, 2022
@erikvanoosten
Copy link
Contributor Author

Closing, this is a duplicate of #444.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant