Hi Basma,
The parse policy only needs the API Gateway context message name. It will use on input or create on output the .body, so simply remove the .body:
version: 2.0.0
title: Parse JSON Payload
description: Parses the incoming JSON payload
use-content-type: true
document_type: JSON
input: request
output: parsedPayload
Your input will be read from request.body and your output will be written to parsedPayload.body
Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
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