{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/RouteExpression",
  "title": "RouteExpression",
  "x-speakeasy-entity": "RouteExpression",
  "description": "Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated to it. Every request matching a given Route will be proxied to its associated Service. The combination of Routes and Services (and the separation of concerns between them) offers a powerful routing mechanism with which it is possible to define fine-grained entry-points in Kong leading to different upstream services of your infrastructure. You need at least one matching rule that applies to the protocol being matched by the Route.",
  "type": "object",
  "properties": {
    "created_at": {
      "description": "Unix epoch when the resource was created.",
      "type": "integer",
      "nullable": true
    },
    "expression": {
      "description": "Use Router Expression to perform route match. This option is only available when `router_flavor` is set to `expressions`.",
      "type": "string",
      "nullable": true
    },
    "https_redirect_status_code": {
      "description": "The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is `HTTP` instead of `HTTPS`. `Location` header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol.",
      "type": "integer",
      "default": 426,
      "enum": [
        301,
        302,
        307,
        308,
        426
      ],
      "nullable": true
    },
    "id": {
      "description": "A string representing a UUID (universally unique identifier).",
      "type": "string",
      "nullable": true
    },
    "name": {
      "description": "The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named \"test\" and \"Test\".",
      "type": "string",
      "nullable": true
    },
    "path_handling": {
      "description": "Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior.",
      "type": "string",
      "default": "v0",
      "enum": [
        "v0",
        "v1"
      ],
      "nullable": true
    },
    "preserve_host": {
      "description": "When matching a Route via one of the `hosts` domain names, use the request `Host` header in the upstream request headers. If set to `false`, the upstream `Host` header will be that of the Service's `host`.",
      "type": "boolean",
      "default": false,
      "nullable": true
    },
    "priority": {
      "description": "A number used to specify the matching order for expression routes. The higher the `priority`, the sooner an route will be evaluated. This field is ignored unless `expression` field is set.",
      "type": "integer",
      "default": 0,
      "maximum": 70368744177663,
      "minimum": 0,
      "nullable": true
    },
    "protocols": {
      "description": "An array of the protocols this Route should allow. See the [Route Object](#route-object) section for a list of accepted protocols. When set to only `\"https\"`, HTTP requests are answered with an upgrade error. When set to only `\"http\"`, HTTPS requests are answered with an error.",
      "type": "array",
      "items": {
        "description": "A string representing a protocol, such as HTTP or HTTPS.",
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https",
          "tcp",
          "tls",
          "tls_passthrough",
          "udp",
          "ws",
          "wss"
        ],
        "type": "string"
      },
      "default": [
        "https"
      ],
      "minLength": 1,
      "nullable": true
    },
    "request_buffering": {
      "description": "Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding.",
      "type": "boolean",
      "default": true,
      "nullable": true
    },
    "response_buffering": {
      "description": "Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding.",
      "type": "boolean",
      "default": true,
      "nullable": true
    },
    "service": {
      "description": "The Service this Route is associated to. This is where the Route proxies traffic to.",
      "type": "object",
      "nullable": true,
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "x-foreign": true
    },
    "strip_path": {
      "description": "When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL.",
      "type": "boolean",
      "default": true,
      "nullable": true
    },
    "tags": {
      "description": "An optional set of strings associated with the Route for grouping and filtering.",
      "type": "array",
      "items": {
        "description": "A string representing a tag.",
        "type": "string"
      },
      "nullable": true
    },
    "updated_at": {
      "description": "Unix epoch when the resource was last updated.",
      "type": "integer",
      "nullable": true
    }
  },
  "additionalProperties": false
}