Format metadata as JSON.