Request naming rule Via API

Hello Community,

Im using the request naming rule API to creat a rule: /service/requestNaming

The body is like this:

{
“enabled”: true,
“namingPattern”: “/consumer/app/challenge/brw/[ID_GET]”,
“conditions”: [
{
“attribute”: “WEBREQUEST_URL_PATH”,
“comparisonInfo”: {
“type”: “STRING”,
“comparison”: “BEGINS_WITH”,
“value”: “/consumer/app/challenge/brw/”,
“negate”: false,
“caseSensitive”: false
}
},
{
“attribute”: “HTTP_REQUEST_METHOD”,
“comparisonInfo”: {
“type”: “STRING”,
“comparison”: “EQUALS”,
“value”: “GET”,
“negate”: false,
“caseSensitive”: false
}
}

]
}

Im getting the bellow error:

<span>{</span>
  <span>"error"</span><span>:</span> <span>{</span>
    <span>"code"</span><span>:</span> <span>400</span><span>,</span>
    <span>"message"</span><span>:</span> <span>"Constraints violated."</span><span>,</span>
    <span>"constraintViolations"</span><span>:</span> <span>[</span>
      <span>{</span>
        <span>"path"</span><span>:</span> <span>"conditions[1].attribute"</span><span>,</span>
        <span>"message"</span><span>:</span> <span>"Condition invalid combination of type, attribute and matcher"</span><span>,</span>
        <span>"parameterLocation"</span><span>:</span> <span>"PAYLOAD_BODY"</span><span>,</span>
        <span>"location"</span><span>:</span> <span>null</span>
      <span>}</span>
    <span>]</span>
  <span>}</span>
<span>}</span>

If someone can help to fixe, I think is going wrong with HTTP_REQUEST_METHOD.

Thanks guys.

@Malaik

The type in the http method clause need to be like so

{            “attribute”: “HTTP_REQUEST_METHOD”,            “comparisonInfo”: {                “type”: “HTTP_METHOD”,                “comparison”: “EQUALS”,                “value”: “GET”,                “negate”: false,                “caseSensitive”: false            }        }

Thanks,

Working fine.