Making type optional, and file_type inferred, and adding a validation check for required fields