Skip to content

Commit

Permalink
Update docs for negation matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
tommysitu committed Apr 20, 2024
1 parent 1af8d3b commit eed4638
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions docs/pages/reference/hoverfly/request_matchers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,55 @@ Example
|
|
Negation matcher
-------------
The opposite of the Exact matcher. This matcher will evaluate to true if the values being compared are not the same.

Example
"""""""

.. code:: json
"matcher": "negate"
"value": "?"
.. raw:: html

<table border="1" class="docutils matcher-examples">
<thead>
<tr class="row-odd">
<th class="head">String to match</th>
<th class="head">Matcher value</th>
<th class="head">Match</th>
</tr>
</thead>
<tbody>
<tr class="row-even">
<td>cloud.hoverfly.io</td>
<td>docs.hoverfly.io</td>
<td class="example-icon"><span class="fa fa-check fa-success"></span></td>
<tr/>
<tr class="row-odd">
<td></td>
<td>cloud.hoverfly.io</td>
<td class="example-icon"><span class="fa fa-check fa-success"></span></td>
<tr/>
<tr class="row-even">
<td>cloud.hoverfly.io</td>
<td></td>
<td class="example-icon"><span class="fa fa-check fa-success"></span></td>
<tr/>
<tr class="row-odd">
<td>cloud.hoverfly.io</td>
<td>cloud.hoverfly.io</td>
<td class="example-icon"><span class="fa fa-times fa-failure"></span></td>
<tr/>
</tbody>
</table>

|
|
Glob matcher
------------

Expand Down Expand Up @@ -573,7 +622,7 @@ JWT matcher
-----------

This matcher is primarily used for matching JWT tokens. This matcher converts base64 encoded JWT to
JSON document ({"header": {}, "payload": ""}) and does JSON partial match with the matcher value.
JSON document ``{"header": {}, "payload": ""}`` and does JSON partial match with the matcher value.

Matcher value contains only keys that they want to match in JWT.

Expand All @@ -592,7 +641,7 @@ Matcher chaining allows you to pass a matched value into another matcher to do f

It typically removes the stress of composing and testing complex expressions and make matchers more readable.

For an example, one can use JSONPath to get a JSON node, then use another matcher to match the JSON node value as follows.
For example, one can use JSONPath to get a JSON node, then use another matcher to match the JSON node value as follows.

Example
"""""""
Expand Down

0 comments on commit eed4638

Please sign in to comment.