I am trying to setup a POC of an Apigee X endpoint that acts as a webhook sending data into a GCP Pub/Sub topic via an integration. I have my Integration Request Policy set as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SetIntegrationRequest continueOnError="false" enabled="true" name="set-integration-request">
<DisplayName>Set Integration Request</DisplayName>
<ProjectId>dev-pudgy-penguin</ProjectId>
<IntegrationName>github-webhook-pubsub2</IntegrationName>
<IntegrationRegion>us-east1</IntegrationRegion>
<ApiTrigger>api_trigger/github-webhook-pubsubs_API_1</ApiTrigger>>
<Parameters>
<Parameter name="request_body" type="json" ref="request.content"/>
</Parameters>
</SetIntegrationRequest>
I'm getting the following error on that policy when looking at the debug:
curl -X POST https://34.160.151.177.nip.io/v1/github-webhook2 -H "Content-Type: application/json" -d @sample_github.json
{"fault":{"faultstring":"Unresolved variable : sha","detail":{"errorcode":"entities.UnresolvedVariable"}}}
The `request.content` is a JSON being passed in (from Github webhook) that has things like this in it:
"blobs_url": "https://git.company.com/api/v3/repos/mike-glenney/fluffy-dollop/git/blobs{/sha}"
I "think" this is what is causing the error above. I'm assuming Apigee is seeing the {} and trying to extract that as a variable. The JSON is valid according to my linters and I'm setting type="json".
Thanks,
MG