{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pexafy/json-schema/pexafy-collection-response-schema.json",
  "title": "CollectionResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pexafy-collections-api-openapi.yml#/components/schemas/CollectionResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "allOf": [
        {
          "$ref": "#/$defs/Collection_2"
        },
        {
          "type": "object",
          "properties": {
            "photos": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/CollectionItem_2"
              }
            }
          }
        }
      ]
    },
    "meta": {
      "$ref": "#/$defs/Meta_2"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ApiError"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ApiError": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Machine-readable error code (e.g. `MISSING_PARAMS`, `PHOTO_NOT_FOUND`)."
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message."
        },
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "CollectionItem_2": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "photo_id": {
          "type": "string"
        },
        "photo_thumbnail_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "photo_source": {
          "type": [
            "string",
            "null"
          ]
        },
        "photo_photographer": {
          "type": [
            "string",
            "null"
          ]
        },
        "added_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Collection_2": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_public": {
          "type": "boolean"
        },
        "cover_photo_id": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "photos_count": {
          "type": "integer"
        }
      }
    },
    "Meta_2": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string",
          "description": "Unique id for this request (quote it in support tickets)."
        },
        "took_ms": {
          "type": "number",
          "description": "Server processing time in milliseconds."
        }
      }
    }
  }
}