Expand description
ResponseRewriter trait for post-generation response mutation.
The OpenAPI router runs two optional mutation passes on each generated response body:
- Template token expansion — substitutes placeholders like
{{uuid}}or{{now}}with rendered values. - Override application — applies operation-targeted patches from user-supplied rules.
Both of those historically lived in mockforge-core
(templating::expand_tokens and overrides::Overrides::apply). To
let mockforge-openapi own the router without pulling in core’s
templating + conditions + encryption graph, the router dispatches
through a ResponseRewriter trait object. Core supplies the concrete
implementation (see mockforge_core::openapi_rewriter::CoreResponseRewriter)
that chains its own templating + overrides engines.
Traits§
- Response
Rewriter - Hook for post-generation response body mutation used by the OpenAPI
router. Implementations are called conditionally —
expand_tokensonly when template expansion is enabled for the current context, andapply_overridesonly when operation overrides are enabled.