We were already using provider.apiGateway.apiKeys in our serverless.yml, and the same key was set there as previously in --apiKey, so in theory, serverless-offline should still pick it up, but it didn't.
It turns out that getApiKeysValues only accepts objects, while simple strings should also be allowed.
Bug Report
API keys not detected if only strings
Current Behavior
We used the
--apiKeys
CLI option removed in https://github.com/dherault/serverless-offline/pull/1585/files.We were already using
provider.apiGateway.apiKeys
in ourserverless.yml
, and the same key was set there as previously in--apiKey
, so in theory,serverless-offline
should still pick it up, but it didn't.It turns out that
getApiKeysValues
only accepts objects, while simple strings should also be allowed.Sample Code
Expected behavior/code
serverless-offline
should use the provided API key.Possible Solution
Amend
getApiKeysValues
Additional context/Screenshots