We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey!
It it possible to modify/extend the codec in some way? I would love for it to work the similar way to circe, but I can't find the related method
I want to build a codec for my type based on another codec, but it only allows to transform a codec.
Here is the problem I'm trying to solve
final case class Event[A: Codec]( eventId: EventId, eventTimestamp: Instant, data: A, ) object Event { implicit def codec[A: Codec]: Codec[Event[A]] = ??? }
And I want the Codec[Event[A]] to just add two fields(eventId, eventTimestamp) to the existing codec.
(eventId, eventTimestamp)
The behavior is really similar to circe's deepMerge. Is it possbile to do with vulcan (avro)?
deepMerge
def deepMerge(that: Json): Json = (asObject, that.asObject) match { case (Some(lhs), Some(rhs)) => fromJsonObject( lhs.toIterable.foldLeft(rhs) { case (acc, (key, value)) => rhs(key).fold(acc.add(key, value)) { r => acc.add(key, value.deepMerge(r)) } } ) case _ => that }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hey!
It it possible to modify/extend the codec in some way? I would love for it to work the similar way to circe, but I can't find the related method
I want to build a codec for my type based on another codec, but it only allows to transform a codec.
Here is the problem I'm trying to solve
And I want the Codec[Event[A]] to just add two fields
(eventId, eventTimestamp)
to the existing codec.The behavior is really similar to circe's
deepMerge
. Is it possbile to do with vulcan (avro)?The text was updated successfully, but these errors were encountered: