This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Request Payload Validation for Berlin

Request Payload Validation adds flexibility to validate an incoming request against any customisations done to the swagger definition. For example, modify the currency property in the API swagger and then the solution will validate the incoming request against the updated currency value. Simply modify the published swagger file and republish the API for the modifications to take effect.

When an API is published, the swagger file is added as a local entry and saved under the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/local-entries directory.

To add the swagger as a local entry, the created and published API lifecycles are extended using customised API executor named com.wso2.finance.open.banking.api.executor.OBAPIPublisherExecutor. For more information on executors, see Extension Points of API Life cycle.  

You need to republish the API to apply the swagger based validations. Therefore, follow the steps below:

  1. Sign in to the API Publisher at https://<WSO2_OB_APIM_HOST>:9443/publisher using the credentials of a user, whose role is an API Publisher. For more information on users and roles, see here.
  2. Select the respective API and click Edit API.
  3. You are redirected to the  Design  phase. Click the  Edit Source button  under  API Definition  section.
  4. Click  Apply Changes to save the changes and go back to the  Design  page.
  5. Scroll down and click Save.
  6. Click Next: Implement > Next: Manage and Save and Publish.