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/11/03 13:46:38 UTC

[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #651: feat: support get plugin schema based on schema_type

liuxiran commented on a change in pull request #651:
URL: https://github.com/apache/apisix-dashboard/pull/651#discussion_r516415342



##########
File path: api/conf/schema.json
##########
@@ -1 +1 @@
-{"main":{"plugin_disable_schema":{"disable":{"type":"boolean"}},"route":{"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"vars":{"type":"array","items":{"description":"Nginx builtin variable name and value","items":{"maxItems":3,"minItems":2,"anyOf":[{"type":"string"},{"type":"number"}]},"type":"array"}},"uris":{"type":"array","items":{"description":"HTTP uri","type":"string"},"uniqueItems":true},"hosts":{"type":"array","items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"uniqueItems":true},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"retries":{"type":"integer","minimum":0},"type":{"description":"algorithms of load balancing","type":"string","enum":["chash","roundrobin","ewma"]},"k8s_deployment_info":{"type":"object","
 anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"deploy_name":{"type":"string","description":"k8s deployment name"},"service_name":{"type":"string","description":"k8s service name"},"backend_type":{"type":"string","default":"pod","description":"k8s service name","enum":["svc","pod"]},"port":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"nodes":{"anyOf":[{"type":"object","patternProperties":{".*":{"description":"weight of node","minimum":0,"type":"integer"}},"minProperties":1},{"type":"array","minItems":1,"items":{"type":"object","properties":{"metadata":{"description":"metadata of node","type":"object"},"port":{"description":"port of no
 de","minimum":1,"type":"integer"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"weight":{"description":"weight of node","minimum":0,"type":"integer"}},"required":["host","port","weight"]}}]},"timeout":{"type":"object","properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}},"required":["connect","send","read"]},"name":{"type":"string","maxLength":50},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"timeout":{"type":"number","default":1},"http_path":{"type":"string","default":"/"},"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"port":{"type":"integer","minimum":1,"maximum":65535},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":3},"in
 terval":{"type":"integer","minimum":1,"default":0},"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[429,404,500,501,502,503,504,505],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"req_headers":{"type":"array","minItems":1,"items":{"type":"string","uniqueItems":true}},"concurrency":{"type":"integer","default":10},"healthy":{"type":"object","properties":{"http_statuses":{"default":[200,302],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true},"successes":{"type":"integer","minimum":1,"maximum":254,"default":2},"interval":{"type":"integer","minimum":1,"default":0}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"healthy":{"type":
 "object","properties":{"successes":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"unhealthy":{"type":"object","properties":{"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":7},"http_statuses":{"default":[429,500,503],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}}}}}},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"service_name":{"type":"string","maxLength":50},"hash_on":{"type":"string","defau
 lt":"vars","enum":["vars","header","cookie","consumer"]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"pass_host":{"description":"mod of host passing","default":"pass","type":"string","enum":["pass","node","rewrite"]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"update_time":{"type":"integer"}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"remote_addrs":{"type":"array","items":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string"
 ,"title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"uniqueItems":true},"methods":{"type":"array","items":{"description":"HTTP method","type":"string","enum":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"]},"uniqueItems":true},"name":{"type":"string","maxLength":50},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"priority":{"type":"integer","default":0},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"service_protocol":{"enum":["grpc","http"]},"plugins":{"type":"object"},"script":{"type":"string","minLength":10,"maxLength":102400},"service_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"uri":{"type":"string","minLength":1,"maxLength":4096},"upstream_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":
 "^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"remote_addr":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"filter_func":{"type":"string","minLength":10,"pattern":"^function"},"update_time":{"type":"integer"}},"anyOf":[{"required":["plugins","uri"]},{"required":["upstream","uri"]},{"required":["upstream_id","uri"]},{"required":["service_id","uri"]},{"required":["plugins","uris"]},{"required":["upstream","uris"]},{"required":["upstream_id","uris"]},{"required":["service_id","uris"]},{"required":["script","uri"]},{"required":["script",
 "uris"]}],"type":"object","additionalProperties":false,"not":{"anyOf":[{"required":["script","plugins"]}]}},"version":0.5,"stream_route":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"upstream_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"remote_addr":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"server_addr":{"description":"server IP","anyOf":[{"type":"s
 tring","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"plugins":{"type":"object"},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"retries":{"type":"integer","minimum":0},"type":{"description":"algorithms of load balancing","type":"string","enum":["chash","roundrobin","ewma"]},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"requi
 red":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"deploy_name":{"type":"string","description":"k8s deployment name"},"service_name":{"type":"string","description":"k8s service name"},"backend_type":{"type":"string","default":"pod","description":"k8s service name","enum":["svc","pod"]},"port":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"nodes":{"anyOf":[{"type":"object","patternProperties":{".*":{"description":"weight of node","minimum":0,"type":"integer"}},"minProperties":1},{"type":"array","minItems":1,"items":{"type":"object","properties":{"metadata":{"description":"metadata of node","type":"object"},"port":{"description":"port of node","minimum":1,"type":"integer"},"host":{"type":"string","patt
 ern":"^\\*?[0-9a-zA-Z-.]+$"},"weight":{"description":"weight of node","minimum":0,"type":"integer"}},"required":["host","port","weight"]}}]},"timeout":{"type":"object","properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}},"required":["connect","send","read"]},"name":{"type":"string","maxLength":50},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"timeout":{"type":"number","default":1},"http_path":{"type":"string","default":"/"},"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"port":{"type":"integer","minimum":1,"maximum":65535},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":3},"interval":{"type":"integer","minimum":1,"default":0},"tcp_failure
 s":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[429,404,500,501,502,503,504,505],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"req_headers":{"type":"array","minItems":1,"items":{"type":"string","uniqueItems":true}},"concurrency":{"type":"integer","default":10},"healthy":{"type":"object","properties":{"http_statuses":{"default":[200,302],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true},"successes":{"type":"integer","minimum":1,"maximum":254,"default":2},"interval":{"type":"integer","minimum":1,"default":0}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"healthy":{"type":"object","properties":{"successes":{"type":"integer","minimum":
 1,"maximum":254,"default":5},"http_statuses":{"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"unhealthy":{"type":"object","properties":{"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":7},"http_statuses":{"default":[429,500,503],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}}}}}},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"service_name":{"type":"string","maxLength":50},"hash_on":{"type":"string","default":"vars","enum":["vars","header","cookie","consumer"]},"upstr
 eam_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"pass_host":{"description":"mod of host passing","default":"pass","type":"string","enum":["pass","node","rewrite"]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"update_time":{"type":"integer"}}},"server_port":{"description":"server port","type":"integer"}}},"consumer":{"type":"object","properties":{"create_time":{"type":"integer"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"desc":{"type":"string","maxLength":256},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"plugins":{"type":"object"},"username":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[a-zA-Z0-9_]+$"},"update_time":{"type":"integer"}},"additionalPrope
 rties":false,"required":["username"]},"host_def":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"global_rule":{"type":"object","properties":{"plugins":{"type":"object"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]}},"additionalProperties":false,"required":["plugins"]},"ip_def":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"upstream_hash_vars_schema":{"type":"string","pattern":"^((uri|server_name|server_addr|request_uri|remote_port|remote_addr|query_string|host|hostname)|arg_[0-9a-zA-z_-]+)$"},"label_value_def"
 :{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64},"upstream_hash_header_schema":{"type":"string","pattern":"^[a-zA-Z0-9-_]+$"},"proto":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":1048576}},"additionalProperties":false,"required":["content"]},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"retries":{"type":"integer","minimum":0},"type":{"description":"algorithms of load balancing","type":"string","enum":["chash","roundrobin","ewma"]},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"deploy_name":{"type":
 "string","description":"k8s deployment name"},"service_name":{"type":"string","description":"k8s service name"},"backend_type":{"type":"string","default":"pod","description":"k8s service name","enum":["svc","pod"]},"port":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"nodes":{"anyOf":[{"type":"object","patternProperties":{".*":{"description":"weight of node","minimum":0,"type":"integer"}},"minProperties":1},{"type":"array","minItems":1,"items":{"type":"object","properties":{"metadata":{"description":"metadata of node","type":"object"},"port":{"description":"port of node","minimum":1,"type":"integer"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"weight":{"description":"weight of node","minimum":0,"type":"integer"}},"required":["host","port","weight"]}}]
 },"timeout":{"type":"object","properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}},"required":["connect","send","read"]},"name":{"type":"string","maxLength":50},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"timeout":{"type":"number","default":1},"http_path":{"type":"string","default":"/"},"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"port":{"type":"integer","minimum":1,"maximum":65535},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":3},"interval":{"type":"integer","minimum":1,"default":0},"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_
 statuses":{"default":[429,404,500,501,502,503,504,505],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"req_headers":{"type":"array","minItems":1,"items":{"type":"string","uniqueItems":true}},"concurrency":{"type":"integer","default":10},"healthy":{"type":"object","properties":{"http_statuses":{"default":[200,302],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true},"successes":{"type":"integer","minimum":1,"maximum":254,"default":2},"interval":{"type":"integer","minimum":1,"default":0}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"healthy":{"type":"object","properties":{"successes":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"minI
 tems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"unhealthy":{"type":"object","properties":{"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":7},"http_statuses":{"default":[429,500,503],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}}}}}},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"service_name":{"type":"string","maxLength":50},"hash_on":{"type":"string","default":"vars","enum":["vars","header","cookie","consumer"]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"pass_host":{"description":"mod of host passing","default":"pass","type":"stri
 ng","enum":["pass","node","rewrite"]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"update_time":{"type":"integer"}}},"service":{"type":"object","additionalProperties":false,"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"name":{"type":"string","maxLength":50},"plugins":{"type":"object"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"upstream_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"retries":{"type":"integer","minimum":0},"type":{"description":"algorithms of load balancing","type":"stri
 ng","enum":["chash","roundrobin","ewma"]},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"deploy_name":{"type":"string","description":"k8s deployment name"},"service_name":{"type":"string","description":"k8s service name"},"backend_type":{"type":"string","default":"pod","description":"k8s service name","enum":["svc","pod"]},"port":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"nodes":{"anyOf":[{"type":"object","patternProperties":{".*":{"description":"weight of node","minimum":0,"type":"integer"}},"minProperties":1},{"type":"array","minItems":1,"items":{"type":"object","properties":{"metadata":{"
 description":"metadata of node","type":"object"},"port":{"description":"port of node","minimum":1,"type":"integer"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"weight":{"description":"weight of node","minimum":0,"type":"integer"}},"required":["host","port","weight"]}}]},"timeout":{"type":"object","properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}},"required":["connect","send","read"]},"name":{"type":"string","maxLength":50},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"timeout":{"type":"number","default":1},"http_path":{"type":"string","default":"/"},"type":{"type":"string","default":"http","enum":["http","https","tcp"]},"port":{"type":"integer","minimum":1,"maximum":65535},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"unhealthy":{"type":"object","pr
 operties":{"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":3},"interval":{"type":"integer","minimum":1,"default":0},"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[429,404,500,501,502,503,504,505],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"req_headers":{"type":"array","minItems":1,"items":{"type":"string","uniqueItems":true}},"concurrency":{"type":"integer","default":10},"healthy":{"type":"object","properties":{"http_statuses":{"default":[200,302],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true},"successes":{"type":"integer","minimum":1,"maximum":254,"default":2},"interval":{"type":"integer","minimum":1,"default":0}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{
 "type":"string","default":"http","enum":["http","https","tcp"]},"healthy":{"type":"object","properties":{"successes":{"type":"integer","minimum":1,"maximum":254,"default":5},"http_statuses":{"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}},"unhealthy":{"type":"object","properties":{"tcp_failures":{"type":"integer","minimum":1,"maximum":254,"default":2},"http_failures":{"type":"integer","minimum":1,"maximum":254,"default":5},"timeouts":{"type":"integer","minimum":1,"maximum":254,"default":7},"http_statuses":{"default":[429,500,503],"minItems":1,"items":{"type":"integer","minimum":200,"maximum":599},"type":"array","uniqueItems":true}}}}}}},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]}
 ,"service_name":{"type":"string","maxLength":50},"hash_on":{"type":"string","default":"vars","enum":["vars","header","cookie","consumer"]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"pass_host":{"description":"mod of host passing","default":"pass","type":"string","enum":["pass","node","rewrite"]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"update_time":{"type":"integer"}}},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"script":{"type":"string","minLength":10,"maxLength":102400},"update_time":{"type":"integer"}}},"id_schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"ssl":{"type":"object","oneOf":[{"required":["sni","key","cert"]},{"required":["snis","key","ce
 rt"]}],"additionalProperties":false,"properties":{"certs":{"type":"array","items":{"type":"string","minLength":128,"maxLength":65536}},"validity_end":{"type":"integer"},"snis":{"type":"array","items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"}},"sni":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"create_time":{"type":"integer"},"validity_start":{"type":"integer"},"key":{"type":"string","minLength":128,"maxLength":65536},"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"status":{"description":"ssl status, 1 to enable, 0 to disable","default":1,"type":"integer","enum":[1,0]},"labels":{"description":"key/value pairs to specify attributes","patternProperties":{".*":{"description":"value of label","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$","type":"string","maxLength":64}},"maxProperties":16,"type":"object"},"cert":{"type":"string","minLength":128,"maxLength":65536},"keys":{"type":"array","items":{"typ
 e":"string","minLength":128,"maxLength":65536}},"exptime":{"type":"integer","minimum":1588262400},"update_time":{"type":"integer"}}}},"plugins":{"serverless-pre-function":{"type":"object","properties":{"functions":{"type":"array","minItems":1,"items":{"type":"string"}},"phase":{"type":"string","enum":["rewrite","access","header_filter","body_filter","log","balancer"]}},"required":["functions"]},"proxy-mirror":{"type":"object","properties":{"host":{"type":"string","pattern":"^http(s)?:\\/\\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?$"}},"minProperties":1,"required":["host"]},"serverless-post-function":{"type":"object","properties":{"functions":{"type":"array","minItems":1,"items":{"type":"string"}},"phase":{"type":"string","enum":["rewrite","access","header_filter","body_filter","log","balancer"]}},"required":["functions"]},"jwt-auth":{"type":"object","properties":{"key":{"type":"string"},"algorithm":{"type":"string","default":"HS256","enum":["HS25
 6","HS512","RS256"]},"exp":{"type":"integer","minimum":1},"base64_secret":{"type":"boolean","default":false},"secret":{"type":"string"}}},"tcp-logger":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1,"default":1000},"buffer_duration":{"type":"integer","minimum":1,"default":60},"name":{"type":"string","default":"tcp logger"},"retry_delay":{"type":"integer","minimum":0,"default":1},"port":{"type":"integer","minimum":0},"host":{"type":"string"},"max_retry_count":{"type":"integer","minimum":0,"default":0},"tls_options":{"type":"string"},"include_req_body":{"type":"boolean","default":false},"batch_max_size":{"type":"integer","minimum":1,"default":1000},"tls":{"type":"boolean","default":false},"inactive_timeout":{"type":"integer","minimum":1,"default":5}},"required":["host","port"]},"openid-connect":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1},"client_secret":{"type":"string"},"discovery":{"type":"string"},"redirect_uri":{"type":"string"},"
 token_signing_alg_values_expected":{"type":"string"},"public_key":{"type":"string"},"logout_path":{"type":"string"},"ssl_verify":{"type":"boolean"},"realm":{"type":"string"},"scope":{"type":"string"},"bearer_only":{"type":"boolean"},"introspection_endpoint_auth_method":{"type":"string"},"introspection_endpoint":{"type":"string"},"client_id":{"type":"string"}},"required":["client_id","client_secret","discovery"]},"prometheus":{"type":"object","additionalProperties":false},"redirect":{"type":"object","oneOf":[{"required":["uri"]},{"required":["http_to_https"]}],"properties":{"ret_code":{"type":"integer","minimum":200,"default":302},"http_to_https":{"type":"boolean"},"uri":{"type":"string","minLength":2}}},"fault-injection":{"type":"object","minProperties":1,"properties":{"delay":{"type":"object","minProperties":1,"properties":{"duration":{"type":"number","minimum":0}}},"abort":{"type":"object","minProperties":1,"properties":{"body":{"type":"string","minLength":0},"http_status":{"type"
 :"integer","minimum":200}}}}},"echo":{"properties":{"body":{"description":"body to replace upstream response.","type":"string"},"auth_value":{"description":"auth value","type":"string"},"headers":{"description":"new headers for response","minProperties":1,"type":"object"},"before_body":{"description":"body before the filter phase.","type":"string"},"after_body":{"description":"body after the modification of filter phase.","type":"string"}},"anyOf":[{"required":["before_body"]},{"required":["body"]},{"required":["after_body"]}],"type":"object","minProperties":1,"additionalProperties":false},"uri-blocker":{"type":"object","properties":{"rejected_code":{"type":"integer","minimum":200,"default":403},"block_rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":4096},"uniqueItems":true}},"required":["block_rules"]},"kafka-logger":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1,"default":3},"buffer_duration":{"type":"integer","minimum":1,"default"
 :60},"meta_format":{"type":"string","default":"default","enum":["default","origin"]},"broker_list":{"type":"object"},"key":{"type":"string"},"max_retry_count":{"type":"integer","minimum":0,"default":0},"kafka_topic":{"type":"string"},"retry_delay":{"type":"integer","minimum":0,"default":1},"batch_max_size":{"type":"integer","minimum":1,"default":1000},"name":{"type":"string","default":"kafka logger"},"include_req_body":{"type":"boolean","default":false},"inactive_timeout":{"type":"integer","minimum":1,"default":5}},"required":["broker_list","kafka_topic","key"]},"key-auth":{"type":"object","properties":{"key":{"type":"string"}}},"skywalking":{"type":"object","service_name":{"type":"string","default":"APISIX","description":"service name for skywalking"},"properties":{"sample_ratio":{"type":"number","minimum":1e-05,"maximum":1,"default":1},"endpoint":{"type":"string"}},"required":["endpoint"]},"grpc-transcode":{"type":"object","properties":{"method":{"description":"the method name in 
 the grpc service.","type":"string"},"proto_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9-_]+$"},{"type":"integer","minimum":1}]},"deadline":{"description":"deadline for grpc, millisecond","default":0,"type":"number"},"service":{"description":"the grpc service name","type":"string"},"pb_option":{"type":"array","minItems":1,"items":{"type":"string","anyOf":[{"description":"enum as result","type":"string","enum":["int64_as_number","int64_as_string","int64_as_hexstring"]},{"description":"int64 as result","type":"string","enum":["ienum_as_name","enum_as_value"]},{"description":"default values option","type":"string","enum":["auto_default_values","no_default_values","use_default_values","use_default_metatable"]},{"description":"hooks option","type":"string","enum":["enable_hooks","disable_hooks"]}]}}},"additionalProperties":true,"required":["proto_id","service","method"]},"limit-req":{"type":"object","properties":{"key":{"type":"string","enum":["remote
 _addr","server_addr","http_x_real_ip","http_x_forwarded_for","consumer_name"]},"rejected_code":{"type":"integer","minimum":200,"default":503},"rate":{"type":"number","minimum":0},"burst":{"type":"number","minimum":0}},"required":["rate","burst","key"]},"proxy-rewrite":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"scheme":{"description":"new scheme for upstream","type":"string","enum":["http","https"]},"uri":{"description":"new uri for upstream","minLength":1,"maxLength":4096,"type":"string","pattern":"^\\/.*"},"headers":{"description":"new headers for request","minProperties":1,"type":"object"},"host":{"description":"new host for upstream","pattern":"^[0-9a-zA-Z-.]+$","type":"string"},"regex_uri":{"description":"new uri that substitute from client uri for upstream, lower priority than uri property","minItems":2,"items":{"description":"regex uri","type":"string"},"type":"array","maxItems":2}}},"consumer-restriction":{"type":"object","oneOf":[{"propert
 ies":{"type":{"type":"string","default":"consumer_name","enum":["consumer_name","service_id"]},"blacklist":{"type":"array","minItems":1,"items":{"type":"string"}},"rejected_code":{"type":"integer","minimum":200,"default":403}},"title":"blacklist","required":["blacklist"]},{"properties":{"type":{"type":"string","default":"consumer_name","enum":["consumer_name","service_id"]},"rejected_code":{"type":"integer","minimum":200,"default":403},"whitelist":{"type":"array","minItems":1,"items":{"type":"string"}}},"title":"whitelist","required":["whitelist"]}]},"limit-count":{"type":"object","dependencies":{"policy":{"oneOf":[{"properties":{"policy":{"enum":["local"]}}},{"properties":{"redis_port":{"type":"integer","minimum":1,"default":6379},"policy":{"enum":["redis"]},"redis_timeout":{"type":"integer","minimum":1,"default":1000},"redis_host":{"type":"string","minLength":2},"redis_password":{"type":"string","minLength":0}},"required":["redis_host"]},{"properties":{"redis_timeout":{"type":"int
 eger","minimum":1,"default":1000},"redis_password":{"type":"string","minLength":0},"redis_cluster_nodes":{"type":"array","minItems":2,"items":{"type":"string","minLength":2,"maxLength":100}},"policy":{"enum":["redis-cluster"]}},"required":["redis_cluster_nodes"]}]}},"properties":{"key":{"type":"string","enum":["remote_addr","server_addr","http_x_real_ip","http_x_forwarded_for","consumer_name"]},"count":{"type":"integer","minimum":0},"policy":{"type":"string","default":"local","enum":["local","redis","redis-cluster"]},"rejected_code":{"type":"integer","minimum":200,"maximum":600,"default":503},"time_window":{"type":"integer","minimum":0}},"required":["count","time_window","key"]},"basic-auth":{"type":"object","additionalProperties":false,"title":"work with route or service object","properties":[]},"node-status":{"type":"object","additionalProperties":false},"http-logger":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1,"default":3},"buffer_duration":{"type":"int
 eger","minimum":1,"default":60},"name":{"type":"string","default":"http logger"},"retry_delay":{"type":"integer","minimum":0,"default":1},"concat_method":{"type":"string","default":"json","enum":["json","new_line"]},"auth_header":{"type":"string","default":""},"max_retry_count":{"type":"integer","minimum":0,"default":0},"uri":{"type":"string"},"batch_max_size":{"type":"integer","minimum":1,"default":1000},"include_req_body":{"type":"boolean","default":false},"inactive_timeout":{"type":"integer","minimum":1,"default":5}},"required":["uri"]},"wolf-rbac":{"type":"object","properties":{"server":{"type":"string","default":"http://127.0.0.1:10080"},"header_prefix":{"type":"string","default":"X-"},"appid":{"type":"string","default":"unset"}}},"udp-logger":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1,"default":3},"include_req_body":{"type":"boolean","default":false},"buffer_duration":{"type":"integer","minimum":1,"default":60},"name":{"type":"string","default":"udp
  logger"},"batch_max_size":{"type":"integer","minimum":1,"default":1000},"port":{"type":"integer","minimum":0},"host":{"type":"string"},"inactive_timeout":{"type":"integer","minimum":1,"default":5}},"required":["host","port"]},"authz-keycloak":{"type":"object","properties":{"grant_type":{"default":"urn:ietf:params:oauth:grant-type:uma-ticket","minLength":1,"maxLength":100,"type":"string","enum":["urn:ietf:params:oauth:grant-type:uma-ticket"]},"permissions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"uniqueItems":true},"token_endpoint":{"type":"string","minLength":1,"maxLength":4096},"ssl_verify":{"type":"boolean","default":true},"audience":{"type":"string","minLength":1,"maxLength":100},"keepalive_timeout":{"type":"integer","minimum":1000,"default":60000},"policy_enforcement_mode":{"type":"string","default":"ENFORCING","enum":["ENFORCING","PERMISSIVE"]},"keepalive":{"type":"boolean","default":true},"timeout":{"type":"integer","minimum":1000,"default":300
 0},"keepalive_pool":{"type":"integer","minimum":1,"default":5}},"required":["token_endpoint"]},"request-id":{"type":"object","properties":{"header_name":{"type":"string","default":"X-Request-Id"},"include_in_response":{"type":"boolean","default":true}}},"ip-restriction":{"type":"object","oneOf":[{"properties":{"whitelist":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}]}}},"additionalProperties":false,"title":"whitelist","required":["whitelist"]},{"properties":{"blacklist":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"string","title":"IPv
 4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}]}}},"additionalProperties":false,"title":"blacklist","required":["blacklist"]}]},"syslog":{"type":"object","properties":{"timeout":{"type":"integer","minimum":1,"default":3},"drop_limit":{"type":"integer","default":1048576},"name":{"type":"string","default":"sys logger"},"port":{"type":"integer"},"host":{"type":"string"},"include_req_body":{"type":"boolean","default":false},"max_retry_times":{"type":"integer","minimum":1,"default":1},"buffer_duration":{"type":"integer","minimum":1,"default":60},"batch_max_size":{"type":"integer","minimum":1,"default":1000},"flush_limit":{"typ
 e":"integer","minimum":1,"default":4096},"retry_interval":{"type":"integer","minimum":0,"default":1},"pool_size":{"type":"integer","minimum":5,"default":5},"tls":{"type":"boolean","default":false},"sock_type":{"type":"string","default":"tcp","enum":["tcp","udp"]}},"required":["host","port"]},"response-rewrite":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"body_base64":{"description":"whether new body for repsonse need base64 decode before return","default":false,"type":"boolean"},"headers":{"description":"new headers for repsonse","minProperties":1,"type":"object"},"status_code":{"description":"new status code for repsonse","minimum":200,"maximum":598,"type":"integer"},"body":{"description":"new body for repsonse","type":"string"}}},"referer-restriction":{"type":"object","properties":{"bypass_missing":{"type":"boolean","default":false},"whitelist":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"}}},"additionalPro
 perties":false,"required":["whitelist"]},"request-validation":{"type":"object","anyOf":[{"required":["body_schema"]},{"required":["header_schema"]}],"properties":{"header_schema":{"type":"object"},"body_schema":{"type":"object"}}},"log-rotate":{"type":"object","additionalProperties":false,"properties":[]},"hmac-auth":{"type":"object","additionalProperties":false,"title":"work with route or service object","properties":[]},"cors":{"type":"object","properties":{"allow_origins":{"description":"you can use '*' to allow all origins when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple origin use ',' to split. default: *.","default":"*","type":"string"},"allow_headers":{"description":"you can use '*' to allow all header when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple header use ',' to split. default: *.","default":"*","type":"string"},"allow_methods":{"description":"you can use '*' to a
 llow all methods when no credentials and '**','**' to allow forcefully(it will bring some security risks, be carefully),multiple method use ',' to split. default: *.","default":"*","type":"string"},"max_age":{"description":"maximum number of seconds the results can be cached.-1 mean no cached,the max value is depend on browser,more detail plz check MDN. default: 5.","default":5,"type":"integer"},"allow_credential":{"description":"allow client append crendential. according to CORS specification,if you set this option to 'true', you can not use '*' for other options.","default":false,"type":"boolean"},"expose_headers":{"description":"you can use '*' to expose all header when no credentials,multiple header use ',' to split. default: *.","default":"*","type":"string"}}},"example-plugin":{"type":"object","properties":{"s":{"type":"string"},"t":{"type":"array","minItems":1},"i":{"type":"number","minimum":0},"port":{"type":"integer"},"ip":{"type":"string"}},"required":["i"]},"limit-conn":{
 "type":"object","properties":{"conn":{"type":"integer","minimum":0},"default_conn_delay":{"type":"number","minimum":0},"rejected_code":{"type":"integer","minimum":200,"default":503},"burst":{"type":"integer","minimum":0},"key":{"type":"string","enum":["remote_addr","server_addr","http_x_real_ip","http_x_forwarded_for"]}},"required":["conn","burst","default_conn_delay","key"]},"proxy-cache":{"type":"object","properties":{"cache_bypass":{"type":"array","minItems":1,"items":{"type":"string","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)"}},"no_cache":{"type":"array","minItems":1,"items":{"type":"string","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)"}},"hide_cache_headers":{"type":"boolean","default":false},"cache_http_status":{"default":[200,301,404],"minItems":1,"items":{"description":"http response status","minimum":200,"maximum":599,"type":"integer"},"type":"array","uniqueItems":true},"cache_method":{"default":["GET","HEAD"],"minItems":1,"items":{"description":"http method","type":"string"
 ,"enum":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"]},"type":"array","uniqueItems":true},"cache_zone":{"type":"string","minLength":1},"cache_key":{"type":"array","minItems":1,"items":{"description":"a key for caching","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)","type":"string"},"default":["$host","$request_uri"]}},"required":["cache_zone"]},"zipkin":{"type":"object","properties":{"sample_ratio":{"type":"number","minimum":1e-05,"maximum":1},"endpoint":{"type":"string"},"server_addr":{"type":"string","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$","description":"default is $server_addr, you can speific your external ip address"},"service_name":{"type":"string","default":"APISIX","description":"service name for zipkin reporter"}},"required":["endpoint","sample_ratio"]},"batch-requests":{"type":"object","additionalProperties":false}}}
+{"main":{"consumer":{"type":"object","additionalProperties":false,"required":["username"],"properties":{"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"username":{"type":"string","pattern":"^[a-zA-Z0-9_]+$","maxLength":32,"minLength":1},"update_time":{"type":"integer"},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"desc":{"type":"string","maxLength":256},"create_time":{"type":"integer"},"plugins":{"type":"object"}}},"proto":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"type":"string","maxLength":1048576,"minLength":1}}},"ip_def":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{
 1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"upstream_hash_vars_schema":{"type":"string","pattern":"^((uri|server_name|server_addr|request_uri|remote_port|remote_addr|query_string|host|hostname)|arg_[0-9a-zA-z_-]+)$"},"global_rule":{"type":"object","additionalProperties":false,"required":["plugins"],"properties":{"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"plugins":{"type":"object"}}},"label_value_def":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"},"id_schema":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"ssl":{"type":"o
 bject","additionalProperties":false,"oneOf":[{"required":["sni","key","cert"]},{"required":["snis","key","cert"]}],"properties":{"create_time":{"type":"integer"},"update_time":{"type":"integer"},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"certs":{"type":"array","items":{"type":"string","maxLength":65536,"minLength":128}},"keys":{"type":"array","items":{"type":"string","maxLength":65536,"minLength":128}},"validity_start":{"type":"integer"},"validity_end":{"type":"integer"},"key":{"type":"string","maxLength":65536,"minLength":128},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"status":{"description":"ssl status, 1 to enable, 0 to disable","enum":[1,0],"type":"integer","default":1},"snis":{"type":"array","items":{"type":
 "string","pattern":"^\\*?[0-9a-zA-Z-.]+$"}},"sni":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"exptime":{"type":"integer","minimum":1588262400},"cert":{"type":"string","maxLength":65536,"minLength":128}}},"plugin_disable_schema":{"disable":{"type":"boolean"}},"service":{"type":"object","additionalProperties":false,"properties":{"create_time":{"type":"integer"},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"upstream_id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_inf
 o"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"nodes":{"anyOf":[{"type":"object","minProperties":1,"patternProperties":{".*":{"description":"weight of node","type":"integer","minimum":0}}},{"type":"array","items":{"type":"object","required":["host","port","weight"],"properties":{"metadata":{"description":"metadata of node","type":"object"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"description":"port of node","type":"integer","minimum":1},"weight":{"description":"weight of node","type":"integer","minimum":0}}},"minItems":1}]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"desc":{"type":"string","maxLength":256},"hash_on":{"type":"string","enum":["vars","header","cookie","consumer"],"default":"vars"},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"host":{"type":"string
 ","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"type":"integer","maximum":65535,"minimum":1},"http_path":{"type":"string","default":"/"},"req_headers":{"type":"array","items":{"type":"string","uniqueItems":true},"minItems":1},"timeout":{"type":"number","default":1},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,302]}}},"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"concurrency":{"type":"integer","default":10},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","default":3,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},
 "http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,404,500,501,502,503,504,505]}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308]}}},"unhealthy":{"type":"object","properties":{"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"timeouts":{"type":"integer","default":7,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type"
 :"integer","maximum":599,"minimum":200},"default":[429,500,503]}}}}}}},"service_name":{"type":"string","maxLength":50},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"name":{"type":"string","maxLength":50},"pass_host":{"description":"mod of host passing","enum":["pass","node","rewrite"],"type":"string","default":"pass"},"discovery_type":{"description":"discovery type","type":"string"},"timeout":{"type":"object","required":["connect","send","read"],"properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"update_time":{"type
 ":"integer"},"type":{"description":"algorithms of load balancing","enum":["chash","roundrobin","ewma"],"type":"string"},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"retries":{"type":"integer","minimum":0},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"backend_type":{"type":"string","enum":["svc","pod"],"description":"k8s service name","default":"pod"},"service_name":{"type":"string","description":"k8s service name"},"deploy_name":{"type":"string","description":"k8s deployment name"},"port":{"type":"number","minimum":0}}}}},"update_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"script":{"type":"string","maxLength":102400,"minLength":10},"plugins":{"type":"object"},"name":{"type":"string","maxLength":50}}},"upstream":{"type":"object","additionalProperties
 ":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"nodes":{"anyOf":[{"type":"object","minProperties":1,"patternProperties":{".*":{"description":"weight of node","type":"integer","minimum":0}}},{"type":"array","items":{"type":"object","required":["host","port","weight"],"properties":{"metadata":{"description":"metadata of node","type":"object"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"description":"port of node","type":"integer","minimum":1},"weight":{"description":"weight of node","type":"integer","minimum":0}}},"minItems":1}]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"desc":{"type":"string","maxLength":256},"hash_on":{"type":"string","enum":["vars","header","cookie","consumer"],"default":"vars"},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperti
 es":false,"properties":{"active":{"type":"object","properties":{"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"type":"integer","maximum":65535,"minimum":1},"http_path":{"type":"string","default":"/"},"req_headers":{"type":"array","items":{"type":"string","uniqueItems":true},"minItems":1},"timeout":{"type":"number","default":1},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,302]}}},"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"concurrency":{"type":"integer","default":10},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","default":3,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,
 "minimum":1},"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,404,500,501,502,503,504,505]}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308]}}},"unhealthy":{"type":"object","properties":{"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"timeouts":{"type":"integer","default":7,"maximum":254,"minim
 um":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,500,503]}}}}}}},"service_name":{"type":"string","maxLength":50},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"name":{"type":"string","maxLength":50},"pass_host":{"description":"mod of host passing","enum":["pass","node","rewrite"],"type":"string","default":"pass"},"discovery_type":{"description":"discovery type","type":"string"},"timeout":{"type":"object","required":["connect","send","read"],"properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":
 64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"update_time":{"type":"integer"},"type":{"description":"algorithms of load balancing","enum":["chash","roundrobin","ewma"],"type":"string"},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"retries":{"type":"integer","minimum":0},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"backend_type":{"type":"string","enum":["svc","pod"],"description":"k8s service name","default":"pod"},"service_name":{"type":"string","description":"k8s service name"},"deploy_name":{"type":"string","description":"k8s deployment name"},"port":{"type":"number","minimum":0}}}}},"route":{"anyOf":[{"required":["plugins","uri"]},{"required":["upstream","uri"]},{"required":["upstream_id","uri"]},{"required":["service_id","uri"]},{"required":["plug
 ins","uris"]},{"required":["upstream","uris"]},{"required":["upstream_id","uris"]},{"required":["service_id","uris"]},{"required":["script","uri"]},{"required":["script","uris"]}],"properties":{"hosts":{"type":"array","uniqueItems":true,"items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"}},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"create_time":{"type":"integer"},"uris":{"type":"array","uniqueItems":true,"items":{"description":"HTTP uri","type":"string"}},"filter_func":{"type":"string","pattern":"^function","minLength":10},"vars":{"type":"array","items":{"description":"Nginx builtin variable name and value","items":{"maxItems":3,"anyOf":[{"type":"string"},{"type":"number"}],"minItems":2},"type":"array"}},"script":{"type":"string","maxLength":102400,"minLength":10},"uri":{"type":"string","maxLength":4096,"minLength":1},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"priority":{"type":"i
 nteger","default":0},"plugins":{"type":"object"},"service_protocol":{"enum":["grpc","http"]},"methods":{"type":"array","uniqueItems":true,"items":{"description":"HTTP method","enum":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"],"type":"string"}},"upstream_id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"remote_addr":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"labels":{"description":"key/value pairs to specify attributes","maxProperties"
 :16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"nodes":{"anyOf":[{"type":"object","minProperties":1,"patternProperties":{".*":{"description":"weight of node","type":"integer","minimum":0}}},{"type":"array","items":{"type":"object","required":["host","port","weight"],"properties":{"metadata":{"description":"metadata of node","type":"object"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"description":"port of node","type":"integer","minimum":1},"weight":{"description":"weight of node","type":"integer","minimum":0}}},"minItems":1}]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"desc":{"type":"string","maxLength":256
 },"hash_on":{"type":"string","enum":["vars","header","cookie","consumer"],"default":"vars"},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"type":"integer","maximum":65535,"minimum":1},"http_path":{"type":"string","default":"/"},"req_headers":{"type":"array","items":{"type":"string","uniqueItems":true},"minItems":1},"timeout":{"type":"number","default":1},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,302]}}},"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"concurrency":{"type":"integer","default":10},"unhealthy":{"type"
 :"object","properties":{"timeouts":{"type":"integer","default":3,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,404,500,501,502,503,504,505]}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308]}}},"unhealthy":{"type":"object","properties":{"
 http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"timeouts":{"type":"integer","default":7,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,500,503]}}}}}}},"service_name":{"type":"string","maxLength":50},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"name":{"type":"string","maxLength":50},"pass_host":{"description":"mod of host passing","enum":["pass","node","rewrite"],"type":"string","default":"pass"},"discovery_type":{"description":"discovery type","type":"string"},"timeout":{"type":"object","required":["connect","send","read"],"properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"re
 ad":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"update_time":{"type":"integer"},"type":{"description":"algorithms of load balancing","enum":["chash","roundrobin","ewma"],"type":"string"},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"retries":{"type":"integer","minimum":0},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"required":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"backend_type":{"type":"string","enum":["svc","pod"],"description":"k8s service name","default":"pod"},"service_name":{"type":"string","description":"k8s service name"},"deploy_name":{"type":"string","description":"k8s deployment name"},"por
 t":{"type":"number","minimum":0}}}}},"update_time":{"type":"integer"},"desc":{"type":"string","maxLength":256},"service_id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"remote_addrs":{"type":"array","uniqueItems":true,"items":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"}},"name":{"type":"string","maxLength":50}},"type":"object","not":{"anyOf":[{"required":["script","plugins"]}]},"additionalProperties":false},"version":0.5,"stream_route":{"type":"object","properties"
 :{"remote_addr":{"description":"client IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"upstream":{"type":"object","additionalProperties":false,"anyOf":[{"required":["type","nodes"]},{"required":["type","k8s_deployment_info"]},{"required":["type","service_name"]}],"properties":{"create_time":{"type":"integer"},"nodes":{"anyOf":[{"type":"object","minProperties":1,"patternProperties":{".*":{"description":"weight of node","type":"integer","minimum":0}}},{"type":"array","items":{"type":"object","required":["host","port","weight"],"properties":{"metadata":{"description
 ":"metadata of node","type":"object"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"description":"port of node","type":"integer","minimum":1},"weight":{"description":"weight of node","type":"integer","minimum":0}}},"minItems":1}]},"upstream_host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"desc":{"type":"string","maxLength":256},"hash_on":{"type":"string","enum":["vars","header","cookie","consumer"],"default":"vars"},"checks":{"type":"object","anyOf":[{"required":["active"]},{"required":["active","passive"]}],"additionalProperties":false,"properties":{"active":{"type":"object","properties":{"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"port":{"type":"integer","maximum":65535,"minimum":1},"http_path":{"type":"string","default":"/"},"req_headers":{"type":"array","items":{"type":"string","uniqueItems":true},"minItems":1},"timeout":{"type":"number","default":1},"healthy":{"type":"object","properties":{"successes":{"type":"integer","default":2,"m
 aximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,302]}}},"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"concurrency":{"type":"integer","default":10},"unhealthy":{"type":"object","properties":{"timeouts":{"type":"integer","default":3,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"interval":{"type":"integer","default":0,"minimum":1},"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,404,500,501,502,503,504,505]}}},"https_verify_certificate":{"type":"boolean","default":true}}},"passive":{"type":"object","properties":{"type":{"type":"string","enum":["http","https","tcp"],"default":"http"},"healt
 hy":{"type":"object","properties":{"successes":{"type":"integer","default":5,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308]}}},"unhealthy":{"type":"object","properties":{"http_failures":{"type":"integer","default":5,"maximum":254,"minimum":1},"tcp_failures":{"type":"integer","default":2,"maximum":254,"minimum":1},"timeouts":{"type":"integer","default":7,"maximum":254,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":200},"default":[429,500,503]}}}}}}},"service_name":{"type":"string","maxLength":50},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"enable_websocket":{"description":"enable websocket for request","type":"boolean"},"name":{"type":"string
 ","maxLength":50},"pass_host":{"description":"mod of host passing","enum":["pass","node","rewrite"],"type":"string","default":"pass"},"discovery_type":{"description":"discovery type","type":"string"},"timeout":{"type":"object","required":["connect","send","read"],"properties":{"send":{"type":"number","minimum":0},"connect":{"type":"number","minimum":0},"read":{"type":"number","minimum":0}}},"labels":{"description":"key/value pairs to specify attributes","maxProperties":16,"type":"object","patternProperties":{".*":{"description":"value of label","maxLength":64,"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9-_.]+$"}}},"update_time":{"type":"integer"},"type":{"description":"algorithms of load balancing","enum":["chash","roundrobin","ewma"],"type":"string"},"key":{"description":"the key of chash for dynamic load balancing","type":"string"},"retries":{"type":"integer","minimum":0},"k8s_deployment_info":{"type":"object","anyOf":[{"required":["namespace","deploy_name","port"]},{"requi
 red":["namespace","service_name","port"]}],"properties":{"namespace":{"type":"string","description":"k8s namespace"},"backend_type":{"type":"string","enum":["svc","pod"],"description":"k8s service name","default":"pod"},"service_name":{"type":"string","description":"k8s service name"},"deploy_name":{"type":"string","description":"k8s deployment name"},"port":{"type":"number","minimum":0}}}}},"plugins":{"type":"object"},"id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"server_port":{"description":"server port","type":"integer"},"server_addr":{"description":"server IP","anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"
 IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}],"type":"string"},"upstream_id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]}}},"upstream_hash_header_schema":{"type":"string","pattern":"^[a-zA-Z0-9-_]+$"},"host_def":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"}},"plugins":{"zipkin":{"schema":{"type":"object","required":["endpoint","sample_ratio"],"properties":{"service_name":{"type":"string","description":"service name for zipkin reporter","default":"APISIX"},"endpoint":{"type":"string"},"sample_ratio":{"type":"number","maximum":1,"minimum":1e-05},"server_addr":{"type":"string","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$","description":"default is $server_addr, you can speific your external ip address"}}}},"udp-logger":{"schema":{"type":"object","required":["host","port"],"properties":{"include_req_body":{"type":"boolean","default":false
 },"host":{"type":"string"},"port":{"type":"integer","minimum":0},"batch_max_size":{"type":"integer","default":1000,"minimum":1},"inactive_timeout":{"type":"integer","default":5,"minimum":1},"buffer_duration":{"type":"integer","default":60,"minimum":1},"timeout":{"type":"integer","default":3,"minimum":1},"name":{"type":"string","default":"udp logger"}}}},"uri-blocker":{"schema":{"type":"object","required":["block_rules"],"properties":{"rejected_code":{"type":"integer","default":403,"minimum":200},"block_rules":{"type":"array","uniqueItems":true,"items":{"type":"string","maxLength":4096,"minLength":1}}}}},"authz-keycloak":{"schema":{"type":"object","required":["token_endpoint"],"properties":{"ssl_verify":{"type":"boolean","default":true},"token_endpoint":{"type":"string","maxLength":4096,"minLength":1},"policy_enforcement_mode":{"type":"string","enum":["ENFORCING","PERMISSIVE"],"default":"ENFORCING"},"permissions":{"type":"array","uniqueItems":true,"items":{"type":"string","maxLength"
 :100,"minLength":1}},"audience":{"type":"string","maxLength":100,"minLength":1},"timeout":{"type":"integer","default":3000,"minimum":1000},"grant_type":{"minLength":1,"maxLength":100,"type":"string","enum":["urn:ietf:params:oauth:grant-type:uma-ticket"],"default":"urn:ietf:params:oauth:grant-type:uma-ticket"},"keepalive_pool":{"type":"integer","default":5,"minimum":1},"keepalive_timeout":{"type":"integer","default":60000,"minimum":1000},"keepalive":{"type":"boolean","default":true}}}},"limit-count":{"schema":{"type":"object","dependencies":{"policy":{"oneOf":[{"properties":{"policy":{"enum":["local"]}}},{"required":["redis_host"],"properties":{"redis_timeout":{"type":"integer","default":1000,"minimum":1},"redis_password":{"type":"string","minLength":0},"policy":{"enum":["redis"]},"redis_host":{"type":"string","minLength":2},"redis_port":{"type":"integer","default":6379,"minimum":1}}},{"required":["redis_cluster_nodes"],"properties":{"redis_timeout":{"type":"integer","default":1000,"
 minimum":1},"policy":{"enum":["redis-cluster"]},"redis_cluster_nodes":{"type":"array","items":{"type":"string","maxLength":100,"minLength":2},"minItems":2},"redis_password":{"type":"string","minLength":0}}}]}},"required":["count","time_window","key"],"properties":{"key":{"type":"string","enum":["remote_addr","server_addr","http_x_real_ip","http_x_forwarded_for","consumer_name","service_id"]},"time_window":{"type":"integer","minimum":0},"policy":{"type":"string","enum":["local","redis","redis-cluster"],"default":"local"},"rejected_code":{"type":"integer","default":503,"maximum":600,"minimum":200},"count":{"type":"integer","minimum":0}}}},"hmac-auth":{"schema":{"type":"object","additionalProperties":false,"title":"work with route or service object","properties":[]},"consumer_schema":{"properties":{"clock_skew":{"type":"integer","default":0},"signed_headers":{"type":"array","items":{"type":"string","maxLength":50,"minLength":1}},"keep_headers":{"type":"boolean","title":"whether to keep
  the http request header","default":false},"secret_key":{"type":"string","maxLength":256,"minLength":1},"algorithm":{"type":"string","enum":["hmac-sha1","hmac-sha256","hmac-sha512"],"default":"hmac-sha256"},"access_key":{"type":"string","maxLength":256,"minLength":1}},"type":"object","additionalProperties":false,"title":"work with consumer object","required":["access_key","secret_key"]}},"request-id":{"schema":{"type":"object","properties":{"header_name":{"type":"string","default":"X-Request-Id"},"include_in_response":{"type":"boolean","default":true}}}},"proxy-cache":{"schema":{"type":"object","required":["cache_zone"],"properties":{"cache_http_status":{"minItems":1,"type":"array","uniqueItems":true,"items":{"description":"http response status","maximum":599,"type":"integer","minimum":200},"default":[200,301,404]},"cache_bypass":{"type":"array","items":{"type":"string","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)"},"minItems":1},"cache_method":{"minItems":1,"type":"array","uniqueItem
 s":true,"items":{"description":"http method","enum":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"],"type":"string"},"default":["GET","HEAD"]},"cache_zone":{"type":"string","minLength":1},"no_cache":{"type":"array","items":{"type":"string","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)"},"minItems":1},"cache_key":{"type":"array","minItems":1,"items":{"description":"a key for caching","pattern":"(^[^\\$].+$|^\\$[0-9a-zA-Z_]+$)","type":"string"},"default":["$host","$request_uri"]},"hide_cache_headers":{"type":"boolean","default":false}}}},"fault-injection":{"schema":{"type":"object","minProperties":1,"properties":{"delay":{"type":"object","minProperties":1,"properties":{"duration":{"type":"number","minimum":0},"percentage":{"type":"integer","maximum":100,"minimum":0}}},"abort":{"type":"object","minProperties":1,"properties":{"percentage":{"type":"integer","maximum":100,"minimum":0},"http_status":{"type":"integer","minimum":200},"body":{"type":"string","minLength":
 0}}}}}},"serverless-post-function":{"schema":{"type":"object","required":["functions"],"properties":{"functions":{"type":"array","items":{"type":"string"},"minItems":1},"phase":{"type":"string","enum":["rewrite","access","header_filter","body_filter","log","balancer"]}}}},"ip-restriction":{"schema":{"type":"object","oneOf":[{"additionalProperties":false,"required":["whitelist"],"title":"whitelist","properties":{"whitelist":{"type":"array","items":{"anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}]},"minItems":1}}},{"additionalProperties":false,"required":["blacklist"],"title":"blacklist"
 ,"properties":{"blacklist":{"type":"array","items":{"anyOf":[{"type":"string","title":"IPv4","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"},{"type":"string","title":"IPv4/CIDR","pattern":"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}$"},{"type":"string","title":"IPv6","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?$"},{"type":"string","title":"IPv6/CIDR","pattern":"^([a-fA-F0-9]{0,4}:){0,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$"}]},"minItems":1}}}]}},"cors":{"schema":{"type":"object","properties":{"allow_methods":{"description":"you can use '*' to allow all methods when no credentials and '**','**' to allow forcefully(it will bring some security risks, be carefully),multiple method use ',' to split. default: *.","type":"string","default":"*"},"allow_headers":{"description":"you can use '*' to allow all header when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple he
 ader use ',' to split. default: *.","type":"string","default":"*"},"max_age":{"description":"maximum number of seconds the results can be cached.-1 mean no cached,the max value is depend on browser,more detail plz check MDN. default: 5.","type":"integer","default":5},"allow_origins":{"description":"you can use '*' to allow all origins when no credentials,'**' to allow forcefully(it will bring some security risks, be carefully),multiple origin use ',' to split. default: *.","type":"string","default":"*"},"expose_headers":{"description":"you can use '*' to expose all header when no credentials,multiple header use ',' to split. default: *.","type":"string","default":"*"},"allow_credential":{"description":"allow client append crendential. according to CORS specification,if you set this option to 'true', you can not use '*' for other options.","type":"boolean","default":false}}}},"key-auth":{"schema":{"type":"object","properties":{"key":{"type":"string"}}}},"node-status":{"schema":{"type
 ":"object","additionalProperties":false}},"http-logger":{"schema":{"type":"object","required":["uri"],"properties":{"retry_delay":{"type":"integer","default":1,"minimum":0},"include_req_body":{"type":"boolean","default":false},"concat_method":{"type":"string","enum":["json","new_line"],"default":"json"},"max_retry_count":{"type":"integer","default":0,"minimum":0},"timeout":{"type":"integer","default":3,"minimum":1},"batch_max_size":{"type":"integer","default":1000,"minimum":1},"auth_header":{"type":"string","default":""},"inactive_timeout":{"type":"integer","default":5,"minimum":1},"buffer_duration":{"type":"integer","default":60,"minimum":1},"uri":{"type":"string"},"name":{"type":"string","default":"http logger"}}}},"openid-connect":{"schema":{"type":"object","required":["client_id","client_secret","discovery"],"properties":{"ssl_verify":{"type":"boolean"},"redirect_uri":{"type":"string"},"discovery":{"type":"string"},"scope":{"type":"string"},"client_secret":{"type":"string"},"int
 rospection_endpoint":{"type":"string"},"logout_path":{"type":"string"},"timeout":{"type":"integer","minimum":1},"public_key":{"type":"string"},"token_signing_alg_values_expected":{"type":"string"},"realm":{"type":"string"},"introspection_endpoint_auth_method":{"type":"string"},"client_id":{"type":"string"},"bearer_only":{"type":"boolean"}}}},"kafka-logger":{"schema":{"type":"object","required":["broker_list","kafka_topic","key"],"properties":{"meta_format":{"type":"string","enum":["default","origin"],"default":"default"},"include_req_body":{"type":"boolean","default":false},"max_retry_count":{"type":"integer","default":0,"minimum":0},"batch_max_size":{"type":"integer","default":1000,"minimum":1},"inactive_timeout":{"type":"integer","default":5,"minimum":1},"key":{"type":"string"},"buffer_duration":{"type":"integer","default":60,"minimum":1},"retry_delay":{"type":"integer","default":1,"minimum":0},"name":{"type":"string","default":"kafka logger"},"timeout":{"type":"integer","default"
 :3,"minimum":1},"broker_list":{"type":"object"},"kafka_topic":{"type":"string"}}}},"jwt-auth":{"schema":{"type":"object","properties":[],"additionalProperties":false},"consumer_schema":{"type":"object","properties":{"key":{"type":"string"},"base64_secret":{"type":"boolean","default":false},"secret":{"type":"string"},"algorithm":{"type":"string","enum":["HS256","HS512","RS256"],"default":"HS256"},"exp":{"type":"integer","minimum":1}},"required":["key"],"additionalProperties":false}},"proxy-mirror":{"schema":{"type":"object","minProperties":1,"required":["host"],"properties":{"host":{"type":"string","pattern":"^http(s)?:\\/\\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?$"}}}},"api-breaker":{"schema":{"type":"object","required":["break_response_code"],"properties":{"healthy":{"type":"object","default":{"successes":3,"http_statuses":[200]},"properties":{"successes":{"type":"integer","default":3,"minimum":1},"http_statuses":{"minItems":1,"type":"array","
 uniqueItems":true,"items":{"type":"integer","maximum":499,"minimum":200},"default":[200]}}},"break_response_code":{"type":"integer","maximum":599,"minimum":200},"unhealthy":{"type":"object","default":{"failures":3,"http_statuses":[500]},"properties":{"failures":{"type":"integer","default":3,"minimum":1},"http_statuses":{"minItems":1,"type":"array","uniqueItems":true,"items":{"type":"integer","maximum":599,"minimum":500},"default":[500]}}},"max_breaker_sec":{"type":"integer","default":300,"minimum":3}}}},"request-validation":{"schema":{"type":"object","anyOf":[{"required":["body_schema"],"title":"Body schema","properties":{"body_schema":{"type":"object"}}},{"required":["header_schema"],"title":"Header schema","properties":{"header_schema":{"type":"object"}}}]}},"limit-conn":{"schema":{"type":"object","required":["conn","burst","default_conn_delay","key"],"properties":{"default_conn_delay":{"type":"number","exclusiveMinimum":0},"conn":{"type":"integer","exclusiveMinimum":0},"key":{"ty
 pe":"string","enum":["remote_addr","server_addr","http_x_real_ip","http_x_forwarded_for","consumer_name"]},"rejected_code":{"type":"integer","default":503,"minimum":200},"burst":{"type":"integer","minimum":0}}}},"tcp-logger":{"schema":{"type":"object","required":["host","port"],"properties":{"retry_delay":{"type":"integer","default":1,"minimum":0},"host":{"type":"string"},"port":{"type":"integer","minimum":0},"max_retry_count":{"type":"integer","default":0,"minimum":0},"include_req_body":{"type":"boolean","default":false},"timeout":{"type":"integer","default":1000,"minimum":1},"batch_max_size":{"type":"integer","default":1000,"minimum":1},"inactive_timeout":{"type":"integer","default":5,"minimum":1},"tls":{"type":"boolean","default":false},"buffer_duration":{"type":"integer","default":60,"minimum":1},"tls_options":{"type":"string"},"name":{"type":"string","default":"tcp logger"}}}},"referer-restriction":{"schema":{"type":"object","additionalProperties":false,"required":["whitelist"]
 ,"properties":{"whitelist":{"type":"array","items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-.]+$"},"minItems":1},"bypass_missing":{"type":"boolean","default":false}}}},"syslog":{"schema":{"type":"object","required":["host","port"],"properties":{"host":{"type":"string"},"port":{"type":"integer"},"include_req_body":{"type":"boolean","default":false},"drop_limit":{"type":"integer","default":1048576},"buffer_duration":{"type":"integer","default":60,"minimum":1},"flush_limit":{"type":"integer","default":4096,"minimum":1},"batch_max_size":{"type":"integer","default":1000,"minimum":1},"timeout":{"type":"integer","default":3,"minimum":1},"retry_interval":{"type":"integer","default":1,"minimum":0},"max_retry_times":{"type":"integer","default":1,"minimum":1},"tls":{"type":"boolean","default":false},"pool_size":{"type":"integer","default":5,"minimum":5},"sock_type":{"type":"string","enum":["tcp","udp"],"default":"tcp"},"name":{"type":"string","default":"sys logger"}}}},"grpc-transcode":{"sc
 hema":{"type":"object","additionalProperties":true,"required":["proto_id","service","method"],"properties":{"service":{"description":"the grpc service name","type":"string"},"deadline":{"description":"deadline for grpc, millisecond","type":"number","default":0},"pb_option":{"type":"array","items":{"type":"string","anyOf":[{"description":"enum as result","enum":["int64_as_number","int64_as_string","int64_as_hexstring"],"type":"string"},{"description":"int64 as result","enum":["ienum_as_name","enum_as_value"],"type":"string"},{"description":"default values option","enum":["auto_default_values","no_default_values","use_default_values","use_default_metatable"],"type":"string"},{"description":"hooks option","enum":["enable_hooks","disable_hooks"],"type":"string"}]},"minItems":1},"proto_id":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9-_]+$","maxLength":64,"minLength":1},{"type":"integer","minimum":1}]},"method":{"description":"the method name in the grpc service.","type":"string"}}}}
 ,"limit-req":{"schema":{"type":"object","required":["rate","burst","key"],"properties":{"burst":{"type":"number","minimum":0},"key":{"type":"string","enum":["remote_addr","server_addr","http_x_real_ip","http_x_forwarded_for","consumer_name"]},"rate":{"type":"number","minimum":0},"rejected_code":{"type":"integer","default":503,"minimum":200}}}},"example-plugin":{"schema":{"type":"object","required":["i"],"properties":{"t":{"type":"array","minItems":1},"port":{"type":"integer"},"i":{"type":"number","minimum":0},"ip":{"type":"string"},"s":{"type":"string"}}}},"serverless-pre-function":{"schema":{"type":"object","required":["functions"],"properties":{"functions":{"type":"array","items":{"type":"string"},"minItems":1},"phase":{"type":"string","enum":["rewrite","access","header_filter","body_filter","log","balancer"]}}}},"basic-auth":{"schema":{"type":"object","additionalProperties":false,"title":"work with route or service object","properties":[]},"consumer_schema":{"properties":{"userna
 me":{"type":"string"},"password":{"type":"string"}},"type":"object","additionalProperties":false,"title":"work with consumer object","required":["username","password"]}},"wolf-rbac":{"schema":{"type":"object","properties":{"server":{"type":"string","default":"http://127.0.0.1:10080"},"appid":{"type":"string","default":"unset"},"header_prefix":{"type":"string","default":"X-"}}}},"log-rotate":{"schema":{"type":"object","additionalProperties":false,"properties":[]}},"response-rewrite":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"body_base64":{"description":"whether new body for repsonse need base64 decode before return","type":"boolean","default":false},"status_code":{"description":"new status code for repsonse","maximum":598,"type":"integer","minimum":200},"body":{"description":"new body for repsonse","type":"string"},"headers":{"description":"new headers for repsonse","minProperties":1,"type":"object"}}}},"consumer-restriction":{"schema":{"
 type":"object","oneOf":[{"required":["blacklist"],"title":"blacklist","properties":{"type":{"type":"string","enum":["consumer_name","service_id"],"default":"consumer_name"},"rejected_code":{"type":"integer","default":403,"minimum":200},"blacklist":{"type":"array","items":{"type":"string"},"minItems":1}}},{"required":["whitelist"],"title":"whitelist","properties":{"type":{"type":"string","enum":["consumer_name","service_id"],"default":"consumer_name"},"rejected_code":{"type":"integer","default":403,"minimum":200},"whitelist":{"type":"array","items":{"type":"string"},"minItems":1}}}]}},"redirect":{"schema":{"type":"object","oneOf":[{"required":["uri"]},{"required":["http_to_https"]}],"properties":{"http_to_https":{"type":"boolean"},"ret_code":{"type":"integer","default":302,"minimum":200},"uri":{"type":"string","minLength":2}}}},"proxy-rewrite":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"scheme":{"description":"new scheme for upstream","enu
 m":["http","https"],"type":"string"},"host":{"description":"new host for upstream","pattern":"^[0-9a-zA-Z-.]+$","type":"string"},"regex_uri":{"description":"new uri that substitute from client uri for upstream, lower priority than uri property","type":"array","minItems":2,"items":{"description":"regex uri","type":"string"},"maxItems":2},"headers":{"description":"new headers for request","minProperties":1,"type":"object"},"uri":{"description":"new uri for upstream","maxLength":4096,"type":"string","pattern":"^\\/.*","minLength":1}}}},"batch-requests":{"schema":{"type":"object","additionalProperties":false}},"prometheus":{"schema":{"type":"object","additionalProperties":false}},"echo":{"schema":{"anyOf":[{"required":["before_body"]},{"required":["body"]},{"required":["after_body"]}],"properties":{"after_body":{"description":"body after the modification of filter phase.","type":"string"},"headers":{"description":"new headers for response","minProperties":1,"type":"object"},"before_body
 ":{"description":"body before the filter phase.","type":"string"},"auth_value":{"description":"auth value","type":"string"},"body":{"description":"body to replace upstream response.","type":"string"}},"type":"object","minProperties":1,"additionalProperties":false}}}}

Review comment:
       got it~!

##########
File path: api/build-tools/schema-sync.lua
##########
@@ -78,6 +78,9 @@ ngx.timer = {}
 ngx.location = {}
 ngx.socket = {}
 ngx.re.gmatch = empty_function
+ngx.shared = {
+    ["plugin-api-breaker"] = {}

Review comment:
       got it~!

##########
File path: api/internal/core/store/validate.go
##########
@@ -230,14 +231,21 @@ func (v *APISIXJsonSchemaValidator) Validate(obj interface{}) error {
 	}
 
 	//check plugin json schema
-	plugins := getPlugins(obj)
+	plugins, schemaType := getPlugins(obj)
+	//fix lua json.encode transform lua{properties={}} to json{"properties":[]}
+	reg := regexp.MustCompile(`\"properties\":\[\]`)
 	if plugins != nil {
 		for pluginName, pluginConf := range plugins {
-			schemaDef := conf.Schema.Get("plugins." + pluginName).String()
+			var schemaDef string
+			schemaDef = conf.Schema.Get("plugins." + pluginName + "." +schemaType).String()

Review comment:
       done~!

##########
File path: api/internal/handler/plugin/plugin_test.go
##########
@@ -55,4 +55,48 @@ func TestPlugin(t *testing.T) {
 	ctx.SetInput(input2)
 	val, _ = handler.Schema(ctx)
 	assert.Nil(t, val)
+
+	/*
+	 get plugin schema with schema_type: consumer
+	 plugin has consumer_schema
+	 return plugin`s consumer_schema
+	*/
+	input3 := &GetInput{}
+	reqBody = `{
+		"name": "jwt-auth",
+		"schema_type": "consumer"
+  }`

Review comment:
       done~!

##########
File path: api/internal/handler/plugin/plugin_test.go
##########
@@ -55,4 +55,48 @@ func TestPlugin(t *testing.T) {
 	ctx.SetInput(input2)
 	val, _ = handler.Schema(ctx)
 	assert.Nil(t, val)
+
+	/*
+	 get plugin schema with schema_type: consumer
+	 plugin has consumer_schema
+	 return plugin`s consumer_schema
+	*/
+	input3 := &GetInput{}

Review comment:
       done~!




----------------------------------------------------------------
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