Updated swagger writer to marshall json