As discussed with @vieux: in a future PR, you could simply use job.AddEnv() which already takes care of json marshalling.