简体   繁体   中英

validate incoming JSON requests in wso2 api manager 2.6.0

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM