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

Configuration warning unrecognized property 'caching' #76

Closed EddyArellanes closed 3 years ago

EddyArellanes commented 3 years ago

With the property caching inside like this one:

 companies:
    handler: src/index.companiesHandler
    events:
      - http:
          path: '{version}/companies'
          method: ANY
          cors:
            origin: "*"
            headers: ${self:custom.allowed-headers}
            allowCredentials: true
          private: false
          caching:
            enabled: true #false
            ttlInSeconds: 120 #3600
            cacheKeyParameters:
              - name: request.querystring.regionId
              - name: request.querystring.skip
              - name: request.querystring.take
              - name: request.querystring.filterName
              - name: request.querystring.filterValue

The Service configuration validation throws Configuration warning unrecognized property 'caching'. According to service configuration validation page: Configuration related to external plugin does not have an associated JSON Schema. In such cases, please report the issue with the plugin author and provide them the details on how to extend validation schema in order to permanently correct the issue.

DianaIonita commented 3 years ago

Hi @EddyArellanes,

Thanks for raising this issue. Unfortunately, from my initial research, the Serverless framework doesn't currently offer a way to extend the validation schema for http events. I have raised an issue with them, hopefully a solution can be found.

yeukfei02 commented 3 years ago

@DianaIonita

I am using serverless v2.11.0 in one of my serverless aws lambda project, I got the same error like this:

Serverless: at 'functions.createPartner.events[0].http': unrecognized property 'caching'

wait for the fix/serverless their update...

DianaIonita commented 3 years ago

Hi @yeukfei02,

I'm just waiting on this PR to get released by the serverless team, then I'll add the validation schema to this plugin.

yeukfei02 commented 3 years ago

@DianaIonita thats good wait for the update!

DianaIonita commented 3 years ago

Released v1.5.2.