API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Validate request json payload using validate policy against a predefined schema definition.

    Posted Thu September 12, 2024 09:00 AM

    Dear Experts,

      I have a simple requirement where I have to validate a incoming json payload against the predefined json schema defintion i have created in the api definition yaml.

     I am not sure if i am missing anything, but somehow validate policy is not working as in its not validating. I am on APIC 10.0.5.2-ifix 1

     I tried with both the below 2 options of validate policy and nothing is working. Its just accepting any json payload regardless of what i defined in the schema

        Option1 >> Validate Against: Definition

        Option2>> Validate Against: body-param 

    I am not sure if i am missing anything here. But appreciate your help and inputs in this matter. 

    Let me know incase if any additional details have to be provided. thanks in advance



    ------------------------------
    Srinivas Poram
    ------------------------------


  • 2.  RE: Validate request json payload using validate policy against a predefined schema definition.

    Posted Thu September 12, 2024 11:03 AM

    Hi Srinivas,
    Most likely the same answer as my response in comment 4 of https://community.ibm.com/community/user/integration/discussion/validation-policy-how-to-validate-the-response-after-invoke-policy?ReturnUrl=%2fcommunity%2fuser%2fintegration%2fcommunities%2fcommunity-home%2fdigestviewer%3fcommunitykey%3d2106cca0-a9f9-45c6-9b28-01a28f4ce947.  Also, you must ensure that the JSON request payload has been parsed prior to using the validate policy using the parse policy.

    Best Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------