EndpointOverride

@Serializable
data class EndpointOverride(val id: String, val name: String? = null, val path: String? = null, val method: String? = null) : EndpointDefinition

A partial override for a shared EndpointConfig within a specific EnvironmentConfig.

Implements EndpointDefinition alongside EndpointConfig, sharing the same field names. The key difference is that name, path and method are nullable here — a null value means "keep the shared value from ApiGroupConfig.endpoints". Only id is non-null, as it is the lookup key that identifies which shared endpoint this override targets.

Merge Behaviour

Given a shared endpoint:

{ "id": "getUser", "name": "Get User", "path": "/v1/users/{userId}", "method": "GET" }

And an override:

{ "id": "getUser", "path": "/v1/users/{userId}/profile" }

The effective endpoint for this environment becomes:

id:     getUser
name: Get User ← from shared (null in override → keep shared)
path: /v1/users/{userId}/profile ← from override
method: GET ← from shared (null in override → keep shared)

Merge Logic

The merge is performed by ApiGroupConfig.effectiveEndpoints, which calls:

sharedEndpoint.copy(
name = override.name ?: sharedEndpoint.name,
path = override.path ?: sharedEndpoint.path,
method = override.method ?: sharedEndpoint.method
)

See also

Constructors

Link copied to clipboard
constructor(id: String, name: String? = null, path: String? = null, method: String? = null)

Properties

Link copied to clipboard
open override val id: String

The EndpointConfig.id of the shared endpoint to override. Must match an entry in ApiGroupConfig.endpoints; unrecognised IDs are ignored.

Link copied to clipboard
open override val method: String?

Replacement HTTP method, or null to keep the shared value

Link copied to clipboard
open override val name: String?

Replacement display name, or null to keep the shared value

Link copied to clipboard
open override val path: String?

Replacement API path, or null to keep the shared value