{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/useanyfile-com/json-schema/useanyfile-com-file-schema.json",
  "title": "File",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/useanyfile-com-openapi.yml#/components/schemas/File",
  "allOf": [
    {
      "allOf": [
        {
          "$ref": "#/$defs/FileSummary"
        },
        {
          "type": "object",
          "required": [
            "createdAt",
            "share"
          ],
          "properties": {
            "createdAt": {
              "type": "string",
              "format": "date-time"
            },
            "share": {
              "$ref": "#/$defs/FileShareSummary"
            }
          }
        }
      ]
    },
    {
      "type": "object",
      "required": [
        "folderId",
        "folder"
      ],
      "properties": {
        "folderId": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 100
        },
        "folder": {
          "anyOf": [
            {
              "$ref": "#/$defs/Folder"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  ],
  "$defs": {
    "FileShareSummary": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "publicId": {
          "type": "string"
        },
        "publicUrl": {
          "type": "string",
          "format": "uri"
        },
        "isActive": {
          "type": "boolean"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "viewCount": {
          "type": "integer",
          "minimum": 0
        },
        "downloadCount": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "FileSummary": {
      "type": "object",
      "required": [
        "id",
        "name",
        "contentType",
        "size"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "contentType": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "Folder": {
      "type": "object",
      "required": [
        "id",
        "name",
        "fileCount",
        "requestCount"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "fileCount": {
          "type": "integer",
          "minimum": 0
        },
        "requestCount": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}