ERROR - An appropriate check for a message body was not found on the enclosing Step or Flow. (PO001)

I am getting Po001 error in CodeLint when I am trying to apply a JSON-threat-protection policy.

in proxy.xml

<Step>  <Name>basic-json-threat-protection</Name>  <Condition>(request.header.Content-Length != 0)</Condition></Step>


among policies


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection continueOnError="true"  enabled="true" name="basic-json-threat-protection">
   <DisplayName>Basic JSON Threat Protection</DisplayName>
   <ArrayElementCount>1200</ArrayElementCount>
   <ContainerDepth>10</ContainerDepth>
   <ObjectEntryCount>100</ObjectEntryCount>
   <ObjectEntryNameLength>40</ObjectEntryNameLength>
   <StringValueLength>1200</StringValueLength>
</JSONThreatProtection>
0 6 651
6 REPLIES 6

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JTP-contentValidation">
<DisplayName>JTP-contentValidation</DisplayName>
<Properties/>
<ArrayElementCount>0</ArrayElementCount>
<ContainerDepth>1</ContainerDepth>
<ObjectEntryCount>13</ObjectEntryCount>
<Source>request</Source>
<StringValueLength>50</StringValueLength>
</JSONThreatProtection>

screen-shot-2019-04-18-at-13639-pm.png I am also facing the same error. see as above xml and attached for error log

Do you have a sample proxy? What is the payload you are sending?

Above information doesn't have better exception details..

Hello Vinay, Since this is error occurs during the code analysis done via CodeLint, I don't think this has anything to do with how the payload looks like at least that's what I think.

Hi. You need  condition added to your JSON Threat protection related step which will check if your policy source (in your case "request") is  valid (not empty, ...).   

Ok, so how do you do that?

Update: I Figured it out:

```

<Step>
<Name>JSON-Threat-Protection</Name>
<Condition>(request.content != null)</Condition>
</Step>
```