Maybe we need to define the metadata and schema of plugin.
Here are my thoughts.

1. The data shared by all instances of a plugin, put it  in the metadata.
2. The data don't  shared by all between instances of a plugin,  put it in
the schema.

YuanSheng Wang <[email protected]> 于2020年11月29日周日 下午2:23写道:

> @vincixu
>
> I think you can provide a real use case.
>
> `plugin option's specified value` > `metadata` > `default value`
>
> It is better than the current way.
>
>
> On Fri, Nov 13, 2020 at 10:46 PM YuanSheng Wang <[email protected]>
> wrote:
>
> > Let me think about this and reply in detail later.
> >
> > On Thu, Nov 12, 2020 at 8:37 PM vincixu <[email protected]> wrote:
> >
> >> Recently, when I was reviewing some pr, I had trouble with plugins:
> which
> >> parameters should we put in the metadata?
> >> Some people may say: when you need to modify it through adminapi, put it
> >> in
> >> the metadata.
> >> Well, I also know this rule, but in fact, when we are developing a
> plugin,
> >> we are actually not sure which parameters really only need to be
> >> configured
> >> separately in the plugin instead of being put into the metadata.
> >> So here I suggest merging the configuration of the plugin with the
> >> metadata, so that the metadata and the plugin configuration use the same
> >> schema, and the priority order of values is as follows:
> >> plugin option's specified value> metadata >default value.
> >> In this way, we can get the following benefits:
> >> 1. Reduce complexity and learning costs. Plugin developers still only
> need
> >> to care about the option schema, and no longer need to call additional
> >> functions to get metadata.
> >> 2. No need to consider which parameters should be placed in metadata and
> >> which parameters should be placed in option
> >>
> >> In fact, usually the content of metadata is also required by plugins. We
> >> should reduce the burden on plugin development.
> >> What do you think?
> >>
> >
> >
> > --
> >
> > *MembPhis*
> > My GitHub: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/apisix
> >
>
>
> --
>
> *MembPhis*
> My GitHub: https://github.com/membphis
> Apache APISIX: https://github.com/apache/apisix
>

Reply via email to