Multiplatform Ktor schema declaration • opensavvy.spine.api • FailureSpec • ByCode
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¶
-
FailureSpecLearn more about failures. -
FailureCompanionEasily implementByCodefor your companion objects.
Inheritors¶
Properties¶
statusCode¶
abstract val statusCode: HttpStatusCode