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 or is null in the JSON element, the decoding will return an option type.

Static members

Static member Description

Property.array (name, decoder)

Full Usage: Property.array (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult array option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : CollectErrorsDecoder<'TResult>

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

Property.array (name, decoder)

Full Usage: Property.array (name, decoder)

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

Returns: JsonElement -> Result<'TResult array option, 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 fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : Decoder<'TResult>

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

Property.dict (name, decoder)

Full Usage: Property.dict (name, decoder)

Parameters:
Returns: JsonElement -> Result<Dictionary<string, 'TValue> option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : IndexedMapCollectErrorsDecoder<'TValue>

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

Property.dict (name, decoder)

Full Usage: Property.dict (name, decoder)

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

Returns: JsonElement -> Result<Dictionary<string, 'TValue> option, 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> option, DecodeError>

Property.get (name, decoder)

Full Usage: Property.get (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : CollectErrorsDecoder<'TResult>

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

Property.get (name, decoder)

Full Usage: Property.get (name, decoder)

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

Returns: JsonElement -> Result<'TResult option, 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 fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : Decoder<'TResult>

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

Property.list (name, decoder)

Full Usage: Property.list (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult list option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : CollectErrorsDecoder<'TResult>

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

Property.list (name, decoder)

Full Usage: Property.list (name, decoder)

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

Returns: JsonElement -> Result<'TResult list option, 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 fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : Decoder<'TResult>

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

Property.map (name, decoder)

Full Usage: Property.map (name, decoder)

Parameters:
Returns: JsonElement -> Result<Map<string, 'TValue> option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : IndexedMapCollectErrorsDecoder<'TValue>

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

Property.map (name, decoder)

Full Usage: Property.map (name, decoder)

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

Returns: JsonElement -> Result<Map<string, 'TValue> option, 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> option, DecodeError>

Property.seq (name, decoder)

Full Usage: Property.seq (name, decoder)

Parameters:
Returns: JsonElement -> Result<'TResult seq option, 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. The decoding process will fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : CollectErrorsDecoder<'TResult>

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

Property.seq (name, decoder)

Full Usage: Property.seq (name, decoder)

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

Returns: JsonElement -> Result<'TResult seq option, 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 fail only if the property is found, it matches the underlying type and the decoding fails. If the property is not found or is null, the decoding will return an option type.

name : string

decoder : Decoder<'TResult>

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

Type something to start searching.