{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.krakend.io/schema/v2.2/modifier/body-generator.json",
  "title": "Template-based body generator",
  "description": "Enterprise only. Crafts the body sent to the backend service using user input and other variables through a templating system.\n\nSee: https://www.krakend.io/backends/body-generator/",
  "type": "object",
  "oneOf": [
    {
      "required": [ "path" ]
    },
    {
      "required": [ "template" ]
    }
  ],
  "properties": {
    "content_type": {
      "title": "Content-Type",
      "description": "The `Content-Type` used in your template, and that will be sent to the backend service. This is not the content-type the end-user sent in the request.\n\nSee: https://www.krakend.io/docs/enterprise/backends/body-generator/",
      "examples": [ "application/json", "application/xml", "text/xml" ],
      "default": "application/json",
      "type": "string"
    },
    "debug": {
      "title": "Enable debug",
      "description": "When `true`, shows useful information in the logs with `DEBUG` level about the input received and the body generated. Do not enable in production. Debug logs are multiline and designed fore developer readibility, not machine processing.\n\nSee: https://www.krakend.io/docs/enterprise/backends/body-generator/",
      "default": false,
      "type": "boolean"
    },
    "path": {
      "title": "Path to template",
      "description": "The path to the Go template file you want to use to craft the body.\n\nSee: https://www.krakend.io/docs/enterprise/backends/body-generator/",
      "examples": [ "./path/to.xml" ],
      "type": "string"
    },
    "template": {
      "title": "Template",
      "description": "An inline base64 encoded Go template with the body content you want to send to the backend service. This option is useful if you don't want to rely on external files and embed the template in the configuration.\n\nSee: https://www.krakend.io/docs/enterprise/backends/body-generator/",
      "type": "string"
    }
  },
  "patternProperties": {
    "^[@$_#]": {}
  },
  "additionalProperties": false
}
