Skip to content

Multiplatform Ktor schema declarationopensavvy.spine.apiFailureSpecByCode

ByCode

interface ByCode<out F> : FailureSpec

Represents a failure that is represented by a specific statusCode.

When the server throws that failure, it will be returned using that HTTP code. When the client receives that HTTP code, it will attempt to deserialize that failure from the body.

Because of this, no two failures in the same endpoint can have the same statusCode. To learn how to work around this, read FailureSpec.

See also

Inheritors

Properties

statusCode

abstract val statusCode: HttpStatusCode