{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-auto-crop-request-schema.json",
  "title": "AutoCropRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-photoshop-v2-openapi.yml#/components/schemas/AutoCropRequest",
  "required": [
    "image",
    "mode"
  ],
  "type": "object",
  "properties": {
    "aspectRatio": {
      "description": "Desired aspect ratio(s) for generated crops. Accepts either a single enum string or an array of up to 20 strings. Allowed only for 'smartCrop' and 'subjectCrop'. When omitted, the service defaults to 1:1. An empty array is treated as absent.",
      "oneOf": [
        {
          "$ref": "#/$defs/AutoCropAspectRatio"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AutoCropAspectRatio"
          }
        }
      ]
    },
    "focus": {
      "type": "array",
      "description": "Focus labels, ordered by preference, used to prioritize objects during cropping or as detection targets. Required for 'subjectCrop' and 'objectDetection'; must be empty for 'smartCrop' and 'fullSceneDetection'.",
      "items": {
        "type": "string"
      }
    },
    "image": {
      "$ref": "#/$defs/AutoCropInputImage"
    },
    "mode": {
      "$ref": "#/$defs/AutoCropMode"
    },
    "outputType": {
      "$ref": "#/$defs/AutoCropOutputType"
    },
    "zoom": {
      "description": "Optional zoom level(s) paired with aspectRatio. Accepts either a number or an array of up to 20 numbers in (0, 1]. Must not be sent without aspectRatio. When aspectRatio is an array, zoom may be omitted or must be a matching non-empty array.",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      ]
    }
  },
  "$defs": {
    "AutoCropAspectRatio": {
      "type": "string",
      "description": "Desired aspect ratio for generated crops.",
      "enum": [
        "1:1",
        "16:9",
        "9:16",
        "4:3",
        "3:4",
        "4:5",
        "5:4",
        "3:2",
        "2:3",
        "21:9"
      ]
    },
    "AutoCropImageMediaType": {
      "type": "string",
      "description": "The media type of the input image. Supported values are image/jpeg, image/png, and image/webp.",
      "enum": [
        "image/jpeg",
        "image/png",
        "image/webp"
      ]
    },
    "AutoCropInputImage": {
      "required": [
        "source"
      ],
      "type": "object",
      "properties": {
        "mediaType": {
          "$ref": "#/$defs/AutoCropImageMediaType"
        },
        "source": {
          "$ref": "#/$defs/AutoCropUrlResource"
        }
      },
      "description": "The input image for the auto-crop operation."
    },
    "AutoCropMode": {
      "type": "string",
      "description": "Mode for the auto crop operation. 'smartCrop' and 'subjectCrop' generate crops using aspectRatio with optional zoom. 'fullSceneDetection' and 'objectDetection' detect subjects or objects in the scene.",
      "enum": [
        "smartCrop",
        "subjectCrop",
        "fullSceneDetection",
        "objectDetection"
      ]
    },
    "AutoCropOutputType": {
      "type": "string",
      "description": "Output type for the auto crop operation. 'images' returns cropped images with presigned URLs (default). 'boundingBoxes' returns only bounding box coordinates.",
      "default": "images",
      "enum": [
        "images",
        "boundingBoxes"
      ]
    },
    "AutoCropUrlResource": {
      "required": [
        "url"
      ],
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "The URL of the resource. Only allow-listed domains are accepted as input URLs (e.g. amazonaws.com, windows.net, dropboxusercontent.com, assets.frame.io, storage.googleapis.com, adobe.io, azureedge.net)."
        }
      },
      "description": "The source of the input image."
    }
  }
}