{
  "$id": "https://schemas.binaryedge.io/minion/modules/webv2",
  "title": "Web v2 Module Output Body",
  "type": "object",
  "properties": {
    "apps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/app"
      }
    },
    "request": {
      "$ref": "#/$defs/request"
    },
    "response": {
      "$ref": "#/$defs/response"
    }
  },
  "required": [
    "request",
    "response"
  ],
  "additionalProperties": false,
  "$defs": {
    "app": {
      "type": "object",
      "properties": {
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "confidence": {
          "type": "number"
        },
        "cpe": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "body": {
      "$comment": "Corresponds to the OutputBody class.",
      "type": "object",
      "properties": {
        "content": {
          "type": "string"
        },
        "link": {
          "$comment": "URL of an object containing the response body in an S3 bucket",
          "type": "string",
          "format": "uri"
        },
        "sha256_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "ssdeep_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]+$"
        }
      },
      "required": [
        "sha256_hash",
        "ssdeep_hash"
      ],
      "additionalProperties": false
    },
    "headers": {
      "$comment": "Corresponds to the OutputHeaders class.",
      "type": "object",
      "properties": {
        "headers": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "header_order": {
          "type": "string"
        },
        "header_order_md5_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{32}$"
        }
      },
      "required": [
        "headers",
        "header_order",
        "header_order_md5_hash"
      ],
      "additionalProperties": false
    },
    "request": {
      "type": "object",
      "properties": {
        "headers": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "method": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "headers",
        "method",
        "path",
        "url"
      ],
      "additionalProperties": false
    },
    "favicon": {
      "$comment": "Corresponds to the OutputFavicon class.",
      "type": "object",
      "properties": {
        "content": {
          "type": "string"
        },
        "link": {
          "$comment": "This value is often not a link, so it cannot have the `uri` format.",
          "type": "string"
        },
        "md5_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{32}$"
        },
        "mimetype": {
          "type": "string"
        },
        "mmh3_hash": {
          "type": "integer"
        }
      },
      "required": [
        "link",
        "mimetype"
      ],
      "additionalProperties": false
    },
    "redirect": {
      "$comment": "Corresponds to the OutputRedirect class.",
      "type": "object",
      "properties": {
        "headers": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "redirect_uri": {
          "$comment": "This value is often not a link, so it cannot have the `uri` format.",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/redirect_status"
        }
      },
      "required": [
        "headers",
        "redirect_uri",
        "status"
      ],
      "additionalProperties": false
    },
    "redirect_status": {
      "$comment": "Corresponds to the OutputRedirectStatus class.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false
    },
    "rendered": {
      "$comment": "Corresponds to the OutputRendered class.",
      "type": "object",
      "properties": {
        "content": {
          "type": "string"
        },
        "link": {
          "$comment": "URL of an object containing the response body in an S3 bucket",
          "type": "string",
          "format": "uri"
        },
        "screenshot": {
          "$comment": "URL of an object containing an image of the rendered page in an S3 bucket",
          "type": "string",
          "format": "uri"
        },
        "sha256_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "ssdeep_hash": {
          "type": "string",
          "pattern": "^[0-9a-f]+$"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "response": {
      "type": "object",
      "properties": {
        "body": {
          "$ref": "#/$defs/body"
        },
        "favicon": {
          "$ref": "#/$defs/favicon"
        },
        "fragile": {
          "type": "string"
        },
        "headers": {
          "$ref": "#/$defs/headers"
        },
        "path": {
          "type": "string"
        },
        "protocol_version": {
          "$comment": "Indicates whether the server responded with HTTP/1.0 or HTTP/1.1.",
          "type": "string",
          "enum": [
            "HTTP/1.0",
            "HTTP/1.1"
          ]
        },
        "redirects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/redirect"
          }
        },
        "rendered": {
          "$ref": "#/$defs/rendered"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "title": {
          "type": "string"
        },
        "url": {
          "$content": "The data does not always contain a valid URI.",
          "type": "string"
        }
      },
      "required": [
        "body",
        "headers",
        "path",
        "protocol_version",
        "redirects",
        "status",
        "url"
      ],
      "additionalProperties": false
    },
    "status": {
      "$comment": "Corresponds to the OutputStatus class.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  }
}
