This document guides you with the assumption that you have set up WSO2 Open Banking Key Manager, and WSO2 Open Banking API Manager in separate servers.
...
WSO2 Open Banking allows users to validate incoming requests to APIs against any customizations done to a swagger file. Update the RequestSchemaValidationHandler in the velocity_template.xml
file as follows:
...
Code Block | ||||
---|---|---|---|---|
| ||||
<sequence xmlns="http://ws.apache.org/ns/synapse" name="payments-dynamic-endpoint-insequence-2.0.0"> <property name="endpointURI" expression="get-property('To')"/> <filter source="$ctx:endpointURI" regex=".*payments.*"> <then> <header name="TPP-Unique-ID" scope="transport" expression="get-property('api.ut.consumerKey')"/> <filter source="get-property('api.ut.HTTP_METHOD')" regex="POST"> <then> <header name="To" value="https://<OBKM_HOST>:9446/consent/berlin110/payments"/> <filter source="$ctx:endpointURI" regex="^((?!\/bulk-payments).)*$"> <then> <payloadFactory media-type="json"> <format>[$1]</format> <args> <arg evaluator="json" expression="$"/> </args> </payloadFactory> </then> </filter> </then> <else> <filter source="get-property('api.ut.HTTP_METHOD')" regex="GET"> <then> <property name="resourcePath" scope="default" type="STRING" value=""/> <property expression="get-property('resourcePath')" name="REST_URL_POSTFIX" scope="axis2" type="STRING"/> <header name="To" expression="fn:concat('https://<OBKM_HOST>:9446/consent/berlin110', get-property('api.ut.resource'))"/> <rewrite> <rewriterule> <action type="replace" regex="\/payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> </rewriterule> </rewrite> </then> </filter> </else> </filter> </then> <else> <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<OBAM_HOST>:9443/open-banking/services/payments/paymentservice"/> </then> <else> <header name="To" value="https://<OBAM_HOST>:9443/open-banking/services/payments/paymentservice"/> </else> </filter> </else> </filter> <property name="ENDPOINT_ADDRESS" expression="get-property('To')"/> </sequence> |
Multiexcerpt include |
---|
...
|
...
Create a new version for an existing API
...
Click CREATE NEW VERSION.
Tip |
---|
Versioning allows several APIs to share the same scope. |
Define the new version and click Done.
Note |
---|
The API version will be used in the |
...
|