{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/barcodes-gg/main/json-schema/barcodes-gg-barcode-schema.json",
  "title": "Barcode",
  "description": "A barcode as returned by the barcode lookup.",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/barcodes-gg-openapi.json#/components/schemas/Barcode",
  "type": "object",
  "properties": {
    "barcode_type": {
      "type": "string",
      "description": "Stored symbology, for example GTIN12 (UPC-A) or GTIN13 (EAN-13)."
    },
    "barcode_value": {
      "type": "string",
      "description": "Barcode digits as stored."
    },
    "barcode_added": {
      "type": [
        "string",
        "null"
      ],
      "description": "When the barcode was added, if recorded."
    },
    "product_size": {
      "$ref": "#/$defs/Size"
    }
  },
  "$defs": {
    "Size": {
      "type": "object",
      "description": "Size of the item a barcode belongs to, per sizing region. Other regional keys (for example `us w`) can be present.",
      "properties": {
        "us": {
          "type": [
            "string",
            "number",
            "null"
          ]
        },
        "uk": {
          "type": [
            "string",
            "number",
            "null"
          ]
        },
        "eu": {
          "type": [
            "string",
            "number",
            "null"
          ]
        }
      },
      "additionalProperties": true
    }
  }
}