Releases: marle3003/mokapi
Releases · marle3003/mokapi
v0.19.1
v0.19.0
Changes
🔧 Event Handler Improvements
Added track
option to event handler arguments.
The return type boolean will be removed in the next release.
Before:
on('http', function(request, response) {
response.data = 'foo';
return true;
});
Now:
on('http', function(request, response) {
response.data = 'foo';
// No need to return true — Mokapi detects changes to the response object,
// which is equivalent to the previous `return true` behavior
});
on('http', function(request, response) {
console.log('hello world')
}, { track: true } ); // Equivalent to previous `return true` behavior
🧬 New: Patch Generated Mock Data with JavaScript
Introduced support for JavaScript functions to patch generated values.
- This allows selective overriding of specific fields while preserving values generated by Mokapi.
- Ideal for making the required mock data more robust against new versions that are not relevant for your own scenario.
Example:
import { on, patch } from 'mokapi';
on('http', function(request, response) {
// Add field foo with value bar to Mokapi's generated response body
response.data = patch(response.data, { foo: 'bar' });
});
v0.18.1
v0.18.0
Changes
- Enhanced the data generator and its JavaScript API for greater flexibility and realism
- Improved the event handler system to automatically detect changes — returning a boolean is now optional
- Added validation to ensure OpenAPI paths start with a leading slash (/)
- Added support for .cjs and .mjs JavaScript file extensions
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.0
v0.15.0
Changes
- Improve error message when XML is expected but got something other
- Improve action logs for better debug UX
- Improve webui view for action log
- Improve website page resources
- Improve colors for light mode
Bugfixes
- Fix Kafka dashboard when multiple messages in a topic is defined