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 proxy does 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 diff compares 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 diff reports drift and spec violations together.
  • You want CI to tell drift apart from an outage. apifae diff exits 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.

Read from Prism’s own documentation on . What each row is based on.
CapabilityAPIFaePrism (opens in a new tab)
What you install firstNothing. One native binary.Node, a container runtime or a standalone binary
Mocks are files you can commitYAMLThe spec or Postman collection itself
Record a real API into mocksYesNo. The spec is the source
Named states a scenario moves betweenYesNo. Examples are picked by name
Compares your mock against the live APIYes, apifae diffNo. It checks the implementation against a spec
Works without an OpenAPI specYes. A spec adds a second checkNo. It needs a spec or a Postman collection
LicenceClosed source; binaries under MIT or Apache-2.0Apache 2.0
Checks a running API against the specYes, apifae diff, when a spec is presentYes, prism proxy
Rejects requests that break the specNoYes
Generates response bodies from the schemaNo. Bodies come from your mock filesYes
Mocks callbacks the spec definesNoYes

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.

  1. 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 proxy does 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. Licence

  9. 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)
  10. 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)
  11. 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)
  12. Mocks callbacks the spec defines

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.