You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/09/30 08:24:19 UTC

[GitHub] [apisix] membphis edited a comment on issue #2247: feat: `apisix-schema` tool can return the `jsonschema` of route, service, upstream and plugins

membphis edited a comment on issue #2247:
URL: https://github.com/apache/apisix/issues/2247#issuecomment-701241039


   here is an example, @nic-chen you can take a look at this:
   
   
   ```lua
   #!/usr/bin/env resty
   
   local pkg_cpath_org = package.cpath
   local pkg_path_org = package.path
   
   local apisix_home = "./"
   local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
                     .. apisix_home .. "/deps/lib/lua/5.1/?.so;"
   local pkg_path  = apisix_home .. "/?/init.lua;"
                     .. apisix_home .. "/deps/share/lua/5.1/?.lua;;"
   
   package.cpath = pkg_cpath .. pkg_cpath_org
   package.path  = pkg_path .. pkg_path_org
   
   -- local schema = require("apisix.schema_def")
   -- ngx.say(json.encode(schema.route))
   
   local json = require("cjson.safe")
   local schema = require("apisix.plugins.limit-count")
   ngx.say(json.encode(schema.schema))
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org