Header menu logo JDeck

Property Type

This type containes methods that are particularly useful to decode properties from JSON elements. They can be primitive properties, objects, arrays, etc.

If the property is not found in the JSON element, the decoding will fail.

Static members

Static member Description

Property.array (name, decoder)

Full Usage: Property.array (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult array, DecodeError list>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

This method will attempt to decode the type and collect all the errors that occur during the decoding process.

name : string

decoder : CollectErrorsDecoder<'TResult>

Returns: JsonElement -> Result<'TResult array, DecodeError list>

Property.array (name, decoder)

Full Usage: Property.array (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TResult> -

Returns: JsonElement -> Result<'TResult array, DecodeError>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

The decoding process will stop at the first failure and the error will be returned.

name : string

decoder : Decoder<'TResult>

Returns: JsonElement -> Result<'TResult array, DecodeError>

Property.dict (name, decoder)

Full Usage: Property.dict (name, decoder)

Parameters:
Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError list>
Modifiers: inline
Type parameters: 'TValue

Takes a property name and applies the given decoder to the values on the properties of the object

This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred.

name : string

decoder : IndexedMapCollectErrorsDecoder<'TValue>

Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError list>

Property.dict (name, decoder)

Full Usage: Property.dict (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TValue> -

Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError>
Modifiers: inline
Type parameters: 'TValue

Takes a property name and applies the given decoder to the values on the properties of the object

The decoding process will stop at the first failure, and the error will be returned.

name : string

decoder : Decoder<'TValue>

Returns: JsonElement -> Result<Dictionary<string, 'TValue>, DecodeError>

Property.get (name, decoder)

Full Usage: Property.get (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult, DecodeError list>
Modifiers: inline
Type parameters: 'TResult

Takes the name of a property and a decoder and returns a function that can be used to decode the property.

This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred.

name : string

decoder : CollectErrorsDecoder<'TResult>

Returns: JsonElement -> Result<'TResult, DecodeError list>

Property.get (name, decoder)

Full Usage: Property.get (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TResult> -

Returns: JsonElement -> Result<'TResult, DecodeError>
Modifiers: inline
Type parameters: 'TResult

Takes the name of a property and a decoder and returns a function that can be used to decode the property.

The decoding process will stop at the first failure and the error will be returned.

name : string

decoder : Decoder<'TResult>

Returns: JsonElement -> Result<'TResult, DecodeError>

Property.list (name, decoder)

Full Usage: Property.list (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult list, DecodeError list>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

This method will attempt to decode the type and collect all the errors that occur during the decoding process.

name : string

decoder : CollectErrorsDecoder<'TResult>

Returns: JsonElement -> Result<'TResult list, DecodeError list>

Property.list (name, decoder)

Full Usage: Property.list (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TResult> -

Returns: JsonElement -> Result<'TResult list, DecodeError>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

The decoding process will stop at the first failure and the error will be returned.

name : string

decoder : Decoder<'TResult>

Returns: JsonElement -> Result<'TResult list, DecodeError>

Property.map (name, decoder)

Full Usage: Property.map (name, decoder)

Parameters:
Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError list>
Modifiers: inline
Type parameters: 'TValue

Takes a property name and applies the given decoder to the values on the properties of the object

This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred.

name : string

decoder : IndexedMapCollectErrorsDecoder<'TValue>

Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError list>

Property.map (name, decoder)

Full Usage: Property.map (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TValue> -

Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError>
Modifiers: inline
Type parameters: 'TValue

Takes a property name and applies the given decoder to the values on the properties of the object

The decoding process will stop at the first failure, and the error will be returned.

name : string

decoder : Decoder<'TValue>

Returns: JsonElement -> Result<Map<string, 'TValue>, DecodeError>

Property.seq (name, decoder)

Full Usage: Property.seq (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult seq, DecodeError list>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

This method will attempt to decode the type and collect all the errors that occur during the decoding process. If there's an error in the decoding process, the decoding will continue until there are no more, the returned error will contain a list of all the errors that occurred.

name : string

decoder : CollectErrorsDecoder<'TResult>

Returns: JsonElement -> Result<'TResult seq, DecodeError list>

Property.seq (name, decoder)

Full Usage: Property.seq (name, decoder)

Parameters:
    name : string -
    decoder : Decoder<'TResult> -

Returns: JsonElement -> Result<'TResult seq, DecodeError>
Modifiers: inline
Type parameters: 'TResult

Takes a property name and applies the given decoder to each element in the property as if it was a JSON array

The decoding process will stop at the first failure and the error will be returned.

name : string

decoder : Decoder<'TResult>

Returns: JsonElement -> Result<'TResult seq, DecodeError>

Type something to start searching.