{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "RARA public catalog snapshot",
  "type": "object",
  "required": [
    "version",
    "revision",
    "items"
  ],
  "properties": {
    "version": {
      "type": "string"
    },
    "revision": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "url",
          "category",
          "kind",
          "price",
          "availability",
          "tags"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string"
          },
          "category": {
            "enum": [
              "food",
              "textile",
              "object",
              "experience"
            ]
          },
          "kind": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "availability": {
            "type": "string",
            "description": "Recorded status, not live stock. Consult response facets for accepted values."
          },
          "price": {
            "type": "object",
            "required": [
              "amount",
              "currency",
              "unit",
              "verified"
            ],
            "properties": {
              "amount": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "unit": {
                "type": "string"
              },
              "verified": {
                "type": "boolean"
              }
            }
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Original source. Follow it to verify stock, delivery and current price."
          },
          "sourceCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recorded research date, not a live inventory check."
          },
          "tagline": {
            "type": "string"
          },
          "where": {
            "type": "string"
          },
          "img": {
            "type": "string"
          },
          "provenance": {
            "type": [
              "object",
              "null"
            ],
            "description": "Publisher and recorded retrieval evidence; not independent verification."
          },
          "origin": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "code",
              "name",
              "flag",
              "basis",
              "evidence",
              "sourceUrl"
            ],
            "properties": {
              "code": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "name": {
                "type": "string"
              },
              "flag": {
                "type": "string"
              },
              "basis": {
                "type": "string"
              },
              "evidence": {
                "type": "string"
              },
              "sourceUrl": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}