liuxiran edited a comment on pull request #2440:
URL: https://github.com/apache/apisix/pull/2440#issuecomment-710740234


   > According to the previous JSON schema data format, without changing the 
logic, the current writing method is not the same as the data obtained by 
apisix-dashboard. I need to discuss with @liuxiran again tomorrow
   
   @Jaycean 
   with your newest json schema
   ```json
   {
        "oneOf": [{
                "properties": {
                        "blacklist": {
                                "items": {
                                        "type": "string"
                                },
                                "minItems": 1,
                                "type": "array"
                        },
                        "rejected_code": {
                                "default": 403,
                                "minimum": 200,
                                "type": "integer"
                        },
                        "type": {
                                "default": "consumer_name",
                                "enum": ["consumer_name", "service_id"],
                                "type": "string"
                        }
                },
                "required": ["blacklist"],
                "title": "blacklist"
        }, {
                "properties": {
                        "rejected_code": {
                                "default": 403,
                                "minimum": 200,
                                "type": "integer"
                        },
                        "type": {
                                "default": "consumer_name",
                                "enum": ["consumer_name", "service_id"],
                                "type": "string"
                        },
                        "whitelist": {
                                "items": {
                                        "type": "string"
                                },
                                "minItems": 1,
                                "type": "array"
                        }
                },
                "required": ["whitelist"],
                "title": "whitelist"
        }],
        "properties": {
                "disable": {
                        "type": "boolean"
                }
        },
        "type": "object"
   }
   ```
   dashboard can create a route with `key-auth` plugin and 
`consumer-restriction` plugin successfully. and the `consumer-restriction` 
plugin can work correctly with the configuration.
   
   And what is the purpose of the disable property below, which is not 
mentioned both in the 
[doc](https://github.com/apache/apisix/blob/master/doc/zh-cn/plugins/consumer-restriction.md)
 and in [test 
cases](https://github.com/apache/apisix/blob/master/t/plugin/consumer-restriction.t).
  it would be better to remove if it is no use:) 
   cc @juzhiyuan  @membphis 
   ```json
   "properties": {
                "disable": {
                        "type": "boolean"
                }
        }
   ```


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to