Experts show you how to leverage the full power of the Stoplight Platform. Register for the interactive workshop here.
Prism is an open-source HTTP mock server that can mimic your API’s behavior as if you already built it. Mock HTTP servers are generated from your OpenAPI v2/v3 (formerly known as Swagger) documents.
The waterfall model does not work well for building APIs. Learning at the very end what your potential consumers think about your software can be a source of huge problems. With Prism you can move the feedback stage to the design phase of your API by providing a real server to use and play with.
Static examples in mock APIs can bias the way you write the code and test the API. Prism can generate dynamic random examples based on your API description, so the examples are always valid.
Prism validates both request and response data. If you have an invalid example in the specification, Prism will let you know; if your request is not compliant with the rules of your API specification, Prism will return an error message. It will never yell to you, we promise.
Requests and responses take care of a lot of API interactions, but what about callbacks? OpenAPI v3.0 allows API designers to define callbacks, and construct a URL to fire a payload at, so Prism will too. Notice HTTP callbacks coming in, allowing you to attempt to integrate them before the API has even been built.
Identify discrepancies between the OpenAPI document and target API to help frontend developers integrating with your API. The proxy can also be enabled in staging or any other pre-production environment, to ensure OpenAPI documents and code stay in sync.