{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-s3/json-schema/amazon-s3-get-bucket-website-output-schema.json",
  "title": "GetBucketWebsiteOutput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-s3-website-api-openapi.yml#/components/schemas/GetBucketWebsiteOutput",
  "type": "object",
  "properties": {
    "RedirectAllRequestsTo": {
      "$ref": "#/$defs/RedirectAllRequestsTo"
    },
    "IndexDocument": {
      "$ref": "#/$defs/IndexDocument"
    },
    "ErrorDocument": {
      "$ref": "#/$defs/ErrorDocument"
    },
    "RoutingRules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RoutingRule"
      },
      "description": "Rules that define when a redirect is applied and the redirect behavior."
    }
  },
  "$defs": {
    "Condition": {
      "type": "object",
      "properties": {
        "HttpErrorCodeReturnedEquals": {
          "type": "string",
          "description": "The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied."
        },
        "KeyPrefixEquals": {
          "type": "string",
          "description": "The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied. Replacement must be made for object keys containing special characters (such as carriage returns) when using XM"
        }
      }
    },
    "ErrorDocument": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The object key name to use when a 4XX class error occurs. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints."
        }
      },
      "required": [
        "Key"
      ]
    },
    "IndexDocument": {
      "type": "object",
      "properties": {
        "Suffix": {
          "type": "string",
          "description": "A suffix that is appended to a request that is for a directory on the website endpoint. (For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html.) The suffix must not be empty and must not include a slash character. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints."
        }
      },
      "required": [
        "Suffix"
      ]
    },
    "Redirect": {
      "type": "object",
      "properties": {
        "HostName": {
          "type": "string",
          "description": "The host name to use in the redirect request."
        },
        "HttpRedirectCode": {
          "type": "string",
          "description": "The HTTP redirect code to use on the response. Not required if one of the siblings is present."
        },
        "Protocol": {
          "type": "string",
          "enum": [
            "http",
            "https"
          ],
          "description": "Protocol to use when redirecting requests. The default is the protocol that is used in the original request."
        },
        "ReplaceKeyPrefixWith": {
          "type": "string",
          "description": "The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints."
        },
        "ReplaceKeyWith": {
          "type": "string",
          "description": "The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints."
        }
      }
    },
    "RedirectAllRequestsTo": {
      "type": "object",
      "properties": {
        "HostName": {
          "type": "string",
          "description": "Name of the host where requests are redirected."
        },
        "Protocol": {
          "type": "string",
          "enum": [
            "http",
            "https"
          ],
          "description": "Protocol to use when redirecting requests. The default is the protocol that is used in the original request."
        }
      },
      "required": [
        "HostName"
      ]
    },
    "RoutingRule": {
      "type": "object",
      "properties": {
        "Condition": {
          "$ref": "#/$defs/Condition"
        },
        "Redirect": {
          "$ref": "#/$defs/Redirect"
        }
      },
      "required": [
        "Redirect"
      ]
    }
  }
}