i am exploring Azure APIM policies.could you please help to find out the solutions for inbound & outbound policy. Basically read the path parameter from url and filter the response based on path parameter value.
0
votes
1 Answers
0
votes
You can achieve this with follow steps: 1.declare a variable and get the parameter with - context.Variables["maxAge"].
https://docs.microsoft.com/en-us/azure/api-management/api-management-policy-expressions
2.Using for loop you can filter the response object received from backend. https://www.codit.eu/blog/using-liquid-templates-in-azure-api-management/
Example below-
{% JSONArrayFor orderline in body.GetOrderDetailsResponse.OrderLines %}
{
"product" : "{{orderline.Product}}",
"amount" : "{{orderline.Amount}}"
}
{% endJSONArrayFor %}