go-apiops
go-apiops copied to clipboard
Conditional logic for JSONPath selectors not working
When applying conditional logic for a plugin using deck file add-plugins, only the first piece of logic is matched and applied.
Using the command
cat ./kong-simple-config.json | deck file add-plugins --format json ./get-post-route-plugins.yaml
Plugins are only applied to GET routes not POST routes, the selectors JSONPath is
$.services[*].routes[?(@.methods[?(@=='GET' ) || (@=='POST')])]
get-post-route-plugins.yaml.txt get-route-plugins.yaml.txt kong-simple-config.json
Filed upstream issue here: https://github.com/vmware-labs/yaml-jsonpath/issues/60
Alternative library: https://github.com/speakeasy-api/jsonpath