Integration with Json4s
See original GitHub issueWould it be possible to have an integration with Json4s? Serializing an enum is trivial:
import enumeratum.EnumEntry
import org.json4s.CustomSerializer
object EnumSerializer extends CustomSerializer[EnumEntry](format => (
PartialFunction.empty,
{
case x: EnumEntry => JString(x.entryName)
}
))
But deserializing is not so easy, the tricky part is to instantiate the correct enum type.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Json4s by json4s
The Home page od Json4s website. ... Be aware that the default behavior of the jackson integration is to close the stream when...
Read more >JSON4S error at extract[T] - Stack Overflow
i am using json4s to extract data according to case class but i am getting a "unknown error". My scala version is 2.10.2...
Read more >JSON handling - http4s
http4s-core does not include JSON support, but integration with three popular ... Json4s is less functionally pure than Circe or Argonaut, but older...
Read more >Challenges Faced while integrating Apache Spark with HBase ...
py4j.protocol.Py4JJavaError: An error occurred while calling o64.save. : java.lang.NoSuchMethodError: org.json4s.jackson.JsonMethods. For this ...
Read more >Spray: how to (de)serialize objects with json4s
A while ago I wrote an article on how to build a REST api with Spray, where I used the Spray facilities to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PR available: https://github.com/lloydmeta/enumeratum/pull/123
It works, thanks!
I had a look at Circe, and it looks promising. But we have a quite large code base which depends heavily on Json4s, so it will be quite some work to migrate, and we will probably wait for Circe to be a bit more mature.