Skip to content

Commit

Permalink
Fix warnings in the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tommysitu committed Sep 26, 2023
1 parent 31d2696 commit 60ee224
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 30 deletions.
6 changes: 3 additions & 3 deletions docs/pages/keyconcepts/modes/diff.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _diff_mode:

Diff mode
========
=========

In this mode, Hoverfly forwards a request to an external service and compares a response with currently stored simulation.
With both the stored simulation response and the real response from the external service, Hoverfly is able to detect
With both the stored simulation response and the real response from the external service, Hoverfly is able to detect
differences between the two. When Hoverfly has finished comparing the two responses, the difference is stored and the
incoming request is served the real response from the external service.

Expand Down Expand Up @@ -48,4 +48,4 @@ This data is stored and kept until the Hoverfly instance is stopped or the the s

.. seealso::

For more information on the API to retrieve differences, see :ref:`rest_api`.
For more information on the API to retrieve differences, see :ref:`rest_api`.
11 changes: 5 additions & 6 deletions docs/pages/keyconcepts/postserveaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Post Serve Action
=================

Overview
========
--------

- PostServeAction allows you to execute custom code after a response has been served in simulate or spy mode.

Expand All @@ -15,7 +15,7 @@ Overview
- In order to register post serve action, it takes mainly four parameters - binary to invoke script, script content/location, delay(in ms) post which it will be executed and name of that action.

Ways to register a Post Serve Action
==================================
------------------------------------

- At time of startup by passing single/multiple -post-serve-action flag(s) as mentioned in the `hoverfly command page <https://docs.hoverfly.io/en/latest/pages/reference/hoverfly/hoverflycommands.html>`_.

Expand All @@ -27,13 +27,12 @@ Ways to register a Post Serve Action
- Once post serve action is registered, we can trigger particular post serve action by putting it in response part of request-response pair in simulation JSON.

**Example Simulation JSON**
::

.. code:: json
{
...
"response": {
...
"postServeAction": "<name of post serve action we want to invoke>"
...
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/keyconcepts/simulations/pairs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ JSON is a text-based file format so it has no intrinsic support for binary data.
:ref:`View entire simulation file <basic_encoded_simulation>`

Serving response bodies from files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting from version **1.3.0** hoverfly can return response body from a specific file:

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/keyconcepts/templating/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Additional data can come from helper methods. These are the ones Hoverfly curren
| | ``'be' 'mock' }}`` | |
| value in the target string | (where Request.Body has the value of | |
| | | |
| | {"text":"to be or not to be"} | to mock or not to mock |
| | ``{"text":"to be or not to be"}`` | to mock or not to mock |
+-----------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------+
| Generate random data using go-fakeit | ``{{ faker 'Name' }}`` | John Smith |
+-----------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------+
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/reference/api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,15 @@ Sets the PAC file for Hoverfly.


DELETE /api/v2/hoverfly/pac
""""""""""""""""""""""""
"""""""""""""""""""""""""""

Unsets the PAC file configured for Hoverfly.

-------------------------------------------------------------------------------------------------------------


GET /api/v2/cache
""""""""""""""""""""
"""""""""""""""""
Gets the requests and responses stored in the cache.

**Example response body**
Expand Down Expand Up @@ -986,9 +986,9 @@ Gets reports containing response differences from Hoverfly filtered on basis of
-------------------------------------------------------------------------------------------------------------

DELETE /api/v2/diff
""""""""""""""""""""
"""""""""""""""""""
Deletes all reports containing differences from Hoverfly.

DELETE /api/v2/shutdown
""""""""""""""""""""
"""""""""""""""""""""""
Shuts down the hoverfly instance.
11 changes: 5 additions & 6 deletions docs/pages/reference/hoverfly/request_matchers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@ Example
"matcher": "array",
"config": {
"ignoreUnknown": <true/false>,
"ignoreOrder": <true/false>,
"ignoreOccurrences": <true/false>
"ignoreUnknown": "<true/false>",
"ignoreOrder": "<true/false>",
"ignoreOccurrences": "<true/false>"
},
"value": [
"access:vod",
Expand Down Expand Up @@ -601,7 +601,6 @@ Example
"matcher": "jsonpath",
"value": "$.user.id",
"doMatch": {
matcher: "exact",
value: "1"
"matcher": "exact",
"value": "1"
}
18 changes: 9 additions & 9 deletions docs/pages/troubleshooting/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ When Hoverfly cannot match a response to an incoming request, it will return inf
"headers": null
}`

Here, you can see which fields did not match. In this case, it was the ``body``.
Here, you can see which fields did not match. In this case, it was the ``body``.
You can also view this information by running ``hoverctl logs``.

Why isn't Hoverfly returning the closest match when it cannot match a request?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hoverfly will only provide this information when the matching strategy is set to **strongest match**
(the default). If you are using the **first match** matching strategy, the closet match information
Hoverfly will only provide this information when the matching strategy is set to **strongest match**
(the default). If you are using the **first match** matching strategy, the closet match information
will not be returned.

How can I view the Hoverfly logs?
Expand All @@ -90,9 +90,9 @@ How can I view the Hoverfly logs?
Why does my simulation have a ``deprecatedQuery`` field?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Older simulations that have been upgraded through newer versions of Hoverfly may now contain a field
Older simulations that have been upgraded through newer versions of Hoverfly may now contain a field
on requests called ``deprecatedQuery``. With the v5 simulation schema, the request query field was
updated to more fully represent request query paramters. This involves storing queries based on
query keys, similarly to how headers are stored in a simulation.
Expand Down Expand Up @@ -124,22 +124,22 @@ If you have ``deprecatedQuery`` field, you should remove it by splitting it by q
],
}
If you cannot update your ``deprecatedQuery`` from your simulation for a technical reason, feel free to
If you cannot update your ``deprecatedQuery`` from your simulation for a technical reason, feel free to
raise an issue on Hoverfly.

Why am I not able to access my Hoverfly remotely?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That's because Hoverfly is bind to loopback interface by default, meaning that you can only access
to it on localhost. To access it remotely, you can specify the IP address it listens on. For example,
That's because Hoverfly is bind to loopback interface by default, meaning that you can only access
to it on localhost. To access it remotely, you can specify the IP address it listens on. For example,
setting ``0.0.0.0`` to listen on all network interfaces.

.. code:: bash
hoverfly -listen-on-host 0.0.0.0
My simulation file is very large because of response bodies, what can I do with that?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can move those response bodies into separate files and specify :code:`bodyFile` in the response instead of
:code:`body`. Please refer to :ref:`pairs`.
1 change: 1 addition & 0 deletions docs/pages/tutorials/basic/delays/lognormal/lognormal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ If need you can adjust response time by min and max parameters.
.. _Log-normal distribution: https://en.wikipedia.org/wiki/Log-normal_distribution
.. _mean: https://en.wikipedia.org/wiki/Expected_value
.. _median: https://en.wikipedia.org/wiki/Median

Let's apply a random log-normal distributed delay to all responses. First, we need to create and export a simulation.

.. literalinclude:: delays-capture.sh
Expand Down

0 comments on commit 60ee224

Please sign in to comment.