{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "schema_read input",
  "description": "schema_read input: list, load.",
  "type": "object",
  "required": [
    "action"
  ],
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "list",
        "load"
      ],
      "description": "Choose list, load."
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "action": {
            "type": "string",
            "const": "load"
          }
        },
        "required": [
          "action"
        ]
      },
      "then": {
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "action": {
            "type": "string",
            "const": "load"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "Saved schema name in slug format."
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "type": "string",
            "const": "list"
          }
        },
        "required": [
          "action"
        ]
      },
      "then": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "const": "list"
          },
          "object": {
            "type": "string",
            "minLength": 1
          },
          "context": {
            "type": "string",
            "minLength": 1
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  ]
}
