The idea is very good. The response data format is fine to me too. Just small changing(not important): `GET /apisix/admin/plugins/meta_data` change to `GET /apisix/admin/plugins/metadata`
On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <[email protected]> wrote: > Hi Community: > > > > This discussion originates from issue: > https://github.com/apache/apisix-dashboard/issues/529 > > > Background > Dashboard wants to optimize the UE of config the plugins. For the plugins > such as `key-auth` `prometheus` etc. user only need to enable/disable them > in route or service without any configurations. so it would be better that > only show switch for these plugins. > When rendering the plugin page, the FE needs to know not only the name of > the plugins(which have already been returned by `GET > /apisix/admin/plugins`), but also need to know the plugins' schema which is > used to judge whether the plugin needs to be config > Solution > Refer to > https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857 > It would be better to create a new API in manger-api, which is used to > return all the information of the plugins, the ideal data structure is as > follows: > ```json > [ > { > "name": "key-auth", > "type": "auth", > "schema": { > .... > } > ...other plugin meta_data > }, > { > ... > } > ] > ``` > And for the API name > Just follow the current convention:as `GET /apisix/admin/plugins` has > already in use for get all plugins names list, so the new name would be > `GET /apisix/admin/plugins/meta_data` to get all plugins informations list. > When we have a large version change: for a better Reatful way, I perfer > this way: > https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561 > the name would be `GET /api/version/plugins` > > > What do you think? Looking forward to your comments and suggestions. > Thanks~! > > > Best wishes > Liuxiran -- *MembPhis* My GitHub: https://github.com/membphis Apache APISIX: https://github.com/apache/apisix
