ApiGroupConfig

@Serializable
data class ApiGroupConfig(val id: String, val name: String, val endpoints: List<EndpointConfig>, val environments: List<EnvironmentConfig>)

Configuration for a named, stable API group (e.g. "my-backend", "jsonplaceholder").

An API group is the top-level organisational unit in the mock configuration. It represents a logical backend that the application communicates with, regardless of which environment is active. It defines:

  • A shared pool of endpoints that exist across all environments

  • A list of environments, each providing the base URL for this group at a given deployment stage, along with optional per-environment endpoint overrides and additions

Shared Endpoints vs. Environment-Specific Variations

Endpoints are defined once in endpoints and shared across all environments. When an endpoint differs in a specific environment (different path, name or method), an EndpointOverride can be declared inside that EnvironmentConfig. Endpoints that only exist in a specific environment are declared in EnvironmentConfig.additionalEndpoints.

Example

{
"id": "my-backend",
"name": "My Backend",
"endpoints": [
{ "id": "getUser", "name": "Get User", "path": "/v1/users/{userId}", "method": "GET" }
],
"environments": [
{ "id": "staging", "name": "Staging", "url": "https://staging.api.example.com" },
{ "id": "production", "name": "Production", "url": "https://api.example.com" }
]
}

See also

Constructors

Link copied to clipboard
constructor(id: String, name: String, endpoints: List<EndpointConfig>, environments: List<EnvironmentConfig>)

Properties

Link copied to clipboard

Shared endpoint definitions, available in all environments unless overridden or omitted via EnvironmentConfig.endpointOverrides / EnvironmentConfig.additionalEndpoints

Link copied to clipboard

List of deployment stages for this group, each providing the resolved base URL and optional endpoint customisations

Link copied to clipboard
val id: String

Stable unique identifier for this group (e.g. "my-backend", "jsonplaceholder"). Used as the first path segment of mock response files: responses/{id}/{endpointId}/ or responses/{id}/{environmentId}/{endpointId}/

Link copied to clipboard

Human-readable name displayed in the UI (e.g. "My Backend")

Functions

Link copied to clipboard

Builds the effective endpoint list for a given ApiGroupConfig and EnvironmentConfig pair.