Tyk - request body is forwarded without being transformed

I am new to api gateways and I wanted to try to use Tyk product I installed the docker version and created an api using the documentation

I tried to do a transformation using templates but the request was forwarded without any transformation

here is the Api configuration

{
    "name": "Hello-World",
    "slug": "hello-world",
    "api_id": "Hello-World",
    "org_id": "1",
    "use_keyless": true,
    "auth": {
      "auth_header_name": "Authorization"
    },
    "definition": {
      "location": "header",
      "key": "x-api-version"
    },
    "version_data": {
      "not_versioned": true,
      "versions": {
          "Default": {
              "name": "Default",
              "use_extended_paths": true
          },
      "extended_paths": {
          "transform": [
            {
              "path": "/widgets",
              "method": "POST",
              "template_data": {
                "template_mode": "file",
                "template_source": "./templates/transform_test.tmpl"
              }
              
            }
          ]
        }
      
      }    
  },
  
    "proxy": {
      "listen_path": "/widgets",
      "target_url": "http://7857-102-158-57-156.ngrok.io/api/v1",
      "strip_listen_path": true
    },
    "active": true
}

The target_url is pointing to dummy express service that responds with the request body.

here is the template I am using

{
  "value1": "{{.value2}}",
  "value2": "{{.value1}}",
  "transformed_list": [
    {{range $index, $element := .value_list}}
        {{if $index}}
        , "{{$element}}"
        {{else}}
          "{{$element}}"
        {{end}}
    {{end}}
  ]
}

and this is the input I am trying to transform

{
  "value1": "value-1",
  "value2": "value-2",
  "value_list": [
    "one",
    "two",
    "three"
  ]
} 

There is an issue with your API definition file. The extended_paths section should be a child of Default. For example

{
	"version_data": {
		"not_versioned": true,
		"versions": {
			"Default": {
				"name": "Default",
				"use_extended_paths": true,
				"extended_paths": {
					"transform": [
						{
							"path": "/widgets",
							"method": "POST",
							"template_data": {
								"template_mode": "file",
								"template_source": "./templates/transform_test.tmpl"
							}
						}
					]
				}
			}
		}
	}
}

Try again and let us know if it works now