{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tale-dev/json-schema/tale-dev-product-input-schema.json",
  "title": "ProductInput",
  "description": "`name` is required on create; every field is optional on update. Strings are trimmed, and a blank optional field — or one sent as `null` — reads as left out. Unknown keys are refused (`INVALID_BODY`).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tale-dev-products-api-openapi.yml#/components/schemas/ProductInput",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Trimmed; a blank name is refused"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 4000,
      "description": "Trimmed"
    },
    "imageUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 2048,
      "description": "An absolute http(s) URL, trimmed; any other value (a relative path, a `javascript:` or `ftp:` URL) answers 400. The host is held to the crawl-target rule by name and by IP literal — loopback, link-local, private-network (RFC 1918, CGNAT, ULA, `.internal`/`.lan`-style suffixes, single-label names) and cloud metadata hosts answer 400 `INVALID_BODY` — as a string, without a DNS lookup: a public name that resolves to a private address passes here. The platform never fetches the URL; the rule keeps a stored URL from becoming a server-side request later. `TALE_ALLOW_PRIVATE_CRAWL_HOSTS=1` lifts the private-network half, never the metadata half. Exception: an exact managed product-image URL returned by this deployment may be replayed, including on a private deployment. It must name registered image metadata in this organization that the caller uploaded or a current product already uses; a missing or inaccessible image answers 404 `FILE_NOT_FOUND`. The app accepts inspected PNG, JPEG, WebP, GIF, or SVG uploads up to 5 MiB. Its bytes require an authorized app session; an API key does not authorize this app route."
    },
    "stock": {
      "type": [
        "number",
        "null"
      ],
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "price": {
      "type": [
        "number",
        "null"
      ],
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[A-Za-z]{3}$",
      "minLength": 3,
      "maxLength": 3,
      "description": "An ISO 4217 code (`USD`, `EUR`) — any case in, stored uppercase; a code the platform does not know answers 400"
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100,
      "description": "Trimmed"
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "maxLength": 60,
        "description": "Trimmed"
      },
      "maxItems": 50
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "active",
        "inactive",
        "draft",
        "archived",
        null
      ]
    },
    "externalId": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 256,
      "description": "Trimmed"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "maxProperties": 500,
      "description": "Free-form. On PATCH it MERGES per RFC 7396 — sent keys are set, omitted keys stay, a key sent as `null` is removed, and the whole field sent as `null` clears it. At most 64 KiB of JSON, 8 levels of nesting and 500 keys in total (every nested object counted); a larger value answers 400 `INVALID_BODY` naming the path."
    }
  }
}