Author: Abhishek Bathwal
The Blog will help in understanding the functionality of Query Parameters and Headers Strict Validations in MuleSoft APIkit Router.
What is Strict Validations?
Strict Validations is an APIkit router configuration which restricts or limits API calls with unwanted Headers and/or Query Parameters which are not defined in the API Specification (RAML).
RAML:
Designed a simple RAML, having no Headers or Query Parameters defined.
Configuration:
Generated the flow out of the RAML. Configure APIkit router for Query Parameters and Headers Strict Validations
- Select APIKit router and edit the Router Configuration.
(By default Validations are Disabled)
- Enable the validation by selecting the required option.
(For Parser we can keep it as Auto or we can select RAML, Both works)
- Disable the Validation by Selecting the Disable option or Uncheck one or Both options
Disable all | Uncheck one or Both |
Testing:
- No Strict Validations
The RAML does not contain Header or Query Parameters, even if both the attributes are passed during API call, it returns a success response.
- Both Headers and Query Parameters Validations
With Attributes:
Without Attributes:
- Only Headers Validation
With Query Parameter but no Headers:
- Only Query Parameters Validation
With Headers but no Query Parameters:
Note: Postman contains hidden headers, manage the headers before testing otherwise it may return error.
Checkout the Video Tutorial: https://youtu.be/7a3TZJ9ZZ-g