{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/good-grants/json-schema/good-grants-file-schema.json",
  "title": "File",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/good-grants-files-api-openapi.yml#/components/schemas/File",
  "type": "object",
  "properties": {
    "download_link": {
      "type": "string",
      "description": "Download URL for the file."
    },
    "duration": {
      "type": [
        "number",
        "null"
      ],
      "description": "Duration of the file in seconds, or `null` for files without a duration."
    },
    "filename": {
      "type": "string",
      "description": "Name of the file."
    },
    "image_height": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Height of the image in pixels, or `null` when not available."
    },
    "image_width": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Width of the image in pixels, or `null` when not available."
    },
    "metadata": {
      "type": "object",
      "description": "File metadata.",
      "properties": {
        "title": {
          "type": "string",
          "description": "Metadata title."
        },
        "caption": {
          "type": "string",
          "description": "Metadata caption."
        },
        "copyright": {
          "type": "string",
          "description": "Metadata copyright notice."
        },
        "created": {
          "type": "string",
          "description": "Metadata creation time."
        },
        "city": {
          "type": "string",
          "description": "Metadata city."
        },
        "country": {
          "type": "string",
          "description": "Metadata country."
        },
        "state": {
          "type": "string",
          "description": "Metadata state."
        },
        "camera": {
          "type": "string",
          "description": "Camera model in the metadata."
        },
        "exposure": {
          "type": "string",
          "description": "Exposure setting in the metadata."
        },
        "iso": {
          "type": "string",
          "description": "ISO setting in the metadata."
        },
        "fstop": {
          "type": "string",
          "description": "F-stop setting in the metadata."
        },
        "focal_length": {
          "type": "string",
          "description": "Focal length in the metadata."
        },
        "size": {
          "type": "string",
          "description": "Size value in the metadata."
        }
      }
    },
    "mime": {
      "type": "string",
      "description": "MIME type of the file."
    },
    "size": {
      "type": "integer",
      "description": "Size of the file."
    },
    "transcoding": {
      "type": "array",
      "description": "Transcoded file variants. Empty when the file is not a video.",
      "items": {
        "type": "object",
        "properties": {
          "basename": {
            "type": "string",
            "description": "Basename of the transcoded file."
          },
          "download_link": {
            "type": "string",
            "description": "Download URL for the transcoded file."
          },
          "extension": {
            "type": "string",
            "description": "File extension of the transcoded file."
          },
          "timestamp": {
            "type": "integer",
            "description": "Unix timestamp of the transcoded file's last modification."
          },
          "size": {
            "type": "integer",
            "description": "Size of the transcoded file."
          },
          "etag": {
            "type": "string",
            "description": "ETag of the transcoded file."
          }
        }
      }
    }
  }
}