Decode Module
Functions and values
| Function or value |
Description
|
Full Usage:
array decoder el
Parameters:
IndexedDecoder<'TResult>
-
el : JsonElement
-
Returns: Result<'TResult array, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Decodes a JSON array element into a value of type If a failure is encountered in the decoding process, the decoding stops there, and the error is returned, the rest of the array is not decoded.
|
Full Usage:
auto el
Parameters:
JsonElement
-
Returns: Result<'TResult, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Uses the standard System.Text.Json deserialization means to deserialize a JSON element into a value of type For the most part it is recommended that you use this function unless you have a "F# types based" object like discriminated unions, Which are not supported by the standard deserialization means.
|
Full Usage:
autoJsonOptions options el
Parameters:
JsonSerializerOptions
-
el : JsonElement
-
Returns: Result<'TResult, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Uses the standard System.Text.Json deserialization means to deserialize a JSON element into a value of type For the most part it is recommended that you use this function unless you have a "F# types based" object like discriminated unions, Which are not supported by the standard deserialization means.
|
Full Usage:
collectOneOf decoders element
Parameters:
Decoder<'TResult> seq
-
element : JsonElement
-
Returns: Result<'TResult, DecodeError list>
Type parameters: 'TResult |
Takes a list of possible decoders and tries to decode the JSON element with each one of them. This is useful to decode JSON elements into discriminated unions
|
Full Usage:
decodeAt decoder index el
Parameters:
Decoder<'TResult>
-
index : int
-
el : JsonElement
-
Returns: Result<'TResult, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Attempts to decode a JSON element that is living inside an array at the given index.
|
Full Usage:
decodeAtKey decoder key el
Parameters:
Decoder<'TResult>
-
key : string
-
el : JsonElement
-
Returns: Result<'TResult, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Attempts to decode a JSON element that is living inside an array at the given key.
|
Full Usage:
dict decoder el
Parameters:
IndexedMapDecoder<'TValue>
-
el : JsonElement
-
Returns: Result<Dictionary<string, 'TValue>, DecodeError>
Modifiers: inline Type parameters: 'TValue |
Decodes a JSON object into a BCL Dictionary where the keys are strings and the value is of type
|
Full Usage:
dictCol decoder el
Parameters:
IndexedMapCollectErrorsDecoder<'TValue>
-
el : JsonElement
-
Returns: Result<Dictionary<string, 'TValue>, DecodeError seq>
Modifiers: inline Type parameters: 'TValue |
Decodes a JSON object into a BCL Dictionary where the keys are strings and the value is of type
|
Full Usage:
list decoder el
Parameters:
IndexedDecoder<'TResult>
-
el : JsonElement
-
Returns: Result<'TResult list, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Decodes a JSON array element into a value of type If a failure is encountered in the decoding process, the decoding stops there and the error is returned, the rest of the array is not decoded.
|
Full Usage:
map decoder el
Parameters:
IndexedMapDecoder<'TValue>
-
el : JsonElement
-
Returns: Result<Map<string, 'TValue>, DecodeError>
Modifiers: inline Type parameters: 'TValue |
Decodes a JSON object into an FSharpMap where the keys are strings and the value is of type
|
Full Usage:
mapCol decoder el
Parameters:
IndexedMapCollectErrorsDecoder<'TValue>
-
el : JsonElement
-
Returns: Result<Map<string, 'TValue>, DecodeError seq>
Modifiers: inline Type parameters: 'TValue |
Decodes a JSON object into an FSharpMap where the keys are strings and the value is of type
|
|
|
Full Usage:
sequence decoder el
Parameters:
IndexedDecoder<'TResult>
-
el : JsonElement
-
Returns: Result<'TResult seq, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Decodes a JSON array element into a value of type If a failure is encountered in the decoding process, the decoding stops there and the error is returned, the rest of the array is not decoded.
|
Full Usage:
sequenceCol decoder el
Parameters:
IndexedCollectErrorsDecoder<'a>
-
el : JsonElement
-
Returns: Result<'a seq, DecodeError list>
Modifiers: inline Type parameters: 'a |
Decodes a JSON array element into the value of type If a failure is encountered in the decoding process, the error is collected and the decoding continues however, the result will be an error containing a list of all the errors that occurred during the decoding process.
|
Full Usage:
tryDecodeAt decoder index el
Parameters:
Decoder<'TResult>
-
index : int
-
el : JsonElement
-
Returns: Result<'TResult option, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Attempts to decode a JSON element that is living inside an array at the given index. If the element is not found, this will not fail but return an option type.
|
Full Usage:
tryDecodeAtKey decoder key el
Parameters:
Decoder<'TResult>
-
key : string
-
el : JsonElement
-
Returns: Result<'TResult option, DecodeError>
Modifiers: inline Type parameters: 'TResult |
Attempts to decode a JSON element that is living inside an array at the given key. If the element is not found, this will not fail but return an option type.
|
JDeck