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/12/21 10:42:46 UTC
[GitHub] [apisix] spacewander opened a new pull request #3092: feat: expose schema via control API
spacewander opened a new pull request #3092:
URL: https://github.com/apache/apisix/pull/3092
Close #3022
Signed-off-by: spacewander <sp...@gmail.com>
### What this PR does / why we need it:
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
### Pre-submission checklist:
* [ ] Did you explain what problem does this PR solve? Or what new features have been added?
* [x] Have you added corresponding test cases?
* [x] Have you modified the corresponding document?
* [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
----------------------------------------------------------------
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
[GitHub] [apisix] nic-chen commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547282255
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
lack of consumer
----------------------------------------------------------------
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
[GitHub] [apisix] nic-chen commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547163774
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
ok
----------------------------------------------------------------
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
[GitHub] [apisix] membphis merged pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
membphis merged pull request #3092:
URL: https://github.com/apache/apisix/pull/3092
----------------------------------------------------------------
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
[GitHub] [apisix] spacewander commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547062207
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
There is some methods in `core.schema` can't be json encoded, like `core.schema.check`.
----------------------------------------------------------------
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
[GitHub] [apisix] spacewander commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547586719
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
@nic-chen
Solved.
----------------------------------------------------------------
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
[GitHub] [apisix] nic-chen commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547060646
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
how about could use `core.schema` as main ?
There will be redundant data, but no data will not be missed, and there is no need to modify the code here after adding a new 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
[GitHub] [apisix] nic-chen commented on a change in pull request #3092: feat: expose schema via control API
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #3092:
URL: https://github.com/apache/apisix/pull/3092#discussion_r547060646
##########
File path: apisix/control/v1.lua
##########
@@ -14,11 +14,33 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
+local core = require("apisix.core")
+local plugin = require("apisix.plugin")
+
+
local _M = {}
function _M.schema()
- return 200, {}
+ local schema = {
+ main = {
+ global_rule = core.schema.global_rule,
+ route = core.schema.route,
+ service = core.schema.service,
+ ssl = core.schema.ssl,
+ stream_route = core.schema.stream_route,
+ upstream = core.schema.upstream,
+ },
Review comment:
how about could use `core.schema` as main ?
There will be redundant data, but no data will be missed, and there is no need to modify the code here after adding a new 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