← Back to Kairo Docs|API Reference (Dokka)

RestEndpoint

abstract class RestEndpoint<I : Any, O : Any>

A RestEndpoint implementation defines the API contract for a single REST API endpoint. Implementations must be Kotlin data classes or data objects. See this Feature's README or tests for some examples.

I (input) represents the type of the request body. If none, use Unit. O (output) represents the type of the response body. If none, use Unit.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
annotation class PathParam

Marks a constructor parameter as a path parameter (matches :paramName in the path).

Link copied to clipboard
annotation class QueryParam

Marks a constructor parameter as a query parameter.

Properties

Link copied to clipboard
open val body: I

Override in data class endpoints that accept a request body. Throws NotImplementedError by default, which is expected for endpoints without a body.