Azure APIM policy-conditional operator not working in liquid template

prajakta nawale 1 Reputation point
2023-11-14T13:56:03.4966667+00:00

How can I resolve the issue where the conditional operators, such as '< or >', are not working in Azure APIM liquid templates? The '>' sign is being converted to '&gt'. In the following example, it is returning 'true' when it should be returning 'false'.

<set-body template="liquid">
    {% assign a = 5 %}
    {% assign b = 15 %}
    {% if a &gt; b %}
        true
    {% else %}
        false
    {% endif %}
</set-body>
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,261 Reputation points
    2023-11-15T03:25:52.06+00:00

    @prajakta nawale Thanks for reaching out. It should work even if gets encoded with &gtI but it was returning true instead of false. Had a discussion internally and confirmed that it is bug and Product Team is currently investigating it. I would revert to you with another update as soon as I hear back from them.

    Let me know if you have any queries or concerns.

    Please "Accept Answer" and "upvote" if the answer is helpful so that it can help others in the community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.