Generates JSON file for flat models