-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correctly fill plugins with arbitrary map fields #258
Conversation
3e42cb8
to
b5c669d
Compare
Kong plugin schemas support different type of fields, including maps. Moreover, these can either be arbitrary maps, or maps with their own subschema. go-kong already supports well the second case, but it falls short with arbitrary maps. An example of arbitrary map field is the `custom_fields_by_lua` from the `http-log` plugin, which is defined as follows: ``` { "custom_fields_by_lua": { "keys": { "len_min": 1, "type": "string" }, "type": "map", "values": { "len_min": 1, "type": "string" } } } ``` This commit makes sure that go-kong is able to correctly handle such schemas as well.
b5c669d
to
6c81ce5
Compare
Codecov ReportBase: 52.32% // Head: 52.43% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #258 +/- ##
==========================================
+ Coverage 52.32% 52.43% +0.11%
==========================================
Files 51 51
Lines 4610 4621 +11
==========================================
+ Hits 2412 2423 +11
Misses 1670 1670
Partials 528 528
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@Kong/team-k8s this PR is approved (but merge is blocked) and decK is already using this code. Can someone take a look please? |
Done :) |
Kong plugin schemas support different type of fields, including maps. Moreover, these can either be arbitrary maps, or maps with their own subschema.
go-kong already supports well the second case, but it falls short with arbitrary maps. An example of arbitrary map field is the
custom_fields_by_lua
from thehttp-log
plugin, which is defined as follows:This commit makes sure that go-kong is able to correctly handle such schemas as well.