{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-migration-hub/json-schema/amazon-migration-hub-create-route-request-schema.json",
  "title": "CreateRouteRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-migration-hub-routes-api-openapi.yml#/components/schemas/CreateRouteRequest",
  "type": "object",
  "properties": {
    "EnvironmentIdentifier": {
      "type": "string",
      "description": "The ID of the environment in which the route is created."
    },
    "ApplicationIdentifier": {
      "type": "string",
      "description": "The ID of the application within which the route is being created."
    },
    "ServiceIdentifier": {
      "type": "string",
      "description": "The ID of the service in which the route is created. Traffic that matches this route is forwarded to this service."
    },
    "RouteType": {
      "type": "string",
      "description": "The route type of the route. DEFAULT indicates that all traffic that does not match another route is forwarded to the default route. Applications must have a default route before any other routes can be created. URI_PATH indicates a route that is based on a URI path."
    },
    "DefaultRoute": {
      "$ref": "#/$defs/DefaultRouteInput"
    },
    "UriPathRoute": {
      "$ref": "#/$defs/UriPathRouteInput"
    },
    "Tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags to assign to the route. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.."
    },
    "ClientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request."
    }
  },
  "required": [
    "EnvironmentIdentifier",
    "ApplicationIdentifier",
    "ServiceIdentifier",
    "RouteType"
  ],
  "$defs": {
    "DefaultRouteInput": {
      "type": "object",
      "properties": {
        "ActivationState": {
          "type": "string",
          "description": "If set to ACTIVE, traffic is forwarded to this route’s service after the route is created."
        }
      }
    },
    "UriPathRouteInput": {
      "type": "object",
      "properties": {
        "SourcePath": {
          "type": "string",
          "description": "This is the path that Refactor Spaces uses to match traffic. Paths must start with / and are relative to the base of the application. To use path parameters in the source path, add a variable in curly braces. For example, the resource path {user} represents a path parameter called 'user'."
        },
        "ActivationState": {
          "type": "string",
          "description": "If set to ACTIVE, traffic is forwarded to this route’s service after the route is created."
        },
        "Methods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of HTTP methods to match. An empty list matches all values. If a method is present, only HTTP requests using that method are forwarded to this route’s service."
        },
        "IncludeChildPaths": {
          "type": "boolean",
          "description": "Indicates whether to match all subpaths of the given source path. If this value is false, requests must match the source path exactly before they are forwarded to this route's service."
        },
        "AppendSourcePath": {
          "type": "boolean",
          "description": "If set to true, this option appends the source path to the service URL endpoint."
        }
      },
      "required": [
        "SourcePath",
        "ActivationState"
      ]
    }
  }
}