Skip to main content
Preview: nothing is served yet. The sandbox is not open: it opens with the first test key. Until then, a mock generated from the contract answers every operation.

Build against a mock

A mock server generated from the contract, the OpenAPI document the Reference pages are generated from, answers every operation before it is served. With Prism:
Pin an exact 5.x release of Prism (@stoplight/prism-cli@5.x.y). With --dynamic, Prism generates its answers from the contract’s schemas instead of repeating one example. The contract file is distribution-v1.yaml; write to support@gridbeds.com if you do not have it yet. Client libraries can be generated from the same document.

The sandbox

The sandbox is https://staging-api.gridbeds.com/api/v1/distribution, and is reached with a gbd_test_ key (Authentication). It opens with the first test key, issued by the Gridbeds team. Once it is open, prism proxy checks the sandbox’s answers against the contract while your client talks to it:

What to try

  • A first full read of each list, then a second read with updated_since that brings back only what changed, as described in Synchronisation.
  • A tombstone, for each of withdrawn and deleted, on every resource, and an enum value your code does not know.
  • A 410 for an updated_since older than 35 days, which must start a resync.
  • A notification delivered twice, out of order, with a lower version than the one you hold, and with a bad signature or a stale timestamp (Webhooks).
  • A 429 with Retry-After (Errors and rate limits).