Closed mwmahlberg closed 3 years ago
You are correct. It's not clear to me how this could be any more convenient though, given that Webhooks
must also be exposed via flags?
That said however, in this particular instance you could potentially just use a map.
On further reflection this is not possible as Kong always assumes that structs without cmd
are invalid unless they implement the decoder interface.
For the record: this should be fixed with https://github.com/alecthomas/kong-yaml/pull/15#issue-1601121303 :crossed_fingers:
It is unclear to me how something like this should be done properly:
especially in conjunction with https://github.com/alecthomas/kong-yaml
Implementing a custom MapperDecoder or json.Unmarshaller seems a bit cumbersome, taking a rather common configuration like:
into account. Am I right to assume that a custom Decoder/Unmarshaller is required in this case?