Versions Compared

Key

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

Input validation feature allows data services to validate the input parameter values parameters in a request and to 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 sufficient for some of the most common use cases along with . It also provides an extension mechanism where custom validators can be written. For details on custom validators, refer toData Validation - Custom section.

Built-In Input Validators

Given below are the pre-defined, standard validators that are available in the WSO2 Data Services Server. These validators have to be added to individual input mappings in a query.

Follow the instructions below to begin.

1) Click Add New Query in the Queries page.

The Queries page appears when creating a Data Service. For information on opening the Queries page, refer to section: Create a Data Service Using Various Data Sources. Image Added
In the Add New Query page that appears, provide the QueryID and DataSource. The Input Mappings section opens. Image Added

Click the Add New Input Mapping link.

Long Range Validator

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 as shown below: