EnvironmentConfig

@Serializable
data class EnvironmentConfig(val id: String, val name: String, val url: String, val endpointOverrides: List<EndpointOverride> = emptyList(), val additionalEndpoints: List<EndpointConfig> = emptyList())

Configuration for a single deployment environment within an ApiGroupConfig.

An environment represents one stage in the delivery pipeline (e.g. staging, production, development). It provides the resolved base URL for its parent ApiGroupConfig at that stage, and optionally customises the shared endpoint pool via endpointOverrides and additionalEndpoints.

Endpoint Resolution

When the active environment is matched during request interception, the effective endpoint list for this environment is built as follows:

  1. Start with ApiGroupConfig.endpoints (the shared pool)

  2. Apply endpointOverrides — each override merges into the matching shared endpoint by EndpointOverride.id; unspecified fields keep their shared value

  3. Append additionalEndpoints — endpoints that only exist in this environment

Example

{
"id": "production",
"name": "Production",
"url": "https://api.example.com",
"endpointOverrides": [
{ "id": "getUser", "path": "/v1/users/{userId}/profile" }
],
"additionalEndpoints": [
{ "id": "getLegacyUser", "name": "Get Legacy User", "path": "/users/{userId}", "method": "GET" }
]
}

See also

Constructors

Link copied to clipboard
constructor(id: String, name: String, url: String, endpointOverrides: List<EndpointOverride> = emptyList(), additionalEndpoints: List<EndpointConfig> = emptyList())

Properties

Link copied to clipboard

Optional list of endpoints that only exist in this environment (e.g. staging-only debug endpoints). Defaults to an empty list.

Link copied to clipboard

Optional list of partial endpoint replacements. Each entry references a shared endpoint by EndpointOverride.id and overrides only the fields it specifies. Defaults to an empty list.

Link copied to clipboard
val id: String

Unique identifier for this environment (e.g. "staging", "production"). Used as the second path segment of environment-specific mock response files: responses/{groupId}/{id}/{endpointId}/ and as part of the DataStore endpoint state key: "{id}-{endpointId}"

Link copied to clipboard

Human-readable name displayed in the UI (e.g. "Staging", "Production")

Link copied to clipboard
val url: String

The base URL for the parent API group in this environment (scheme + hostname, e.g. "https://staging.api.example.com"). The hostname is extracted at runtime and compared against incoming request hosts.