Skip to content

Multiplatform Ktor schema declarationopensavvy.spine.apiAnyEndpointBuilder

Builder

sealed interface Builder

The super-type for the endpoint declaration syntax.

See AnyEndpoint to learn more about the syntax.

This interface uses the same trick as AnyEndpoint to avoid source-incompatible breaking changes. See its documentation for details.

Functions

failure

abstract fun <S : FailureSpec> failure(spec: S): AnyEndpoint.Builder

Declares a possible failure that can happen when calling this endpoint.

abstract fun <F> failure(statusCode: HttpStatusCode): AnyEndpoint.Builder

Declares a possible failure that can happen when calling this endpoint.

parameters

Declares query parameters that the client will need to provide to the server.

request

abstract fun <T : Any> request(kClass: KClass<T>): AnyEndpoint.Builder

Declares the request body type.

response

abstract fun <T : Any> response(kClass: KClass<T>): AnyEndpoint.Builder

Declares the response body type.