0

I have worked on Rest development with Spring. Spring library takes care of JSON data conversion in a request body as well as in a response. I am wondering any good approach for Dispatch, a Scala Rest library, that is to convert a case class to a JSON data for a request body and convert a response data to a case class.

Update:

After some study, I think the toString method can be used to convert a case class to a JSON data. There will be some more code if a case class has some Option fields.

Urist McDev
  • 498
  • 3
  • 14
TeeKai
  • 671
  • 2
  • 10
  • 20

1 Answers1

0

In combination of Dispatch I am using json4s to serialise / deserialise my json bodies. You can have a look at it here : http://json4s.org/. You can also consider using spray-json, circe, Argaunot, it's up to you !!

Graham
  • 7,431
  • 18
  • 59
  • 84
Louis F.
  • 2,018
  • 19
  • 22