2024-08-06
Welcome to this new release of Mockoon. It brings new exciting features: templating support in rules property/path, new JWT templating helpers, dot notation support in the CRUD route key, random latencies, and many more improvements and fixes. Read on to learn more about this release.
Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the Sponsors and Backers who helped this project over time!
Templating helpers are now available in the response rules property or path field. You can dynamically target a specific body property, header name, etc. using templating helpers:
(Issue #1443)
Two new templating helpers are now available to help you decode JWT tokens in your responses: jwtPayload
and jwtHeader
. They let you access the payload and header objects respectively. These helpers are compatible with other templating helpers like header
. They will also automatically ignore the Bearer
prefix if present in the provided string, to make it easier to use them with an Authorization
header.
Copy
Check the helpers documentation for more information.
(Issue #774)
CRUD route key now supports dot notation. It allows you to perform CRUD operations (e.g. get by id, update by id, etc.) based on nested properties:
Copy{ "data": { "id": 1 } }
(Issue #1433)
You can now randomize the latency of your route responses and environments. This feature is useful to simulate network latency variations and test your application's behavior under different network conditions. It will randomize the latency of the response between 0 and the value you set in the environment or route parameters.
The option can be found in the application settings:
Options are also available in the CLI, in the form of a flag --enable-random-latency
, and in the serverless package, in the form of a new enableRandomLatency
option:
Copyconst mockoonServerless = new mockoon.MockoonServerless(mockEnv, { enableRandomLatency: true });
(Issue #568)
In the logs tab, the logs timestamps are now displayed in a human-readable format like 7 hours ago
instead of 2024-01-01 08:00:00.123
.
(Issue #1430)
We updated the libraries and applications dependencies to their latest versions to fix some reported vulnerabilities.
A big thank you to the following people who helped to make Mockoon better: