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 2019/11/02 01:33:50 UTC

[GitHub] [incubator-apisix] membphis opened a new issue #790: new plugin: data-validator

membphis opened a new issue #790: new plugin: data-validator
URL: https://github.com/apache/incubator-apisix/issues/790
 
 
   Apache APISIX currently has a very high-performance jsonschema implementation that can be used to validate request parameters or request bodies.
   
   When the verification succeeds or fails, the response specifies the response code to the requesting client.
   
   Here is a mini case:
   
   ```lua
   data_valitator = {
       var = "args_name",
       schema = {
           type = "string",
           minLength = 1,
           maxLength = 32,
           pattern = [[^[\w]+$]]
       },
       fail_code = 400,
   }
   
   data_valitator = {
       var = "args_name",
       schema = {
           type = "string",
           minLength = 1,
           maxLength = 32,
           pattern = [[^[\w]+$]]
       },
       succ_code = 200
   }
   ```

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


With regards,
Apache Git Services