Generate json from metadata