How to extract variable from query param if the name contains a dot

Not applicable

Hi,

I'm doing a pass-through API proxy integrating Apigee and AEM Query Builder.

In order to decide how many results we want to obtain AEM has the query param p.limit
My goal is to limit this value to max 100 results (-1 mean all of them), so I have this Condition:

<Step>    <Condition>(request.queryparam.p.limit LesserThan 0) Or (request.queryparam.p.limit GreaterThan 100)</Condition>    <Name>RemoveLimitQueryParam</Name></Step>

This is not working I suppose because the query param I'm referring to contains a dot.

So I'm trying to extract the variable first but apparently, the ExtractVariable policy using QueryParam only extract part of the name but not the value. Instead what I want to achive is renaming p.limit in a variable query.limit do you know if I can do that? Or otherwise how I can refer to a queryparam which contains a dot directly in the condition statement?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ExtractVariables async="false" continueOnError="false" enabled="true" name="ExtractLimiQueryParam">    <DisplayName>ExtractLimiQueryParam</DisplayName>    <Source>request</Source>    <QueryParam name="p.limit">        <Pattern ignoreCase="true">p.{limit}</Pattern>    </QueryParam>    <VariablePrefix>query</VariablePrefix>    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables></ExtractVariables>

Thanks,
Danilo

0 2 1,211
2 REPLIES 2

Not applicable

Hi,

You can retrieve the p.limit param with this syntax:

request.queryparam['p.limit']

Thanks Jon, it is actually working using request.queryparam.p.limit! The problem wasn't a problem actually. Thanks for your help!