2
votes

I need to validate incoming json requests structure in wso2. I will be able to validate incoming json using default json validator in mediation sequence, but I want to apply json validation only for POST request and not for GET request in an API. It can be achieved by adding custom in flow sequence.

I'm having json validator file for schema validation(like jsonvaldiator.json).

Where should I keep this file in wso2 api manager 2.6.0 and how to mention the validator file path in filter added in the custom in flow sequence?

Any comments would be appreciated.

1

1 Answers

0
votes

Yes, you need to add a custom In sequence to the default message mediation flow in order to achieve this. Please have a look at this blog post about validating JSON request payload. This might help to do this for APIM-2.6. Because the blog has been written for an older version but you can get the idea. :)

More about WSO2 Gateway Extensions. https://dinushasblog.blogspot.com/2018/04/wso2-api-manager-gateway-extension.html