Unable to PATCH rate-limiting plugin


#1

I’m trying to change the config.policy option of the rate-limiting (CE) plugin through the API.
I only want to change that specific config value, so I’m using PATCH.

I’m using the following request:

curl -X PATCH kong:8001/plugins/{plugin-id} --data "config.policy=local"

I’m getting the following error:
{"config":"You need to set at least one limit: second, minute, hour, day, month, year"}

But the plugin has the ‘second’ property set. This is just the reason for using the PATCH: not having to set the other properties again.

Am I doing something wrong?


Unable to properly PATCH a plugin
#2

Hi,
See my post here to explain the reason of the issue. Unable to properly PATCH a plugin
A look to the source code of the self_check function shows that in case of a PATCH to add config.policy only, config does not contain the mandatory second, minute, etc. so the PATCH is refused while it should not.


#3

Hey,

Thanks for figuring this out. Much appreciated!