tinpad opened a new issue #5108:
URL: https://github.com/apache/apisix/issues/5108


   ### Issue description
   
   I am enabling the request-validation plugin on a route
   
   curl http://127.0.0.1:9080/apisix/admin/routes/35 -H 'X-API-KEY: 
xxxxxxxxxxxxxxxxxxx' -X PUT -d '
   {
       "uri": "/products/create",
       "plugins": {
           "request-validation": {
               "body_schema": {
                   "type": "object",
                   "required": ["productName", "price"],
                   "properties": {
                       "productName": {"type": "string"},
                       "price": {"type": "number"}
                   }
               }
           }
       },
       "upstream": {
           "service_name": "PRODUCTSSERVICE",
           "type": "roundrobin",
           "discovery_type": "eureka"
       }
   }'
   
   When I test it using following command - 
   curl http://127.0.0.1:9080/products/create  -X POST -d 
'{"product-Name":"Laptop","pri-ce":12345.00}'
   
   I receive the below message - 
   property "price" is required
   
   Can we change this default message with a customized json response
   
   ### Environment
   
    apisix version (cmd: apisix version): 2.8
    OS (cmd: uname -a): 20.04.1-Ubuntu
    OpenResty / Nginx version (cmd: nginx -V or openresty -V): 
openresty/1.19.3.2
    etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info 
to get the info from server-info API): 3.4.0
    apisix-dashboard version, if have: NA
    the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
    uarocks version, if the issue is about installation (cmd: luarocks 
--version): 3.4.0


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

To unsubscribe, e-mail: [email protected]

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


Reply via email to