Mockoon release v9.1.0

2024-12-05

Welcome to this new release of Mockoon. It brings many improvements among which data buckets state reporting, custom subdomains for cloud deployments, new --proxy CLI flag, JSON Schema formats support, and many more improvements and fixes. Read on to learn more about this release.


 Our sponsors

GitHub Localazy

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!

sponsor button

You can also support us by subscribing to our Cloud and enjoy a whole new level of capabilities: real-time collaboration, cloud deployments, AI-powered API mocks generation, enterprise-grade support, and more to come!

subscribe to cloud button

Your contribution fuels Mockoon’s independence and keeps the project alive!

 Improved data buckets state reporting

Because it can be difficult to know if your data buckets are generating valid JSON data, we added a new indicator in the UI to show you if they were generated and if the result was valid JSON:

data bucket state indicator

You can also click on the indicator to see the generated data in an editor and the validation error, if any (read-only):

data bucket state editor

(Issue #1581)

 Cloud deployments

We added two new options to configure your mock deployments in the cloud: you can now customize the subdomain of your cloud deployment (e.g. my-subdomain.mockoon.app) and disable the admin API for your mock.

cloud deployment dialog with custom subdomain and disable admin api option

(Issues #1572 and #1614)

 New --proxy CLI flag and disabled routes wildcard support

We added a new --proxy flag to the CLI to allow you to override the proxy setting of your mock. This flag can either be set to 'enabled' or 'disabled'. This is useful when you want to start a mock with a different proxy setting than the one saved in the configuration file.

mockoon-cli start -d ./mock.json --proxy enabled

We also update the disabled routes flag and Serverless options behavior. You can now disable all routes at runtime by using a wildcard:

With the CLI:

mockoon-cli start -d ./mock.json --disable-routes=*

With the Serverless package:

Copy
const mockoonServerless = new mockoon.MockoonServerless(mockEnv, { disabledRoutes: ['*'] });

(Issue #1024)

 Improved request's path rule

The request's path rule will now compare the value against both the original and actual paths, for example, /users/:id and /users/123. It is now easier to override CRUD route operations.

rule targeting the request path

(Issue #1605)

 JSON Schema formats support and bug fixes

We added support for JSON Schema formats. You can now use the format keyword in your JSON Schema to validate your request bodies.

Copy
{ "type": "object", "properties": { "email": { "type": "string", "format": "email" } } }

(Issue #1594)

We also fixed a bug that prevented JSON schema from being compared against the root-level request body. ⚠️ This change may break some rules create without a path. (Issue #1595)

We published a new tutorial on how to use JSON Schema formats in Mockoon. Check it out.

 Templating helpers object merging

We added a new objectMerge templating helper to merge two or more objects. We also added a new merge operator to the setData helper and made concat compatible with arrays.

These changes should make object manipulation and merging easier in your templates.

(Issue #1620)

 Fixes

  • You can now target properties with dots in the file path input (e.g., ./folder/{{queryParam 'file\.name'}}.json). (Issue #1623)
  • The zipcode templating helper was detected as a request helper and was delaying data bucket initialization. This is now fixed. (Issue #1589)
  • Brackets used for priority are now supported in JSONPath expressions: $[?(@.status==='enabled' && (@.id===1 || @.id===2))]. (Issue #1583)
  • Copying a route full path from the drop down-menu now uses the correct protocol for WebSocket routes. (Issue #1579)
  • The WebSocket server now correctly answers with a 404 when requesting a connection to a non-existent WebSocket endpoint. (Issue #1612)
  • Multipart/form-data parsing now supports multiple files and fields with the same name (not using the array/bracket notation). (Issue #1613)

 Improvements

  • Thanks to the update to the latest version of Faker.js, you can now generate JSON web tokens in your templates: {{faker 'internet.jwt'}}. (Issue #740)

 Chores

  • We updated the libraries and applications dependencies to their latest versions. As a result, we updated Faker.js to v9.3.0 which includes new functions (jwt, etc.) (see Faker.js release notes).