API Mocking
API mocking replaces real API endpoints with simulated ones that return predefined responses. This is useful for local development where the real API may be unavailable, unreliable, or have side effects.
Why we need API mocking
The Zammad EAI is currently not publicly available. To enable local development without relying on the EAI’s availability, we use API mocking.
Software under consideration
Criteria
- Compatible with OpenAPI 3.1
- Validation of Requests/Responses
- Compatible with multipart requests
- Dummy Data in Response
- Open Source
- Docker Container with OpenAPI Support
Comparison
| Prism | Imposter | Mock Server | SoapUI | WireMock | |
|---|---|---|---|---|---|
| OpenAPI 3.1 | ✅ | ✅ | ✅ | ❌ | ✅ |
| Multipart Requests | ❌ | ✅ | ✅ | ✅ | ✅ |
| Dummy Data Response | ✅ | ✅ | ✅ | ✅ | ✅ |
| Open Source | ✅ | ✅ | ✅ | ✅ | ✅ |
| Validation | ✅ | ✅ | ✅ | ✅ | ❌ |
| Docker Container with OpenAPI Support | ✅ | ✅ | ✅ | ❌ | ❌ |
INFO
For SoapUI, only the free version has been considered.
Decision
We chose Imposter for this project. Short rationale:
- Works better as a standalone mock server.
- Easy import of OpenAPI specifications (low friction for keeping mocks in sync with the API contract).
- Good multipart / file-upload handling which we need for certain endpoints.
- Built-in validation and generated dummy responses for quick developer feedback.
- Simple containerized operation which fits local development and CI workflows.