Sending nulls (because the server asked me to)

Since the server architecture defines the API, and the client must implement what the server defines, and since many servers are written in java, I find myself in a situation where I need to be able to send:


Unfortunately, it seems this is unsupported by the gatling API.

Is there a reasonable workaround for this?

What are you doing exactly?

Imagine serializing the following object:

case class SomeArgs(
param1: String,
param2: Map[String, String],
param3: java.lang.Long

If param3 = null, gatling’s serialization of this object will resemble:


This is a problem, because the server requires:


I know there is a configuration for the jackson object mapper which DISABLES serializing null values (the current perceived functionality).
I would like to ENABLE serializing null values.

Once again, my question is: “how do you perform the JSON serialization?” = show me the code!!!
Gatling ships 2 JSON parsers, Boon and Jackson.

Ah - I hadn’t implemented the serialization - as soon as you mentioned this I found the implementation of the serializer (I had thought gatling shipped with a default) and was able to modify it accordingly - thanks.