Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Input validation allows data services to validate the input parameters in a request and stop the execution of the request if the input doesn’t meet the required criteria. The WSO2 Data Services Server provides a set of built-in validators for some of the most common use cases. It also provides an extension mechanism where custom validators can be written. For details on custom validators, refer to the Custom section.

Built-In Input Validators

Validators have to be added to individual input mappings in a query. Follow the instructions below to add built-in/custom input validators.

1) Click Add New Query link in the Queries page.

...

4) The Add Input Mapping page opens. The Validator drop-down menu contains four built-in validators and the custom validator option.

Built-In Input Validators

Explained below are the pre-defined, standard validators available in the WSO2 Data Services Server.

...

Used to validate an integer value and check if it is in the specified range. The validator requires minimum and the maximum values of the range to be validated. For example,

Custom Validators

vxcv