Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type parameters to derived record name #447

Closed
wants to merge 1 commit into from

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