DianaIonita / serverless-api-gateway-caching

A plugin for the Serverless framework which helps with configuring caching for API Gateway endpoints.
ISC License
136 stars 35 forks source link

multivaluequerystring fails to build #70

Closed Ksmike closed 3 years ago

Ksmike commented 3 years ago

Hi,

Do you have an example of how to use request.multivaluequerystring ->

I tried to deploy it and I just get this error below

Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: method.request.multivaluequerystring.versionId] (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: efe76a48-f2c6-4da1-b089-d45d13330232; Proxy: null)
          caching:
            enabled: true
            cacheKeyParameters:
              - name: request.multivaluequerystring.versionId
              - name: request.multivaluequerystring._id
              - name: request.multivaluequerystring.pluginVersion

any info on how to use multivaluequerystring would be helpful, I have three keys i need to cache against, versionid&id& pluginVersionId

Cheers

DianaIonita commented 3 years ago

Hi @Ksmike,

Thanks for pointing this out. You're right, this is an issue - I get the same errors when I try to cache by multi-value query strings.

I've been exploring API Gateway in the AWS console and I can't seem to find a way to enable caching by multi-value query strings. The only options I could make work were header, path and querystring. If that were possible to do via the AWS console, then I could write some code so that the plugin could do it too.

If you know of a way to enable caching by multi-value query strings in API Gateway, please shout.

In the meantime, I'll update the plugin readme to reflect that it only works for header, path and querystring.