Skip to main content

Backend - Static

Backend Policy in Data Equity Studio

The Backend Policy in Data Equity Studio allows API owners to configure how their API interacts with external services, mock responses, or static predefined responses. This flexibility ensures that APIs can be tested, deployed, and integrated with minimal effort.


Static Backend Policy in Data Equity Studio

The Static Backend Policy allows you to configure your API to always return a preset, predefined response. This policy is particularly useful during development or testing when you require predictable output without integrating with a live backend service.

Key Features

  • Preset Response: Define a static JSON response that will be returned for every API call.
  • Consistency: Ensure that the API consistently returns the same output, regardless of the request details.
  • Simplicity: Ideal for scenarios where dynamic behavior is not required, simplifying the testing process.
  • Predictability: Helps in establishing clear expectations for API consumers by providing a fixed response structure.

How It Works

When the Static Backend Policy is enabled:

  1. The API intercepts the incoming request.
  2. Instead of forwarding the request to an external or mock endpoint, it immediately returns the preconfigured static response.
  3. The static response is defined by the API owner and remains unchanged across multiple invocations.

Steps

  • Select the backend plugin.
  • In the Endpoint Type property, select Static
  • Set the Response Status and HTTP Headers
  • Add the Response Body Docs Version Dropdown
  • Deploy and test Docs Version Dropdown

Example Configuration

Below is an example of how you might configure the static backend policy:

   {
"message": "This is a static response.",
"data": {
"id": 1,
"name": "Sample Item",
"description": "This data is statically returned by the API."
}
}