Scala Object to JSON marshalling

Hi all,

I found this blog post approach to create JSON request bodies with Gatling very interesting, and useful, especially for performance testing API services.

I was wondering if there was a general consensus in the community regarding Object → JSON marshalling, and are there other alternatives solutions? Are there downsides to this approach?

Also, in this example the use Lift’s JSON library, are they any other libraries out there? Does Gatling has an opinion here?

Carlos Torres

Load testing is very low level, close to the protocols, so I personally tend to stick to Gatling text templates.
IMO, it mostly makes sense to go with object serialization when you’re reusing your application’s value objects.
If you want to go with JSON serialization, I’d recommend Json4s backed by Jackson if you’re using Scala structures, and Jackson or Boon if you’re going with Java ones.