Closed thiloshon closed 3 years ago
Documentation for this is on-hold for now...
Please find the WIP doc for this task: https://docs.google.com/document/d/1RgZXu_LV-fXuYMB6snJuqmHHJcWC6bVuJupZ7mbOubk/edit?ts=601928ce#
This doc live now - https://ob.docs.wso2.com/en/latest/develop/validation-layer/
Description: Document the new Validation Layer for developers.
Validation Layer of WSO2
WSO2 OpenBanking uses annotation-based constraints to perform validations. This application layer agnostic validation makes it easier to extend and reuse. Hibernate Validator which is the reference implementation of the JSR 380 specification of Java API for bean validation, is used in OB.
To make it easier to perform validations, WSO2 OB Accelerator offers a pre configured validator and a set of common validation annotations.
First add the open-banking common dependency.
Create your models:
Add standard validation-api annotations;
WSO2 OB offers some common annotations used in OB use cases as well. Eg: @RequiredParameter, @ValidScope, @ValidAudience
Usage example:
Note:
Finally to get the OB Validator instance and execute validations:
Affected Product Version: OB 3.0