Working with JSON in Scala

  • Scala does not support JSON. You need to use 3rd party library. This post is about my experiments with usage the JSON in Scala with three libraries:
  • argonaut
  • json4s
  • spray

Source code is here:



Code with examples:

  • argonaut/QuickStartExample – base operations on JSON
  • argonaut/RequestResponse – example of JSON request handling



Code with examples:

  • json4s/ArrayParser – parses JSON with array of objects
  • json4s/ArrayParserWithExtract – parses JSON with array of objects using extract
  • json4s/ArrayParserWithRead – parses JSON with array of objects using read
  • json4s/JsonProducer – producing JSON
  • json4s/JsonWriter – converts an object or objects to JSON string
  • json4s/Parser – parsing JSON
  • json4s/ParserWithExtract – parses JSON using extract
  • json4s/ParserWithRead – parses JSON using read



Code with examples:

  • spray/SprayJsonSimple – base operations on JSON
  • spray/ColorTest – converting to/from case class

Remark. Spary-json has limitation for number of parameters in a case class – no more than 22.


Most comfortable, at least for me, are libraries: json4s and spray-json


About ysden123

We are not only for work... All my time free from work I spend on photography. Most photos are from our travels. I like make photos in still life style as well.
This entry was posted in Programming, Scala and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.