Your input will be read from request.body and your output will be written to parsedPayload.body
Original Message:
Sent: Wed August 14, 2024 11:15 AM
From: Basma Hesham
Subject: Validate policy not working APIConnect v10
Hi steve,
could you advise ,I used parse assembly with these configurations :
while it returns this error in the logs : For Assembly Action 'switch-sit-env_sit-catalog_mw_chld_get_virt_card_denom_1.0.0_parse_0', cannot find the specified variable 'request.body' in the API context.
version: 2.0.0 title: Parse JSON Payload description: Parses the incoming JSON payload use-content-type: true document_type: JSON input: request.body output: parsedPayload
------------------------------
Basma Hesham
Original Message:
Sent: Mon August 28, 2023 05:27 PM
From: Steve Linn
Subject: Validate policy not working APIConnect v10
Hi Sandeepkumar,
Do you have a parse policy as your first assembly policy? request.body is unparsed which would be causing this type of error. message.body will be created by the parse policy and will be consumed by the validate policy.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Fri August 25, 2023 03:23 PM
From: Sandeepkumar Rane
Subject: Validate policy not working APIConnect v10
Here is our scenario.
We have added an API by importing OpenAPI 3.0 specification yaml file. We would like to validate the incoming message against the message definition. We are trying to use the validate policy. We configured the policy to validate the incoming JSON message against Definition and then selected the required definition from the dropdown menu.
We get below error -
{"httpCode":"400","httpMessage":"Bad Request","moreInformation":"Validate: Instance is neither parsed XML, parsed JSON nor parsed GraphQL"}
Is there anything wrong that we are doing ? Did we miss anything?
------------------------------
Sandeepkumar Rane
------------------------------