{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/createprints-ai/json-schema/createprints-ai-print-search-result-schema.json",
  "title": "PrintSearchResult",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/createprints-ai-openapi.yml#/components/schemas/PrintSearchResult",
  "type": "object",
  "required": [
    "prints",
    "total",
    "limit",
    "offset",
    "hasMore",
    "sort"
  ],
  "properties": {
    "prints": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CataloguePrint"
      }
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Full match count, so a pager needs no second request."
    },
    "limit": {
      "type": "integer"
    },
    "offset": {
      "type": "integer"
    },
    "hasMore": {
      "type": "boolean"
    },
    "sort": {
      "type": "string",
      "enum": [
        "relevance",
        "newest",
        "oldest",
        "featured",
        "similar"
      ]
    },
    "q": {
      "type": [
        "string",
        "null"
      ]
    },
    "appliedFilters": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "facets": {
      "$ref": "#/$defs/PrintSearchFacets"
    },
    "truncated": {
      "type": "boolean",
      "description": "Present only when the catalogue outgrew the search index and the answer is partial."
    }
  },
  "$defs": {
    "CataloguePrint": {
      "type": "object",
      "required": [
        "id",
        "imagePaths"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Use this as `jobId` when creating a checkout."
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "imagePaths": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "colorCategory": {
          "type": [
            "string",
            "null"
          ]
        },
        "recommendedRoom": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "colorPsychologyPrimaryTrait": {
          "type": [
            "string",
            "null"
          ]
        },
        "colorPsychologyImpactLevel": {
          "type": [
            "string",
            "null"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "paletteColors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Named colours extracted from the artwork. The `palette` filter also matches on colorCategory, so it can match a print whose list here is empty."
        },
        "createdAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "width": {
          "type": [
            "integer",
            "null"
          ]
        },
        "height": {
          "type": [
            "integer",
            "null"
          ]
        },
        "aspectRatio": {
          "type": [
            "number",
            "null"
          ]
        },
        "orientation": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "portrait",
            "landscape",
            "square",
            null
          ]
        }
      }
    },
    "FacetOption": {
      "type": "object",
      "required": [
        "value",
        "slug",
        "count",
        "selected"
      ],
      "properties": {
        "value": {
          "type": "string",
          "description": "Pass this back as the filter value."
        },
        "slug": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "Prints this value would yield alongside the other filters already applied. Zero means the combination is empty."
        },
        "selected": {
          "type": "boolean"
        }
      }
    },
    "PrintSearchFacets": {
      "type": "object",
      "description": "Available values per attribute. A facet's counts ignore that facet's own selection, so a second value can always be added to widen the search.",
      "properties": {
        "colour": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        },
        "room": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        },
        "trait": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        },
        "impact": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        },
        "keyword": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        },
        "palette": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FacetOption"
          }
        }
      }
    }
  }
}