APIFae or Prism
Prism builds a mock server from an OpenAPI document or a Postman collection, and prism proxy checks a running server against that document. APIFae serves mocks you keep as files, and apifae diff checks the running API against those mocks and, when you have one, against your OpenAPI spec.
So both tools can tell you when a running API breaks its spec. What apifae diff adds is a second question: whether the mocks you test against still match the real API, which needs no spec at all. Every claim about Prism below links to the documentation page it came from.
Pick Prism if
- Your team writes the OpenAPI document first and wants mocks straight from it.
- You want a proxy in front of a running server that checks its traffic against the OpenAPI document.
prism proxydoes this. - You want the mock to reject requests that break the spec, with a validation error.
- You want response bodies generated from the schema instead of written by hand.
- You want to mock the callbacks your spec defines.
- You need an open-source tool. Prism is licensed under Apache 2.0.
Pick APIFae if
- You need to know when your mocks stop matching the real API.
apifae diffcompares each mock with the live API, and it works without an OpenAPI spec. - You want one run that checks the live API against your mocks and your spec.
apifae diffreports drift and spec violations together. - You want CI to tell drift apart from an outage.
apifae diffexits 1 when a mock has drifted and 2 when it can't reach the API.
Both tools run a mock server from the command line, and both can start from an OpenAPI document.
| Capability | APIFae | Prism (opens in a new tab) |
|---|---|---|
| What you install first | Nothing. One native binary. | Node, a container runtime or a standalone binary |
| Mocks are files you can commit | YAML | The spec or Postman collection itself |
| Record a real API into mocks | Yes | No. The spec is the source |
| Named states a scenario moves between | Yes | No. Examples are picked by name |
| Compares your mock against the live API | Yes, apifae diff | No. It checks the implementation against a spec |
| Works without an OpenAPI spec | Yes. A spec adds a second check | No. It needs a spec or a Postman collection |
| Licence | Closed source; binaries under MIT or Apache-2.0 | Apache 2.0 |
| Checks a running API against the spec | Yes, apifae diff, when a spec is present | Yes, prism proxy |
| Rejects requests that break the spec | No | Yes |
| Generates response bodies from the schema | No. Bodies come from your mock files | Yes |
| Mocks callbacks the spec defines | No | Yes |
Where each claim comes from
Checked against Prism’s documentation on . If a quote no longer matches the page it links to, the claim is out of date and we want to hear about it.
Pick Prism if
Your team writes the OpenAPI document first and wants mocks straight from it.
Prism can be given an OpenAPI v2 or v3 description document, which is essentially a data source for all the decisions Prism makes
https://github.com/stoplightio/prism/blob/main/docs/getting-started/02-concepts.md (opens in a new tab)You want a proxy in front of a running server that checks its traffic against the OpenAPI document.
prism proxydoes this.The proxy feature will help you identify discrepancies between the OpenAPI document and any other server you designate as the target
https://github.com/stoplightio/prism/blob/main/docs/guides/03-validation-proxy.md (opens in a new tab)You want the mock to reject requests that break the spec, with a validation error.
In case there's neither a 422 nor a 400 defined, Prism will create a 422 response code for you indicating the validation errors it found along the way
https://github.com/stoplightio/prism/blob/main/docs/guides/02-request-validation.md (opens in a new tab)You want response bodies generated from the schema instead of written by hand.
You can enable the dynamic examples generation by using the -d flag in the command line
https://github.com/stoplightio/prism/blob/main/docs/guides/01-mocking.md (opens in a new tab)You want to mock the callbacks your spec defines.
This example shows how Prism mocks callbacks
https://github.com/stoplightio/prism/blob/main/docs/guides/04-callbacks.md (opens in a new tab)You need an open-source tool. Prism is licensed under Apache 2.0.
Apache License Version 2.0, January 2004
https://github.com/stoplightio/prism/blob/main/LICENSE (opens in a new tab)What you install first
Node, a container runtime or a standalone binary
npm install -g @stoplight/prism-cli … standalone binaries are provided for all major platforms … Prism is available as a Docker image
https://github.com/stoplightio/prism/blob/main/docs/getting-started/01-installation.md (opens in a new tab)Mocks are files you can commit
The spec or Postman collection itself
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations
https://github.com/stoplightio/prism (opens in a new tab)Record a real API into mocks
No. The spec is the source
Prism can be given an OpenAPI v2 or v3 description document, which is essentially a data source for all the decisions Prism makes
https://github.com/stoplightio/prism/blob/main/docs/getting-started/02-concepts.md (opens in a new tab)Named states a scenario moves between
No. Examples are picked by name
If there are multiple examples, then they can be selected by name
https://github.com/stoplightio/prism/blob/main/docs/guides/01-mocking.md (opens in a new tab)Compares your mock against the live API
No. It checks the implementation against a spec
Prism can help you check for discrepencies between your API implementation and the OpenAPI document that describes
https://github.com/stoplightio/prism (opens in a new tab)Works without an OpenAPI spec
No. It needs a spec or a Postman collection
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations
https://github.com/stoplightio/prism (opens in a new tab)Licence
Apache 2.0
Apache License Version 2.0, January 2004
https://github.com/stoplightio/prism/blob/main/LICENSE (opens in a new tab)Checks a running API against the spec
Yes, prism proxy
The proxy feature will help you identify discrepancies between the OpenAPI document and any other server you designate as the target
https://github.com/stoplightio/prism/blob/main/docs/guides/03-validation-proxy.md (opens in a new tab)Rejects requests that break the spec
Yes
In case there's neither a 422 nor a 400 defined, Prism will create a 422 response code for you indicating the validation errors it found along the way
https://github.com/stoplightio/prism/blob/main/docs/guides/02-request-validation.md (opens in a new tab)Generates response bodies from the schema
Yes
You can enable the dynamic examples generation by using the -d flag in the command line
https://github.com/stoplightio/prism/blob/main/docs/guides/01-mocking.md (opens in a new tab)Mocks callbacks the spec defines
Yes
This example shows how Prism mocks callbacks
https://github.com/stoplightio/prism/blob/main/docs/guides/04-callbacks.md (opens in a new tab)
Our own column
The APIFae cells have no quotes because you can check them by running the binary. The full comparison puts APIFae next to WireMock, Prism and Mockoon, and the guide to keeping a mock honest walks through a real apifae diff run against a live API.