Prism is a validating proxy and mock server for OpenAPI definitions and Postman collections. Place it between an end-to-end test and an API gateway so responses are checked against the API definition before the test evaluates them. section 7.5 section 7.0
A practical conformance workflow is:
- Start an end-to-end test against the API gateway and log the response body. section 7.5
- Start Prism with the OpenAPI definition, the gateway URL, and the --errors flag; Prism runs on port 4010 by default. section 7.5
- Change the test base URI from the gateway at port 8000 to Prism at port 4010. section 7.5
- Use the failure response and Prism logs to locate the schema violation and decide whether the definition or implementation should change. section 7.5
Detecting undocumented response fields
A Product Catalog API returns HTTP 200, but its response includes reviewRating and numberOfReviews that are absent from the OpenAPI definition. With --errors enabled, Prism returns HTTP 500 using RFC7807 Problem Details, identifies a VIOLATION, and reports additionalProperties errors at response.body. The test therefore fails even though the gateway itself returned 200.
