Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ben Plommer
    @bplommer
    Hi Keir - sorry, I missed that. But I’ve just released 1.7.0
    Keir Lawson
    @keirlawson
    great, thanks!
    catostrophe
    @catostrophe
    @bplommer after switching to 1.7.0 I get "Error decoding Option: Error decoding union: Missing alternative array in union" in derived codecs when I decode GenericData.Record. But it happens ONLY after ser/de via GenericDatumWriter/GenericDatumReader
    Keir Lawson
    @keirlawson
    Not sure if its really a bug but as an FYI came across an issue where the LocalDate produces weird results where LocalDate.toEpochDay returns a value greater than the max int (due to internal use of Long.toInt), obviously its a fairly unlikely scenario in the real world, but just thought I'd mention it!
    Ben Plommer
    @bplommer
    @catostrophe eek, thanks for the heads up - would you mind opening a GitHub issue?
    catostrophe
    @catostrophe

    @bplommer after switching to 1.7.0 I get "Error decoding Option: Error decoding union: Missing alternative array in union" in derived codecs when I decode GenericData.Record. But it happens ONLY after ser/de via GenericDatumWriter/GenericDatumReader

    Which change might have broken the codec?

    @catostrophe eek, thanks for the heads up - would you mind opening a GitHub issue?

    Sure

    Ben Plommer
    @bplommer
    @keirlawson yeah I’d say that’s a bug - we should raise an error if the date is out of range
    Keir Lawson
    @keirlawson
    ok, will add a report on github
    Ben Plommer
    @bplommer
    @catostrophe I'd guess it's to do with this PR https://github.com/fd4s/vulcan/pull/334/files
    catostrophe
    @catostrophe
    Ben Plommer
    @bplommer
    Thanks, I'll look into it :+1:
    Keir Lawson
    @keirlawson
    I'm getting the same issue with 1.7.0
    Ben Plommer
    @bplommer
    Yep, I found the problem - pushing up a fix now
    Keir Lawson
    @keirlawson
    cheers!
    Ben Plommer
    @bplommer
    catostrophe
    @catostrophe
    @bplommer thanx!
    Ben Plommer
    @bplommer
    Thanks for the report! 🙂
    That was an interesting one to debug - the serde'd record used a collection type for arrays that's also a subtype of GenericData, which we wrongly assumed was only used for named types (record, enum, fixed)
    Ben Plommer
    @bplommer
    1.7.1 is out
    Keir Lawson
    @keirlawson
    Issue resolved for me :)
    Ben Plommer
    @bplommer
    Great
    Igor Markiewicz
    @imarkiew
    Hello
    Does vulcan-generic support renaming fields e.g. camel case to snake case? Something like circe-generic does?
    Viktor Rudebeck
    @vlovgr
    @imarkiew It does not, but you can use manually defined codecs if you need to do renames.
    marcinkrykowski
    @marcinkrykowski
    Hello, how can I write a custom implicit codec for tagged values?
    marcinkrykowski
    @marcinkrykowski
    Issue solved. Eg.
    implicit def taggedStringCodec[T]: Codec[String @@ T] = Codec[String].imap[String @@ T](_.taggedWith[T](_.toString)
    oybek
    @oybek
    Hello guys
    And thank you Ben for the good library
    I've started using it and having trouble decoding the case class value from the array[byte]
    Having
    bytes: Array[Byte]
    
    // Can I do?
    Codec.decode(bytes)
    
      case class FooBar(foo: String, bar: String)
      implicit val foobarCodec: Codec[FooBar] =
        Codec.record[FooBar](
          name = "foo",
          namespace = "foo.bar"
        ) { field =>
          (
            field("foo", _.foo),
            field("bar", _.bar)
            ).mapN(FooBar)
        }