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/08/19 11:41:40 UTC

[GitHub] [apisix] juzhiyuan opened a new issue #2082: request help: Update Plugin'

juzhiyuan opened a new issue #2082:
URL: https://github.com/apache/apisix/issues/2082


   ### Issue description
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS:
   


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-714225553


   - [ ] proxy-rewrite
   
   ![image](https://user-images.githubusercontent.com/2106987/96826430-ee779980-1465-11eb-8111-f347fda71cbf.png)
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716312237


   add for tracing jwt-auth: https://github.com/apache/apisix/issues/2288


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716356064


   > * [ ]  proxy-rewrite
   > 
   
   
   I have **a proposal** for this header's schema modification: @juzhiyuan 
   
   - The schema provided by APISIX stays the same, because the type of parameter in header can only be defined when the user designs it
   
   - dashboard(plugin component) Adapt the schema that the user needs. 
   ---
   
   take `proxy-rewrite` as an example:
   
   - the header schema returned by APISIX is:
   ```json
   "headers": {
       "description": "new headers for request",
       "minProperties": 1,
       "type": "object"
   }
   ```
   
   - dashboard adapt the header schema to:
   ```json
   {
       "type": "array",
       "items": {
           "type": "object",
           "properties": {
               "key": {
                   "type": "string"
   	    },
   	   "value": {
   	       "type": "object",
                  "oneOf": [{
                      "title": "value type is string",
                      "properties": {
                          "value": {
   		           "type": "string"
   			}
   		    }
   		},
   		{
   		    "title": "value type is number",
   		    "properties": {
   		        "value": {
   			    "type": "number"
   			}
   		     }
   		}]
              }
          }
      }
   }
   ```
   
   - the `proxy-rewrite` config page in dashboard looks like:
   [default looks]
   ![2020-10-26 14-52-28屏幕截图](https://user-images.githubusercontent.com/2561857/97142100-fd7a8680-179a-11eb-8e68-48c2ae06f10c.png)
   [define parameters looks]
   ![mmexport1603696063565](https://user-images.githubusercontent.com/2561857/97144848-281b0e00-17a0-11eb-882b-e5452f002ffa.jpg)
   
   
   
   - the data posted to the APISIX:
   ```json
   "proxy-rewrite": {
           ...configdata,
   	"headers": {
   	    "token": {
   		"value": "345345-reertert"
   	    }
   	}
   }
   ```
   
   
   
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-726223914


   - [ ] echo


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

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



[GitHub] [apisix] LiteSun commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722943806


   > > > Should I transform `request-validation` request?
   > > 
   > > 
   > > What's the correct data format for this plugin? cc @liuxiran
   > 
   > yep, request and response transform are also needed, we should transform the data got from schema form to:
   > 
   > ```json
   > {
   >   "body_scheme"?: {
   >     "type": "object",
   >     "required": $key[], // the $key which required: true
   >     "properties": {
   >       [$key]: {
   >           "type": [$valueType],
   >           [$otherkey defined in dependencies]: [$value]
   >       }
   >     }
   >   },
   >   "header_schema"?:{
   >     the same with body_schema
   >    }
   >   }
   > ```
   > 
   > and transform the data got from API to
   > 
   > ```json
   > {
   >    "requestParams": [
   >       {
   >          "body_schema": {
   >              "key": xxx,
   >              "valueType": "",
   >              ....
   >          }
   >       },
   >       {
   >          "header_schema":{}
   >       }
   >       ...
   >    ]
   > }
   > ```
   > 
   > The reason is that fe need schema UI form to help user deine what the parameter verify schema looks like. pass a schema definition to api.
   > 
   > @juzhiyuan @LiteSun
   
   @liuxiran Tks! I still have a question that How to handle multiple body_schema header_schema cases? As showing below:
   ![image](https://user-images.githubusercontent.com/31329157/98342475-6b506900-204b-11eb-9a88-c771c7415e76.png)
   


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716312237


   add for tracking jwt-auth: https://github.com/apache/apisix/issues/2288


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

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



[GitHub] [apisix] juzhiyuan edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-723954643


   - [ ] [example plugin](https://github.com/apache/apisix/issues/2672)


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

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



[GitHub] [apisix] juzhiyuan closed issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan closed issue #2082:
URL: https://github.com/apache/apisix/issues/2082


   


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-755320554


   Oh yes, 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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716356064


   > * [ ]  proxy-rewrite
   > 
   
   
   I have **a proposal** for this header's schema modification: @juzhiyuan 
   
   - The schema provided by APISIX stays the same, because the type of parameter in header can only be defined when the user designs it
   
   - dashboard(plugin component) Adapt the schema that the user needs. 
   ---
   
   take `proxy-rewrite` as an example:
   
   - the header schema returned by APISIX is:
   ```json
   "headers": {
       "description": "new headers for request",
       "minProperties": 1,
       "type": "object"
   }
   ```
   
   - dashboard adapt the header schema to:
   ```json
   {
       "type": "array",
       "items": {
           "type": "object",
           "properties": {
               "key": {
                   "type": "string"
   	    },
   	   "value": {
   	       "type": "object",
                  "oneOf": [{
                      "title": "value type is string",
                      "properties": {
                          "value": {
   		           "type": "string"
   			}
   		    }
   		},
   		{
   		    "title": "value type is number",
   		    "properties": {
   		        "value": {
   			    "type": "number"
   			}
   		     }
   		}]
              }
          }
      }
   }
   ```
   
   - the `proxy-rewrite` config page in dashboard looks like:
   [default looks]
   ![2020-10-26 14-52-28屏幕截图](https://user-images.githubusercontent.com/2561857/97142100-fd7a8680-179a-11eb-8e68-48c2ae06f10c.png)
   [define parameters looks]
   ![mmexport1603696063565](https://user-images.githubusercontent.com/2561857/97144848-281b0e00-17a0-11eb-882b-e5452f002ffa.jpg)
   
   
   
   - the data posted to the APISIX:
   ```json
   "proxy-rewrite": {
           ...configdata,
   	"headers": {
   	    "token": {
   		"value": "345345-reertert"
   	    }
   	}
   }
   ```
   if the header param's value is number, the post data would be:
   ```json
   "proxy-rewrite": {
           ...configdata,
   	"headers": {
   	    "token": {
   		"value": 32
   	    }
   	}
   }
   ```
   
   
   
   


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

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



[GitHub] [apisix] LiteSun commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722807175


   I try to transform `request-validation` schema as you provided, but it seems there is an error. @liuxiran 
   
   ![image](https://user-images.githubusercontent.com/31329157/98326057-46e49480-202b-11eb-996e-f235ee3e25bf.png)
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-723914491


   After communicating with @LiteSun, there are three problems with the **request validation schema** design of the first edition:
   
   1. dirty data: when change from body_schema to header_schema, useless `body_schema` will be generated, and it can not be tranform to UI. 
   **try to update the transform schema to** the follow one
   ```json
   {
       "type": "object",
       "properties": {
         "requestParams": {
           "title": "define request paramers",
           "type": "array",
           "items": {
             "type": "object",
             "$ref": "#/definitions/requestParams"
           },
           "minItems": 1
         }
       },
       "definitions": {
         "requestParams": {
           "type": "object",
           "properties": {
             "schema": {
               "type": "string",
               "enum": [
                 "body_schema",
                 "header_schema"
               ]
             },
             "key": {
               "type": "string"
             },
             "valueType": {
               "type": "string",
               "enum": [
                 "string",
                 "array",
                 "integer",
                 "number",
                 "object",
                 "boolean"
               ]
             },
             "required": {
               "type": "boolean"
             }
           },
           "dependencies": {
             "valueType": {
               "oneOf": [
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "string"
                       ]
                     },
                     "minLength": {
                       "type": "integer"
                     },
                     "maxLength": {
                       "type": "integer"
                     },
                     "pattern": {
                       "type": "string"
                     },
                     "enumValues": {
                       "type": "array",
                       "items": {
                         "type": "string"
                       }
                     }
                   },
                   "required": ["valueType"]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "array"
                       ]
                     },
                     "minItems": {
                       "type": "integer"
                     },
                     "itemsType": {
                       "type": "string",
                       "enum": [
                         "string",
                         "array",
                         "integer",
                         "number",
                         "object",
                         "boolean"
                       ]
                     },
                     "uniqueItems": {
                       "type": "boolean"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "integer"
                       ]
                     },
                     "minimum": {
                       "type": "integer"
                     },
                     "maximum": {
                       "type": "integer"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "number"
                       ]
                     },
                     "minimum": {
                       "type": "number"
                     },
                     "maximum": {
                       "type": "number"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "object"
                       ]
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "boolean"
                       ]
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 }
               ]
             }
           },
           "required": ["schema", "key", "valueType"]
         }
       }
     }
   ```
   2. how to handle parameters with the same name in the same section? as  user may have inadvertently defined two parameters with the same name.  **I prefer to covers the former with the latest one**.
   3. how to handle the order in which parameters are defined? as we have to transform the data before it posted to the API, it will  disrupt the order in which the parameters were originally defined. **I prefer to ignore the order,  because the order of parameters does not affect the result of calling the api**
   
    


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-721552396


   > Added here for tracking #2432 .
   > 
   > * [x]  request-validation
   
   After the schema draft updated in APISIX, **request-validation** also needs to transform the schema at plugin componet, so that it can work properly in dashboard, just like proxy-rewrite do. @juzhiyuan 
   
   - the schema turned by APISIX:
   ```json
   {
   	"anyOf": [{
   		"properties": {
   			"body_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["body_schema"],
   		"title": "Body schema"
   	}, {
   		"properties": {
   			"header_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["header_schema"],
   		"title": "Header schema"
   	}],
   	"type": "object"
   }
   ```
   - dashboard needs to transform the schema to:
   ```json
   {
       "type": "object",
       "properties": {
         "requestParams": {
           "title": "define request paramers",
           "type": "array",
           "items": {
             "type": "object",
             "anyOf": [{
                 "title": "define body params",
                 "properties": {
                   "body_schema": {
                     "type": "object",
                     "properties": {
                       "key": {
                         "type": "string"
                       },
                       "valueType": {
                         "type": "string",
                         "enum": [
                           "string",
                           "array",
                           "integer",
                           "number",
                           "object",
                           "boolean"
                         ]
                       },
                       "required": {
                         "type": "boolean"
                       }
                     }
                   }
                 },
                 "required": ["body_schema"],
                 "minItems": 1
               },
               {
                 "title": "define header params",
                 "properties": {
                   "header_schema": {
                     "type": "object",
                     "properties": {
                       "key": {
                         "type": "string"
                       },
                       "valueType": {
                         "type": "string",
                         "enum": [
                           "string",
                           "array",
                           "integer",
                           "number",
                           "object",
                           "boolean"
                         ]
                       },
                       "required": {
                         "type": "boolean"
                       }
                     },
                     "required": ["header_schema"],
                     "minItems": 1
                   }
                 }
               }
             ]
           },
           "minItems": 1
         }
       }
     }
   ``` 
   
   - the config page in dashboard looks like:
   
   
   
   ![2020-11-04 15-04-20屏幕截图](https://user-images.githubusercontent.com/2561857/98079645-1e379000-1eaf-11eb-8633-cd90e22c0f24.png)
   
   


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-724502301


   - [x] key-auth


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-721552396


   > Added here for tracking #2432 .
   > 
   > * [x]  request-validation
   
   After the schema draft updated in APISIX, **request-validation** also needs to transform the schema at plugin componet, so that it can work properly in dashboard, just like proxy-rewrite do. @juzhiyuan 
   
   - the schema turned by APISIX:
   ```json
   {
   	"anyOf": [{
   		"properties": {
   			"body_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["body_schema"],
   		"title": "Body schema"
   	}, {
   		"properties": {
   			"header_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["header_schema"],
   		"title": "Header schema"
   	}],
   	"type": "object"
   }
   ```
   - dashboard needs to transform the schema to:
   ```json
   {
       "type": "object",
       "properties": {
         "requestParams": {
           "title": "define request paramers",
           "type": "array",
           "items": {
             "type": "object",
             "anyOf": [
               {
                 "title": "define body params",
                 "properties": {
                   "body_schema": {
                     "$ref": "#/definitions/requestParams"
                   }
                 },
                 "required": ["body_schema"],
                 "minItems": 1
               },
               {
                 "title": "define header params",
                 "properties": {
                   "header_schema": {
                     "$ref": "#/definitions/requestParams"
                   }
                 },
                 "required": ["header_schema"],
                 "minItems": 1
               }
             ]
           },
           "minItems": 1
         }
       },
       "definitions": {
         "requestParams": {
           "type": "object",
           "properties": {
             "key": {
               "type": "string"
             },
             "valueType": {
               "type": "string",
               "enum": [
                 "string",
                 "array",
                 "integer",
                 "number",
                 "object",
                 "boolean"
               ]
             },
             "required": {
               "type": "boolean"
             }
           },
           "dependencies": {
             "valueType": {
               "oneOf": [
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "string"
                       ]
                     },
                     "minLength": {
                       "type": "integer"
                     },
                     "maxLength": {
                       "type": "integer"
                     },
                     "pattern": {
                       "type": "string"
                     },
                     "enumValues": {
                       "type": "array",
                       "items": {
                         "type": "string"
                       }
                     }
                   },
                   "required": ["valueType"]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "array"
                       ]
                     },
                     "minItems": {
                       "type": "integer"
                     },
                     "itemsType": {
                       "type": "string",
                       "enum": [
                         "string",
                         "array",
                         "integer",
                         "number",
                         "object",
                         "boolean"
                       ]
                     },
                     "uniqueItems": {
                       "type": "boolean"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "integer"
                       ]
                     },
                     "minimum": {
                       "type": "integer"
                     },
                     "maximum": {
                       "type": "integer"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "number"
                       ]
                     },
                     "minimum": {
                       "type": "number"
                     },
                     "maximum": {
                       "type": "number"
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "object"
                       ]
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 },
                 {
                   "properties": {
                     "valueType": {
                       "enum": [
                         "boolean"
                       ]
                     }
                   },
                   "required": [
                     "valueType"
                   ]
                 }
               ]
             }
           }
         }
       }
     }
   ``` 
   
   - the config page in dashboard looks like:
   
   
   
   ![2020-11-04 15-04-20屏幕截图](https://user-images.githubusercontent.com/2561857/98079645-1e379000-1eaf-11eb-8633-cd90e22c0f24.png)
   
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722881856


   > > Should I transform `request-validation` request?
   > 
   > What's the correct data format for this plugin? cc @liuxiran
   
   yep, request and response transform are also needed, we should transform the data got from schema form  to:
   
   ```json
   {
     "body_scheme"?: {
       "type": "object",
       "required": $key[], // the $key which required: true
       "properties": {
         [$key]: {
             "type": [$valueType],
             [$otherkey defined in dependencies]: [$value]
         }
       }
     },
     "header_schema"?:{
       the same with body_schema
      }
     }
   ```
   
   and transform the data got from API to 
   ```json
   {
      "requestParams": [
         {
            "body_schema": {
                "key": xxx,
                "valueType": "",
                ....
            }
         },
         {
            "header_schema":{}
         }
         ...
      ]
   }
   ``` 
   
   The reason is that fe need schema UI form to help user deine what the parameter verify schema  looks like.  pass a schema definition to api.
   
   @juzhiyuan @LiteSun 
   
   
   


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-698736589






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

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



[GitHub] [apisix] LiteSun commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-724119583


   > After communicating with @LiteSun, there are three problems with the **request validation schema** design of the first edition:
   > 
   > 1. dirty data: when change from body_schema to header_schema, useless `body_schema` will be generated, and it can not be tranform to UI.
   >    **try to update the transform schema to** the follow one
   > 
   > ```json
   > {
   >     "type": "object",
   >     "properties": {
   >       "requestParams": {
   >         "title": "define request paramers",
   >         "type": "array",
   >         "items": {
   >           "type": "object",
   >           "$ref": "#/definitions/requestParams"
   >         },
   >         "minItems": 1
   >       }
   >     },
   >     "definitions": {
   >       "requestParams": {
   >         "type": "object",
   >         "properties": {
   >           "schema": {
   >             "type": "string",
   >             "enum": [
   >               "body_schema",
   >               "header_schema"
   >             ]
   >           },
   >           "key": {
   >             "type": "string"
   >           },
   >           "valueType": {
   >             "type": "string",
   >             "enum": [
   >               "string",
   >               "array",
   >               "integer",
   >               "number",
   >               "object",
   >               "boolean"
   >             ]
   >           },
   >           "required": {
   >             "type": "boolean"
   >           }
   >         },
   >         "dependencies": {
   >           "valueType": {
   >             "oneOf": [
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "string"
   >                     ]
   >                   },
   >                   "minLength": {
   >                     "type": "integer"
   >                   },
   >                   "maxLength": {
   >                     "type": "integer"
   >                   },
   >                   "pattern": {
   >                     "type": "string"
   >                   },
   >                   "enumValues": {
   >                     "type": "array",
   >                     "items": {
   >                       "type": "string"
   >                     }
   >                   }
   >                 },
   >                 "required": ["valueType"]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "array"
   >                     ]
   >                   },
   >                   "minItems": {
   >                     "type": "integer"
   >                   },
   >                   "itemsType": {
   >                     "type": "string",
   >                     "enum": [
   >                       "string",
   >                       "array",
   >                       "integer",
   >                       "number",
   >                       "object",
   >                       "boolean"
   >                     ]
   >                   },
   >                   "uniqueItems": {
   >                     "type": "boolean"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "integer"
   >                     ]
   >                   },
   >                   "minimum": {
   >                     "type": "integer"
   >                   },
   >                   "maximum": {
   >                     "type": "integer"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "number"
   >                     ]
   >                   },
   >                   "minimum": {
   >                     "type": "number"
   >                   },
   >                   "maximum": {
   >                     "type": "number"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "object"
   >                     ]
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "boolean"
   >                     ]
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               }
   >             ]
   >           }
   >         },
   >         "required": ["schema", "key", "valueType"]
   >       }
   >     }
   >   }
   > ```
   > 
   > 1. how to handle parameters with the same name in the same section? as  user may have inadvertently defined two parameters with the same name.  **I prefer to covers the former with the latest one**.
   > 2. how to handle the order in which parameters are defined? as we have to transform the data before it posted to the API, it will  disrupt the order in which the parameters were originally defined. **I prefer to ignore the order,  because the order of parameters does not affect the result of calling the api**
   
   1. I just test the latest transform schema you provided.it works well and dirty data has been successfully removed. For more info, please refer to https://github.com/api7/dashboard-components/pull/176
   2&3.It is ok for me. What do you think? @juzhiyuan @membphis 


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-723954643


   [example plugin](https://github.com/apache/apisix/issues/2672)


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-710036230


   Added for tracking #2441
   - [x] hmac-auth


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

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



[GitHub] [apisix] imjoey edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
imjoey edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-709241670


   Added here for tracking #2432 .
   - [x] request-validation 
   


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

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



[GitHub] [apisix] LiteSun commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722809018


   Should I transform  `request-validation` request?


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716364969


   > > * [ ]   proxy-rewrite
   > 
   > I have **a proposal** for this header's schema modification: @juzhiyuan
   > 
   > * The schema provided by APISIX stays the same, because the type of parameter in header can only be defined when the user designs it
   > * dashboard(plugin component) Adapt the schema that the user needs.
   > 
   > take `proxy-rewrite` as an example:
   > 
   > * the header schema returned by APISIX is:
   > 
   > ```json
   > "headers": {
   >     "description": "new headers for request",
   >     "minProperties": 1,
   >     "type": "object"
   > }
   > ```
   > 
   > * dashboard adapt the header schema to:
   > 
   > ```json
   > {
   >     "type": "array",
   >     "items": {
   >         "type": "object",
   >         "properties": {
   >             "key": {
   >                 "type": "string"
   > 	    },
   > 	   "value": {
   > 	       "type": "object",
   >                "oneOf": [{
   >                    "title": "value type is string",
   >                    "properties": {
   >                        "value": {
   > 		           "type": "string"
   > 			}
   > 		    }
   > 		},
   > 		{
   > 		    "title": "value type is number",
   > 		    "properties": {
   > 		        "value": {
   > 			    "type": "number"
   > 			}
   > 		     }
   > 		}]
   >            }
   >        }
   >    }
   > }
   > ```
   > 
   > * the `proxy-rewrite` config page in dashboard looks like:
   >   [default looks]
   >   ![2020-10-26 14-52-28屏幕截图](https://user-images.githubusercontent.com/2561857/97142100-fd7a8680-179a-11eb-8e68-48c2ae06f10c.png)
   >   [define parameters looks]
   >   ![111111111111111](https://user-images.githubusercontent.com/2561857/97143182-26038000-179d-11eb-84ed-1d81609d7f96.jpg)
   > * the data posted to the APISIX:
   > 
   > ```json
   > "proxy-rewrite": {
   >         ...configdata,
   > 	"headers": {
   > 	    "token": {
   > 		"value": "345345-reertert"
   > 	    }
   > 	}
   > }
   > ```
   
   it's ok for me, what's your opinion? cc @membphis 


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-710036230


   Added for tracking #2441
   - [ ] hmac-auth


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-724502301


   - [ ] key-auth


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-721557025


   https://github.com/apache/apisix/issues/2082#issuecomment-721552396
   
   Please take a look and have a try when you are free :)
   
   cc @LiteSun 


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

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



[GitHub] [apisix] juzhiyuan edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-714225553


   - [x] proxy-rewrite
   
   ![image](https://user-images.githubusercontent.com/2106987/96826430-ee779980-1465-11eb-8111-f347fda71cbf.png)
   


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

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



[GitHub] [apisix] liuxiran edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-726223914


   - [ ] [echo](https://github.com/apache/apisix-dashboard/issues/792#issuecomment-726223360)


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-721552396


   > Added here for tracking #2432 .
   > 
   > * [x]  request-validation
   
   After the schema draft updated in APISIX, **request-validation** also needs to transform the schema at plugin componet, so that it can work properly in dashboard, just like proxy-rewrite do. @juzhiyuan 
   
   - the schema turned by APISIX:
   ```json
   {
   	"anyOf": [{
   		"properties": {
   			"body_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["body_schema"],
   		"title": "Body schema"
   	}, {
   		"properties": {
   			"header_schema": {
   				"type": "object"
   			}
   		},
   		"required": ["header_schema"],
   		"title": "Header schema"
   	}],
   	"type": "object"
   }
   ```
   - dashboard needs to transform the schema to:
   ```json
   {
       "type": "object",
       "properties": {
         "requestParams": {
           "title": "define request paramers",
           "type": "array",
           "items": {
             "type": "object",
             "anyOf": [{
                 "title": "define body params",
                 "properties": {
                   "body_schema": {
                     "type": "object",
                     "properties": {
                       "key": {
                         "type": "string"
                       },
                       "valueType": {
                         "type": "string",
                         "enum": [
                           "string",
                           "array",
                           "integer",
                           "number",
                           "object",
                           "boolean"
                         ]
                       },
                       "required": {
                         "type": "boolean"
                       }
                     }
                   }
                 },
                 "required": ["body_schema"],
                 "miniItems": 1
               },
               {
                 "title": "define header params",
                 "properties": {
                   "header_schema": {
                     "type": "object",
                     "properties": {
                       "key": {
                         "type": "string"
                       },
                       "valueType": {
                         "type": "string",
                         "enum": [
                           "string",
                           "array",
                           "integer",
                           "number",
                           "object",
                           "boolean"
                         ]
                       },
                       "required": {
                         "type": "boolean"
                       }
                     }
                   }
                 }
               }
             ]
           }
         }
       }
     }
   ``` 
   
   - the config page in dashboard looks like:
   
   
   
   ![2020-11-04 15-04-20屏幕截图](https://user-images.githubusercontent.com/2561857/98079645-1e379000-1eaf-11eb-8633-cd90e22c0f24.png)
   
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-723957317


   > * [ ]  [example plugin](https://github.com/apache/apisix/issues/2672)
   
   example plugin will be disabled with #2673 


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722810090


   > Should I transform `request-validation` request?
   
   What's the correct data format for this plugin? cc @liuxiran 


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

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



[GitHub] [apisix] LiteSun edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-724119583


   > After communicating with @LiteSun, there are three problems with the **request validation schema** design of the first edition:
   > 
   > 1. dirty data: when change from body_schema to header_schema, useless `body_schema` will be generated, and it can not be tranform to UI.
   >    **try to update the transform schema to** the follow one
   > 
   > ```json
   > {
   >     "type": "object",
   >     "properties": {
   >       "requestParams": {
   >         "title": "define request paramers",
   >         "type": "array",
   >         "items": {
   >           "type": "object",
   >           "$ref": "#/definitions/requestParams"
   >         },
   >         "minItems": 1
   >       }
   >     },
   >     "definitions": {
   >       "requestParams": {
   >         "type": "object",
   >         "properties": {
   >           "schema": {
   >             "type": "string",
   >             "enum": [
   >               "body_schema",
   >               "header_schema"
   >             ]
   >           },
   >           "key": {
   >             "type": "string"
   >           },
   >           "valueType": {
   >             "type": "string",
   >             "enum": [
   >               "string",
   >               "array",
   >               "integer",
   >               "number",
   >               "object",
   >               "boolean"
   >             ]
   >           },
   >           "required": {
   >             "type": "boolean"
   >           }
   >         },
   >         "dependencies": {
   >           "valueType": {
   >             "oneOf": [
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "string"
   >                     ]
   >                   },
   >                   "minLength": {
   >                     "type": "integer"
   >                   },
   >                   "maxLength": {
   >                     "type": "integer"
   >                   },
   >                   "pattern": {
   >                     "type": "string"
   >                   },
   >                   "enumValues": {
   >                     "type": "array",
   >                     "items": {
   >                       "type": "string"
   >                     }
   >                   }
   >                 },
   >                 "required": ["valueType"]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "array"
   >                     ]
   >                   },
   >                   "minItems": {
   >                     "type": "integer"
   >                   },
   >                   "itemsType": {
   >                     "type": "string",
   >                     "enum": [
   >                       "string",
   >                       "array",
   >                       "integer",
   >                       "number",
   >                       "object",
   >                       "boolean"
   >                     ]
   >                   },
   >                   "uniqueItems": {
   >                     "type": "boolean"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "integer"
   >                     ]
   >                   },
   >                   "minimum": {
   >                     "type": "integer"
   >                   },
   >                   "maximum": {
   >                     "type": "integer"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "number"
   >                     ]
   >                   },
   >                   "minimum": {
   >                     "type": "number"
   >                   },
   >                   "maximum": {
   >                     "type": "number"
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "object"
   >                     ]
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               },
   >               {
   >                 "properties": {
   >                   "valueType": {
   >                     "enum": [
   >                       "boolean"
   >                     ]
   >                   }
   >                 },
   >                 "required": [
   >                   "valueType"
   >                 ]
   >               }
   >             ]
   >           }
   >         },
   >         "required": ["schema", "key", "valueType"]
   >       }
   >     }
   >   }
   > ```
   > 
   > 1. how to handle parameters with the same name in the same section? as  user may have inadvertently defined two parameters with the same name.  **I prefer to covers the former with the latest one**.
   > 2. how to handle the order in which parameters are defined? as we have to transform the data before it posted to the API, it will  disrupt the order in which the parameters were originally defined. **I prefer to ignore the order,  because the order of parameters does not affect the result of calling the api**
   
   1. I just test the latest transform schema you provided.it works well and dirty data has been successfully removed. For more info, please refer to https://github.com/api7/dashboard-components/pull/176
   
   2. & 3. It is ok for me. What do you think? @juzhiyuan @membphis 


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

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



[GitHub] [apisix] imjoey commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
imjoey commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-709241670


   Added here for tracking #2432 .
   - [ ] request-validation 
   


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

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



[GitHub] [apisix] juzhiyuan edited a comment on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-721557025


   - [ ] Update transformer in Dashboard
   
   https://github.com/apache/apisix/issues/2082#issuecomment-721552396
   
   Please take a look and have a try when you are free :)
   
   cc @LiteSun 


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-722975099


   > @liuxiran Tks! I still have a question that How to handle multiple body_schema header_schema cases? As showing below:
   
   each body_schema in form data will be a sub attr of requestdata. body_schema. properties, the same to header_schema😊
   
   
   


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716931462


   Sorry to related fix this issue by https://github.com/api7/dashboard-components/pull/143, which only fix: https://github.com/apache/apisix/issues/2082#issuecomment-714225553,  part of this issue,
   reopen now


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-698736589


   - [ ] consumer-restriction


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-724345014


   Not sure, just waiting for others opinions. 


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

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



[GitHub] [apisix] juzhiyuan commented on issue #2082: request help: Update plugin's schema: basic-auth

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-676214068


   I will create issues to describe the changes for each plugin.


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-698736589


   - [ ] consumer-restriction


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

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



[GitHub] [apisix] LiteSun commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
LiteSun commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-723385857


   Got it! Tks👍


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

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



[GitHub] [apisix] liuxiran commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716356064


   > * [ ]  proxy-rewrite
   > 
   
   
   I have **a proposal** for this header's schema modification: @juzhiyuan 
   
   - The schema provided by APISIX stays the same, because the type of parameter in header can only be defined when the user designs it
   
   - dashboard(plugin component) Adapt the schema that the user needs. 
   ---
   
   take `proxy-rewrite` as an example:
   
   - the header schema returned by APISIX is:
   ```json
   "headers": {
       "description": "new headers for request",
       "minProperties": 1,
       "type": "object"
   }
   ```
   
   - dashboard adapt the header schema to:
   ```json
   {
       "type": "array",
       "items": {
           "type": "object",
           "properties": {
               "key": {
                   "type": "string"
   	    },
   	   "value": {
   	       "type": "object",
                  "oneOf": [{
                      "title": "value type is string",
                      "properties": {
                          "value": {
   		           "type": "string"
   			}
   		    }
   		},
   		{
   		    "title": "value type is number",
   		    "properties": {
   		        "value": {
   			    "type": "number"
   			}
   		     }
   		}]
              }
          }
      }
   }
   ```
   
   - the `proxy-rewrite` config page in dashboard looks like:
   [default looks]
   ![2020-10-26 14-52-28屏幕截图](https://user-images.githubusercontent.com/2561857/97142100-fd7a8680-179a-11eb-8e68-48c2ae06f10c.png)
   [define parameters looks]
   ![111111111111111](https://user-images.githubusercontent.com/2561857/97143182-26038000-179d-11eb-84ed-1d81609d7f96.jpg)
   
   - the data posted to the APISIX:
   ```json
   "proxy-rewrite": {
           ...configdata,
   	"headers": {
   	    "token": {
   		"value": "345345-reertert"
   	    }
   	}
   }
   ```
   
   
   
   


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

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



[GitHub] [apisix] spacewander commented on issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-755319725


   @juzhiyuan 
   Have we finished this job?


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

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



[GitHub] [apisix] juzhiyuan closed issue #2082: request help: Update plugin's schema

Posted by GitBox <gi...@apache.org>.
juzhiyuan closed issue #2082:
URL: https://github.com/apache/apisix/issues/2082


   


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