Built-in support for serializing Groovy classes

21 views
Skip to first unread message

cgmol...@gmail.com

unread,
Aug 25, 2015, 6:10:53 AM8/25/15
to Genson user group
Is it possible to add support for Groovy serialization to Genson? At the moment it throws a lot of JsonBindingExceptions due to the fact that it's trying to serialize the dynamic properties Groovy adds to all classes like metaClass, $callSiteArray etc.

Eugen Cepoi

unread,
Aug 25, 2015, 6:16:02 AM8/25/15
to gen...@googlegroups.com
Yes we could do it and register the feature with a Bundle (like for scala, joda time, etc). Are you interested in contributing it via a pull request? I am not familiar with Groovy, but could provide some help on how to solve it in Genson.

2015-08-25 12:10 GMT+02:00 <cgmol...@gmail.com>:
Is it possible to add support for Groovy serialization to Genson? At the moment it throws a lot of JsonBindingExceptions due to the fact that it's trying to serialize the dynamic properties Groovy adds to all classes like metaClass, $callSiteArray etc.

--
You received this message because you are subscribed to the Google Groups "Genson user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genson+un...@googlegroups.com.
To post to this group, send email to gen...@googlegroups.com.
Visit this group at http://groups.google.com/group/genson.
To view this discussion on the web visit https://groups.google.com/d/msgid/genson/844f621b-f2d4-44e7-8560-24a598ad741f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cgmol...@gmail.com

unread,
Aug 28, 2015, 4:09:13 AM8/28/15
to Genson user group
Sounds good. I would contribute if I could, but unfortunately I'm not sure I will have the time anytime soon. A possible solution is to just exclude the hardcoded property names known to be generated by Groovy, but that doesn't sound like a good solution to me. I know gson works with Groovy -- one could probably look into how they make it work. 

Eugen Cepoi

unread,
Aug 28, 2015, 4:25:16 AM8/28/15
to gen...@googlegroups.com
Contributing this feature is the best way to make sure it is done :)

Most people use Genson with Java or Scala, so the next features I plan to implement during my free time are for those languages.
But if you decide to do it, then I can find the time to help you implement it. Just let me know.

Cheers,
Eugen


Reply all
Reply to author
Forward
0 new messages