That’s odd and shouldn’t be the case. Can you share more what those errors were? Pretty sure we have a couple of modules that have field called Handler. The code also isn’t sensitive to the field name.
It’s actually a validation error, but it looks like even though the field is set, something overwrites it.
At some point, I looked at the JSON config and it looked like http handler modules actually have a handler property that overwrites whatever I put in there.
In any case, it’s entirely possible that I missed something, but renaming the field from handler solved my problem after I wasted a day on debugging, so I left it there.
That’s not valid JSON. What ends up happening is the adapter takes the last value set on the JSON field, which is k8s_admission, and making it the final value of the json field handler.
You can resolve it by changing the name of the JSON tag as such:
Thanks for the clarification. That’s what I figured.
I don’t think it makes much of a difference, though: if you have a field name “handler” in a struct, I’m pretty sure everyone’s first instinct would be to name the JSON field the same.
So I think the warning still stands, especially because the error is not obvious and it took some time to figure this out.
For those who are not familiar with how the http handler config looks like in JSON (like myself), a warning in the documentation would save time IMO