Go to All Forums

Jsonpath assertion

I have an api simply responses a json

{"is_reset": true/false}

For the synthetic monitor step's content check section JSONPath expression field can I just use $.is_reset for the assertion? Will it mark the monitor down when the response is false?

Like (4) Reply
Replies (3)

Re: Jsonpath assertion

Hi,

In JSON Validation, we will verify only the JSON Path, we will not do assert check. 

However, to validate this case you can configure the response format as Text and configure "{\"is_reset\": false}" in Should not contain string option and toggle the option to Down for Down Alert. 

Should Not Contain Check

This will send you a DOWN Alert if the string {"is_reset":false} is present in the response.


Else you can configure "{\"is_reset\": true}" in Should contain string section. 

This configuration will send if the pattern {"is_reset": true} is not present in the response.

 Let us know if this works for you.


Regards,
Franklin
Site24x7 Team.

Like (0) Reply

Re: Re: Jsonpath assertion

Is this still the case (having to do a string search)?  I am looking at: www.site24x7.com/help/admin/adding-a-monitor/rest-api-monitor.html#json

Which looks like it parses the JSON and allows comparisons of elements.. I am trying to set that up now but am getting this exact same error ( JSON Path expression assertion failed.)

 

Like (0) Reply

Re: Re: Re: Jsonpath assertion

Dear Daniel,

   May I know what you would like to check? Some samples would give us some more insights.

-Jasper

PM, Site24x7

Like (0) Reply

Was this post helpful?