go-pdk icon indicating copy to clipboard operation
go-pdk copied to clipboard

Can't define defaults and one_of options for plugin configurations

Open jphorec opened this issue 3 years ago • 1 comments

When creating Lua plugins you can specify default and one_of values as such:

{
  my_param = {type = "string", one_of = { "One", "Two", "Three" }, default = "One"}
}

It would be nice if the go-pdk had an optional KongConfig struct that let you define these values on a Config and create schema outputs here https://github.com/Kong/go-pdk/blob/master/server/rpc.go#L169 in the same manner as the Lua schema definition above.

jphorec avatar Feb 14 '22 21:02 jphorec

sorry, noob question, what are the benefits of schema output? How can I use it? Does the config field in struct with Go Doc doc.go enough?

rhzs avatar Feb 17 '22 17:02 rhzs