fukiki opened a new issue #1236:
URL: https://github.com/apache/apisix-dashboard/issues/1236


   # Bug report
   
   ## Describe the bug
   
   When Online Debug, using key-value to enter `Header Params`, the params 
validation failed.
   
![apisix-bug1](https://user-images.githubusercontent.com/59835099/103863127-391ac080-50fb-11eb-97ba-ba15e96c91f3.png)
   
   I enable plugin `request-validation`, the headers and body data will be 
validated. The schema for request-validation plugin is as follows:
   ```json
   {
     "disable": false,
     "header_schema": {
       "properties": {
         "timeouts": {
           "default": 3,
           "maximum": 254,
           "minimum": 1,
           "type": "integer"
         }
       },
       "required": [
         "required_payload"
       ],
       "required_payload": {
         "type": "string"
       },
       "type": "object"
     }
   }
   ```
   
   ## How to Reproduce
   
   1. Go to 'Route'
   2. Click on 'Online Debug'
   3. Input Params: 
   - URL:`GET http://127.0.0.1:9080/headers`
   - Header Params: `{"required_payload":"test payload", "timeouts":10}`
   - Body Params: `{"boolean-payload":true,"required_payload":"hello"}`
   4. See error: `property "timeouts" validation failed: wrong type: expected 
integer, got string`
   
   ## Expected behavior
   
   In step 4: Request successful, response body is as follow:
   ```json
   {
       "headers": {
           "Accept-Encoding": "gzip",
           "Host": "127.0.0.1",
           "Required-Payload": "test payload",
           "User-Agent": "Go-http-client/1.1",
           "X-Amzn-Trace-Id": "Root=1-5ff6ae93-0a2dd616262bf298084de7dd",
           "X-Forwarded-Host": "127.0.0.1"
       }
   }
   ```
   
   ## System information
   
   - OS: macOS, centos
   - Browser:Chrome
   - Version: master branch
   
   ## Additional context
   
   It has the same problem using `json` to enter Body Params, but  using`raw 
input - json` is ok.
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to