docs: def validate_json(file):
      """Validate a JSON file."""
      max_file_size = current_app.config.get(
          'PREVIEWER_MAX_FILE_SIZE_BYTES', 1 * 1024 * 1024)
      if file.size > max_file_size:
          return False
  
      with file.open() as fp:
          try:
              json.loads(fp.read().decode('utf-8'))
              return True
          except:
              return False