KrakenD · Schema

KrakenD Backend

A Backend defines a target service that a KrakenD endpoint connects to, including the host, URL pattern, encoding, and data manipulation settings.

AggregationAPI GatewayGoOpen Source

Properties

Name Type Description
host array List of backend host URLs. Overrides the service-level host list.
url_pattern string The URL path to request on the backend. Supports parameter placeholders.
encoding string The encoding of the backend response.
sd string Service discovery method. Static resolves at startup, DNS resolves per request.
method string HTTP method to use when calling the backend. Defaults to the endpoint method.
group string Wraps the backend response under this key name for response merging.
target string Extracts a nested object from the backend response using this key.
mapping object Renames backend response fields. Key is original name, value is new name.
allow array Whitelist of fields to include from the backend response.
deny array Blacklist of fields to exclude from the backend response.
is_collection boolean Set to true when the backend response is an array instead of an object.
extra_config object Additional component configurations keyed by namespace.
View JSON Schema on GitHub

JSON Schema

backend.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/krakend/blob/main/json-schema/backend.json",
  "title": "KrakenD Backend",
  "description": "A Backend defines a target service that a KrakenD endpoint connects to, including the host, URL pattern, encoding, and data manipulation settings.",
  "type": "object",
  "required": ["url_pattern"],
  "properties": {
    "host": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of backend host URLs. Overrides the service-level host list."
    },
    "url_pattern": {
      "type": "string",
      "description": "The URL path to request on the backend. Supports parameter placeholders."
    },
    "encoding": {
      "type": "string",
      "enum": ["json", "safejson", "xml", "rss", "string", "no-op"],
      "description": "The encoding of the backend response."
    },
    "sd": {
      "type": "string",
      "enum": ["static", "dns"],
      "description": "Service discovery method. Static resolves at startup, DNS resolves per request."
    },
    "method": {
      "type": "string",
      "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"],
      "description": "HTTP method to use when calling the backend. Defaults to the endpoint method."
    },
    "group": {
      "type": "string",
      "description": "Wraps the backend response under this key name for response merging."
    },
    "target": {
      "type": "string",
      "description": "Extracts a nested object from the backend response using this key."
    },
    "mapping": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Renames backend response fields. Key is original name, value is new name."
    },
    "allow": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Whitelist of fields to include from the backend response."
    },
    "deny": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Blacklist of fields to exclude from the backend response."
    },
    "is_collection": {
      "type": "boolean",
      "default": false,
      "description": "Set to true when the backend response is an array instead of an object."
    },
    "extra_config": {
      "type": "object",
      "description": "Additional component configurations keyed by namespace."
    }
  }
}