Hello, I don't know how complicated your plugin is, maybe you can say it more clearly.
We recommend that one plugin only do one thing, and multiple plugins can be used together. I don't think it's a good idea to read the schema from a local file. First it will affect performance, and secondly it will cause difficulties in code management and maintenance. Thanks, Ming Wen, Apache APISIX & Apache SkyWalking Twitter: _WenMing 88786...@qq.com <88786...@qq.com> 于2020年4月13日周一 下午12:25写道: > Hi, > I want to develop a new APISIX plug-in for my scenario, but it's schema > is more complex, the recommended way is to split it into multiple plug-ins > or to keep one? > I want to get it form the schema file instead of initializing the table in > it's file if recommend the latter. > Is there anything wrong or some risk in this way. > > ``` > local prefix = ngx.config.prefix() > local plugin_xsd_file = prefix .. "/conf/plugin.schema.json" > local f = assert(io.open(cfg_file)) > local xsd_t = json.decode(assert(f:read('*a'))) > f:close() > --local myvalidator = jsonschema.generate_validator(xsd_t) > ``` > > thx~ > > > 88786...@qq.com >