Add an intercept-and-transform rule
proxy_mock_transformIntercept HTTP requests, forward to the real backend, and apply in-place JSON patches to modify responses. Supports conditional matching and dynamic timestamps for mocking or transforming API data.
Instructions
Intercept a request, forward it to the real backend, parse the JSON response, apply in-place patches (path + optional where + set), and return the modified response. Use [] for array wildcards in path, where for conditional matching, and __NOW__ / __NOW_PLUS_<N><UNIT>__ macros for dynamic timestamps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL pattern. Default is glob/substring matched against the full absolute URL. With regex=true, a raw JS regex source. | |
| regex | No | Treat 'url' as a raw regex (default false). | |
| method | Yes | HTTP method: GET, POST, PUT, DELETE, PATCH, HEAD, or OPTIONS. | |
| patches | Yes | One or more JSON patch operations. |