{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/case_schema.json",
  "definitions": {
    "request_body": {
      "type": "object"
    },
    "provider_data": {
      "type": "object",
      "description": "api or sql return data for later use",
      "properties": {
        "provider_type": {
          "type": "string",
          "default": "sql"
        },
        "provider_db": {
          "type": "string"
        },
        "api_id": {
          "type": "string"
        },
        "provider_sql": {
          "type": "string"
        },
        "request_body": {
          "$ref": "#/definitions/request_body"
        }
      }
    },
    "provider_datas": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/provider_data"
      }
    },
    "ready_data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "default": "sql"
        },
        "content": {
          "type": "string"
        }
      }
    }
  },
  "properties": {
    "api": {
      "title": "api url info",
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "default": "https://dev-api.qiandao.cn"
        },
        "uri": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "header": {
          "type": "string"
        }
      }
    },
    "template": {
      "title": "set up data for all request",
      "type": "object",
      "properties": {
        "headers": {
          "type": "object",
          "properties": {
            "authorization": {
              "type": "string"
            }
          }
        },
        "request_body": {
          "$ref": "#/definitions/request_body"
        },
        "provider_data": {
          "$ref": "#/definitions/provider_datas"
        }
      }
    },
    "cases": {
      "title": "cases to test",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "case_id": {
            "type": "string"
          },
          "sleep": {
            "type": "integer",
            "description": "sleep after the case execution"
          },
          "describe": {
            "type": "string"
          },
          "assert": {
            "type": "object"
          },
          "request_body": {
            "$ref": "#/definitions/request_body"
          },
          "provider_data": {
            "$ref": "#/definitions/provider_datas"
          },
          "set_up": {
            "$ref": "#/definitions/ready_data",
            "type": "object"
          },
          "tear_down": {
            "$ref": "#/definitions/ready_data",
            "type": "object"
          }
        }
      }
    }
  },
  "description": "a schema for auto api cases",
  "title": "case",
  "type": "object"
}
