{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ledger.abivia.com/api/json/codeselect.schema.json",
  "title": "Code range selector list",
  "description": "A list of code range selectors for queries.",
  "type": "array",
  "oneOf": [
    {
      "items": [
        {
          "type": "string",
          "description": "A single code to be contained in the results."
        }
      ]
    },
    {
      "items": [
        {
          "type": "array",
          "maxItems": 3,
          "minItems": 2,
          "prefixItems": [
            {
              "enum": ["!", "*", "!*"],
              "description": "Operator to specify a range exclusion."
            }
          ],
          "items": [
            {
              "type": "string",
              "description": "The starting code in a range, empty string for an open range beginning."
            },
            {
              "type": "string",
              "description": "The ending code in a range, empty string for an open range ending."
            }
          ]
        }
      ]
    }
  ]
}
