cpptemplates: Initialize json before trying to deserialize it

Change-Id: Icf3e665f09f6eec7d60716d9eaf6013f18208072