### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

VTL template for request is not properly processed. 

Testing with sample project provided at https://github.com/localstack/localstack-terraform-samples/tree/master/apigateway-lambda-velocity several parameters of the request, such as path and identity are not properly parsed. 

For a request like this:

```
curl -X POST "0naclskncu.execute-api.localhost.localstack.cloud:4566/local/test" -H 'content-type: application/json' -d '{ "greeter": "cesar" }'
```

the result is:
```
{
"body": {"greeter": "cesar"},
"method": "POST",
"principalId": "",
"stage": "local",

"cognitoPoolClaims" : {

"sub": ""
},

"enhancedAuthContext":     {
}
,

"headers":     {
}
,

"query":     {
}
,

"path":     {

""proxy"":
""test""
}
,

"identity":     {

""accountId"":
"0"
,
""sourceIp"":
""172.17.0.1""
,
""userAgent"":
""curl/7.84.0""
}
,

"stageVariables":     {
}
,

"requestPath": "/{proxy+}"
}
```
Notice the extra double quotes on path and identity values which results in a non valid JSON document.

From the localstack logs:

```
botocore.errorfactory.UnsupportedMediaTypeException: An error occurred (UnsupportedMediaTypeException) when calling the Invoke operation: The payload is not JSON:


{
"body": {"greeter": "cesar"},
"method": "POST",
"principalId": "",
"stage": "local",

"cognitoPoolClaims" : {

"sub": ""
},

"enhancedAuthContext":     {
}
,

"headers":     {
}
,

"query":     {
}
,

"path":     {

""proxy"":
""test""
}
,

"identity":     {

""accountId"":
"0"
,
""sourceIp"":
""172.17.0.1""
,
""userAgent"":
""curl/7.84.0""
}
,

"stageVariables":     {
}
,

"requestPath": "/{proxy+}"
}

2022-11-16T09:47:17.833  INFO --- [   asgi_gw_0] localstack.request.http    : POST /local/test => 400; Request(b'{ "greeter": "cesar" }', headers={'Host': '0naclskncu.execute-api.localhost.localstack.cloud:4566', 'User-Agent': 'curl/7.84.0', 'Accept': '*/*', 'content-type': 'application/json', 'Content-Length': '22', 'x-localstack-tgt-api': 'apigateway'}); Response(b'{"Type": "User", "message": "Error invoking integration for API Gateway ID \'0naclskncu\': An error occurred (UnsupportedMediaTypeException) when calling the Invoke operation: The payload is not JSON:  \\n\\n  \\n  {\\n    \\"body\\": {\\"greeter\\": \\"cesar\\"},\\n    \\"method\\": \\"POST\\",\\n    \\"principalId\\": \\"\\",\\n    \\"stage\\": \\"local\\",\\n\\n    \\"cognitoPoolClaims\\" : {\\n\\n       \\"sub\\": \\"\\"\\n    },\\n\\n        \\"enhancedAuthContext\\":     {\\n        }\\n  ,\\n\\n        \\"headers\\":     {\\n        }\\n  ,\\n\\n        \\"query\\":     {\\n        }\\n  ,\\n\\n        \\"path\\":     {\\n    \\n                        \\"\\"proxy\\"\\":\\n          \\"\\"test\\"\\"\\n                  }\\n  ,\\n\\n        \\"identity\\":     {\\n    \\n                        \\"\\"accountId\\"\\":\\n          \\"0\\"\\n           ,     \\n                        \\"\\"sourceIp\\"\\":\\n          \\"\\"172.17.0.1\\"\\"\\n           ,     \\n                        \\"\\"userAgent\\"\\":\\n          \\"\\"curl/7.84.0\\"\\"\\n                  }\\n  ,\\n\\n        \\"stageVariables\\":     {\\n        }\\n  ,\\n\\n    \\"requestPath\\": \\"/{proxy+}\\"\\n  }\\n", "__type": "InvalidRequest"}', headers={'Content-Type': 'text/html; charset=utf-8', 'x-amzn-errortype': 'InvalidRequest', 'Content-Length': '1108', 'Connection': 'close'})
```

### Expected Behavior

The template should render a proper JSON document

### How are you starting LocalStack?

Custom (please describe below)

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    LS_LOG=trace-internal localstack start

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

    - localstack-terraform-samples/apigateway-lambda-velocity $ terraform init; terraform plan; terraform apply --auto-approve
   - localstack-terraform-samples/apigateway-lambda-velocity $ curl -X POST "9b2k2o2wd1.execute-api.localhost.localstack.cloud:4566/local/test" -H 'content-type: application/json' -d '{ "greeter": "cesar" }'

*** APIGW ID is taked from the terraform apply output


### Environment

```markdown
- OS: Macos 13.0.1
- LocalStack: 1.2.1.dev 
- Docker Desktop: v4.13.1
```


### Anything else?

Searching for velocity bug, I encountered bug https://github.com/localstack/localstack/issues/5587 which is resolved but actually the bug is still there.
path, details = get_resource_for_path("/foo/bar", {"/foo/{param1}": {}})
        self.assertEqual("/foo/{param1}", path)
        path, details = get_resource_for_path("/foo/bar", {"/foo/bar": {}, "/foo/{param1}": {}})
        self.assertEqual("/foo/bar", path)
        path, details = get_resource_for_path("/foo/bar/baz", {"/foo/bar": {}, "/foo/{proxy+}": {}})
        self.assertEqual("/foo/{proxy+}", path)
        path, details = get_resource_for_path(
            "/foo/bar/baz", {"/{proxy+}": {}, "/foo/{proxy+}": {}}
        )
        self.assertEqual("/foo/{proxy+}", path)
        result = get_resource_for_path("/foo/bar", {"/foo/bar1": {}, "/foo/bar2": {}})
        self.assertEqual(None, result)
        result = get_resource_for_path("/foo/bar", {"/{param1}/bar1": {}, "/foo/bar2": {}})
        self.assertEqual(None, result)
        path_args = {"/{param1}/{param2}/foo/{param3}": {}, "/{param}/bar": {}}
        path, details = get_resource_for_path("/foo/bar", path_args)
        self.assertEqual("/{param}/bar", path)
        path_args = {"/{param1}/{param2}": {}, "/{param}/bar": {}}
        path, details = get_resource_for_path("/foo/bar", path_args)
        self.assertEqual("/{param}/bar", path)
        path_args = {"/{param1}/{param2}": {}, "/{param1}/bar": {}}
        path, details = get_resource_for_path("/foo/baz", path_args)
        self.assertEqual("/{param1}/{param2}", path)
        path_args = {"/{param1}/{param2}/baz": {}, "/{param1}/bar/{param2}": {}}
        path, details = get_resource_for_path("/foo/bar/baz", path_args)
        self.assertEqual("/{param1}/{param2}/baz", path)
        path_args = {"/{param1}/{param2}/baz": {}, "/{param1}/{param2}/{param2}": {}}
        path, details = get_resource_for_path("/foo/bar/baz", path_args)