Skip to content

Decoder

[<Interface>]
type Decoder<'T> =
    abstract member Decode<'JsonValue> (helpers: IDecoderHelpers<'JsonValue>, value: 'JsonValue) : Result<'T,DecoderError<'JsonValue>>
AssemblyRanvier.Wire

Turns a JSON value into a 'T, or explains why it can't.

The method is generic over the JSON type, so a decoder is written once and runs on every runtime.

Methods

abstract member Decode<'JsonValue> (helpers: IDecoderHelpers<'JsonValue>, value: 'JsonValue) : Result<'T,DecoderError<'JsonValue>>