apigee / apigeelint

Static code analysis for Apigee proxy bundles to encourage API developers to use best practices and avoid anti-patterns.
Apache License 2.0
93 stars 71 forks source link

PO003 - Issue even if the condition check for source variable is present in the conditon. #299

Closed lflzrk closed 2 years ago

lflzrk commented 2 years ago

Hello Team,

Looks like a bug for PO003, even if the condition exist for the source variable check it says condition is missing.

For example,

The below two are not supported,

<Step>
      <Name>EV-FetchDetailsForErrorResp</Name>
      <Condition>(message.content !=null) and (response.status.code !="401" and response.status.code !="403")</Condition>
  </Step>

OR

<Step>
      <Name>EV-FetchDetailsForErrorResp</Name>
      <Condition>(message.content !=null)</Condition>
  </Step>

As there are other cond along with it and it seems the check is only done for "string equal" condition. The flow should be supported if there are mutliple conditons or "()" are present.

It only works if it is as below,

<Step>
      <Name>EV-FetchDetailsForErrorResp</Name>
      <Condition>message.content !=null</Condition>
  </Step>
ssvaidyanathan commented 2 years ago

Fixed in v2.17.0

lflzrk commented 2 years ago

Thank you for excellent turnaround time. It works as expected now.

Cheers! Ziaur