{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/opoint/json-schema/opoint-stored-search-patch-schema.json",
  "title": "StoredSearchPatch",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/opoint-stored-search-api-openapi.yml#/components/schemas/StoredSearchPatch",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "search": {
      "type": "string"
    },
    "last_new_article": {
      "type": "integer",
      "readOnly": true
    },
    "access_group": {
      "$ref": "#/$defs/AccessGroupSchema"
    },
    "max_age": {
      "type": "integer",
      "default": 345600
    },
    "get_old_articles": {
      "type": "boolean",
      "default": false
    },
    "use_syndicates": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "last_new_article"
  ],
  "$defs": {
    "AccessGroupSchema": {
      "type": "object",
      "properties": {
        "access_groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccessInfoSchema"
          }
        },
        "sites": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccessInfoSchema"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccessInfoSchema"
          }
        }
      },
      "required": [
        "access_groups",
        "sites",
        "sources"
      ]
    },
    "AccessInfoSchema": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "value": {
          "type": "integer"
        }
      },
      "required": [
        "enabled",
        "name",
        "value"
      ]
    }
  }
}