Templating: Mockoon vs OpenAPI Examples
Short answer: Rich templating is a mock designer's strength for bespoke, dynamic responses; a spec-driven mock uses the examples and response schemas you already author. The first is a separate template language; the second keeps the mock, docs, and tests on the same data.
What templating is built for
Dynamic values, transformations, and responses that are not part of the contract. It is the right tool for behavior the spec does not describe.
What authored examples are built for
| Property | Templating | Spec examples |
|---|---|---|
| Data source | Template logic | Contract examples |
| Shared with docs | No | Yes |
| Validity | As written | By construction |
| Maintenance | Separate | With spec |
Why the shared data matters
A mock built from the spec returns the same examples the docs show and the tests assert, so the three cannot disagree.
The decision rule
Use templating for bespoke behavior outside the contract. Use spec examples when the mock should stay in sync and be valid by construction.
This is part of the Powerduck vs Mockoon comparison. Next, read the cloud comparison.