{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/rc3-request-0.0.3.json",
  "$defs": {
    "nvp": {
      "type": "object",
      "properties": {
        "name": { "type": "string" }
      },
      "additionalProperties": { "type": "string" }
    }
  },
  "title": "rc3 request",
  "description": "RC request information",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "The JSON schema to use for validation",
      "type": "string"
    },
    "comment": {
      "description": "A comment to provide documentation for this request",
      "type": "string"
    },
    "method": {
      "description": "The HTTP method to use for this request",
      "type": "string",
      "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
    },
    "url": {
      "description": "The URL to use for this request",
      "type": "string"
    },
    "params": {
      "$ref": "#/$defs/nvp",
      "description": "The query parameters to send with this request"
    },
    "form_data": {
      "$ref": "#/$defs/nvp",
      "description": "Form x-www-form-urlencoded data to pass in the request body"
    },
    "auth": {
      "$ref": "https://json.schemastore.org/rc3-auth-0.0.3.json"
    },
    "headers": {
      "$ref": "#/$defs/nvp",
      "description": "The HTTP headers to send with this request"
    },
    "body": {
      "description": "The body of the request",
      "type": "object",
      "properties": {
        "text": { "type": "string" },
        "json": { "type": "object" }
      },
      "additionalProperties": false
    },
    "save_responses": {
      "description": "Whether to save .response files in the same dir as the .request file",
      "type": "boolean"
    },
    "extract": {
      "description": "JSON node, or Text pattern (with regex group) to extract from response",
      "type": "object",
      "properties": {
        "json_path": {
          "description": "A JSON Path expression to extract a single field from JSON",
          "type": "string"
        },
        "text_pattern": {
          "description": "A Python regex pattern with a single REGEX GROUP to be extracted from the response",
          "type": "string"
        },
        "env": {
          "description": "Choose to store the extracted field in either the global env (default), or currently selected env from your collection",
          "type": "string",
          "enum": ["global", "current"]
        },
        "var": {
          "description": "The var name (default is token) in the environment to store the extracted value in",
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "type": "object"
}
