Mock collections

Getting Started
Installation
Setup
Inspect Traffic
HTTP Rules (Modify Traffic)
Session Book
Mock Server
API Client
File Server
Workspace
Public API
Guides
TroubleShooting
Subscription & Billing
Getting Started
Installation
Setup
Inspect Traffic
API Client
HTTP Rules (Modify Traffic)
Mock Server
File Server
Workspace
Public API
Guides
Session Book
Subscription & Billing
TroubleShooting
 
 
 

Mock collections

Mock collections provide a structured way to manage your mocks. Each collection can optionally include a static “path” that is automatically prepended to the mock endpoints within that collection. This feature is particularly useful for versioning your mocks, ensuring consistency and clarity across different versions of your API.

Key benefits

  1. Efficient Organization:
      • Group related mocks together, making it easier to manage and locate them.
  1. Better Versioning:
      • Utilize the static "path" feature to prepend a version identifier or other relevant prefixes to your mock endpoints.
      • Simplify the process of updating and managing multiple versions of your API.

Example

Consider a collection for API version 1.0:
  • Collection path: /api/v1
  • Mock Endpoints:
    • /users
    • /products
With the collection path, the actual mock endpoints become:
  • /api/v1/users
  • /api/v1/products
This approach ensures that all endpoints within the collection are easily versioned, improving maintainability and clarity.

Create a new collection

  1. Go to Mocks Dashboard
  1. Click on New Collection.
notion image
  1. Enter the details of the Mock Collection and then click on Save.
    1. notion image
    2. Name: Give a collection a name.
    3. Collection Path: A path which gets prepended to all the mocks inside this collection.
      1. So if the collection path is “/api/v1”, then all the child mocks endpoint will start with this collection path.
    4. Description: Give collection a description.

Move mock into collection

Once the collection is created you can move the mocks into it.
  1. Click on the options button in right and click Move.
notion image
 
b. Select the appropriate collection and click Move.
notion image