membphis commented on a change in pull request #2209:
URL: https://github.com/apache/apisix/pull/2209#discussion_r489260881
##########
File path: t/admin/services.t
##########
@@ -1085,3 +1085,97 @@ GET /t
--- error_code: 400
--- no_error_log
[error]
+
+
+
+=== TEST 31: set empty service. (id: 1)(allow empty `service` object)
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/services/1',
+ ngx.HTTP_PUT,
+ {},
+ [[{
+ "node": {
+ "value": {"id":"1"}
+ },
+ "action": "set"
+ }]]
+ )
+
+ ngx.status = code
+ ngx.say(body)
+ }
+ }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 32: add content to the empty service.(id: 1)(allow empty `service`
object)
Review comment:
bad title
##########
File path: t/admin/schema.t
##########
@@ -37,10 +37,29 @@ qr/"plugins":\{"type":"object"}/
=== TEST 2: get service schema
+--- config
+ location /t {
+ content_by_lua_block {
+ local core = require("apisix.core")
+ local t = require("lib.test_admin").test
+ local code, _, res_body = t('/apisix/admin/schema/service',
+ ngx.HTTP_GET
+ )
+ local res_data = core.json.decode(res_body)
+ local result = res_data["anyOf"]
Review comment:
bad process, not easy to read
----------------------------------------------------------------
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:
[email protected]